From d8a9216ca78fbd448b5ef1504dd363e75d610575 Mon Sep 17 00:00:00 2001 From: Heshy Roskes Date: Mon, 19 Sep 2016 17:38:27 +0200 Subject: [PATCH] less output --- .../python/TkAlAllInOneTool/dataset.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Alignment/OfflineValidation/python/TkAlAllInOneTool/dataset.py b/Alignment/OfflineValidation/python/TkAlAllInOneTool/dataset.py index a1dd796d2c018..50fe83b6c503e 100644 --- a/Alignment/OfflineValidation/python/TkAlAllInOneTool/dataset.py +++ b/Alignment/OfflineValidation/python/TkAlAllInOneTool/dataset.py @@ -870,16 +870,26 @@ def fileList(self, parent=False, firstRun=None, lastRun=None, forcerunselection= if firstRun is not None or lastRun is not None: if firstRun is None: firstRun = -1 if lastRun is None: lastRun = float('infinity') - e = None + unknownfilenames, reasons = [], set() for filename in fileList[:]: try: if not firstRun < self.getrunnumberfromfilename(filename) < lastRun: fileList.remove(filename) except AllInOneError as e: if forcerunselection: raise - print e.message - if e is not None: - print "\nWill include those files. They will be filtered at the CMSSW level anyway." + unknownfilenames.append(e.message.split("\n")[1]) + reasons .add (e.message.split("\n")[2]) + if reasons: + if len(unknownfilenames) == len(fileList): + print "Could not figure out the run numbers of any of the filenames for the following reason(s):" + else: + print "Could not figure out the run numbers of the following filenames:" + for filename in unknownfilenames: + print " "+filename + print "for the following reason(s):" + for reason in reasons: + print " "+reason + print "Using the files anyway. The runs will be filtered at the CMSSW level." if not parent: self.__fileList = fileList else: