From ddb1fb8b97c9c3ff0a387681fa67fe0c24cb82dc Mon Sep 17 00:00:00 2001 From: marcel Date: Thu, 3 Aug 2017 14:49:32 +0200 Subject: [PATCH] [add] multiple eventIDs possible as eventID pylot_parameter (testing needed) --- autoPyLoT.py | 9 +++++++-- pylot/core/util/widgets.py | 7 +++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/autoPyLoT.py b/autoPyLoT.py index f3ec8fd5..9bad46f1 100755 --- a/autoPyLoT.py +++ b/autoPyLoT.py @@ -164,9 +164,14 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even # multiple event processing # read each event in database events = [events for events in glob.glob(os.path.join(datapath, '*')) if os.path.isdir(events)] - elif fnames == 'None' and parameter['eventID'] is not '*': + elif fnames == 'None' and parameter['eventID'] is not '*' and not type(parameter['eventID']) == list: # single event processing events = glob.glob(os.path.join(datapath, parameter['eventID'])) + elif fnames == 'None' and type(parameter['eventID']) == list: + # multiple event processing + events = [] + for eventID in parameter['eventID']: + events.append(os.path.join(datapath, eventID)) else: # autoPyLoT was initialized from GUI events = [] @@ -450,7 +455,7 @@ if __name__ == "__main__": parser.add_argument('-f', '-F', '--fnames', type=str, action='store', help='''optional, list of data file names''') - parser.add_argument('-e', '-E', '--eventid', type=str, + parser.add_argument('-e', '--eventid', type=str, action='store', help='''optional, event path incl. event ID''') parser.add_argument('-s', '-S', '--spath', type=str, diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index 3b56b95d..00d40501 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -2898,8 +2898,15 @@ class AutoPickDlg(QDialog): def exportParameter(self): pylot_params = self.parent()._inputs + self.addEvents2pp(pylot_params) pylot_params.export2File(self.pp_export) + def addEvents2pp(self, pylot_parameter): + eventIDs = [] + for event in self.parent().project.eventlist: + eventIDs.append(event.pylot_id) + pylot_parameter['eventID'] = eventIDs + def accept(self): self.exportParameter() self.job_widget.start(self.pp_export, self.sb_ncores.value())