[add] change seperator for event initiation from system specific to '/'

This commit is contained in:
Marcel Paffrath 2017-08-02 11:37:17 +02:00
parent d5645cf979
commit dfa04f7b0a

View File

@ -27,6 +27,7 @@ from pylot.core.util.structure import DATASTRUCTURE
from pylot.core.util.version import get_git_version as _getVersionString from pylot.core.util.version import get_git_version as _getVersionString
from pylot.core.util.event import Event from pylot.core.util.event import Event
from pylot.core.util.utils import real_None from pylot.core.util.utils import real_None
from pylot.core.util.defaults import SEPARATOR
__version__ = _getVersionString() __version__ = _getVersionString()
@ -83,8 +84,9 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even
parameter = PylotParameter(inputfile) parameter = PylotParameter(inputfile)
iplot = parameter['iplot'] iplot = parameter['iplot']
else: else:
print('No parameters set and no input file given. Choose either of both.') infile = os.path.join(os.path.expanduser('~'), '.pylot', 'pylot.in')
return print('Using default input file {}'.format(infile))
parameter = PylotParameter(infile)
else: else:
if not type(parameter) == PylotParameter: if not type(parameter) == PylotParameter:
print('Wrong input type for parameter: {}'.format(type(parameter))) print('Wrong input type for parameter: {}'.format(type(parameter)))
@ -168,6 +170,11 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even
print('autoPyLoT: No events given. Return!') print('autoPyLoT: No events given. Return!')
return return
# transform system path separator to '/'
for index, event in enumerate(events):
event = event.replace(SEPARATOR, '/')
events[index] = event
for event in events: for event in events:
pylot_event = Event(event) #event should be path to event directory pylot_event = Event(event) #event should be path to event directory
data.setEvtData(pylot_event) data.setEvtData(pylot_event)