reformatted the file to avoid usage of tabs and spaces and made a more pythonic splash message than multiple calls to print
This commit is contained in:
parent
d8a59ac81d
commit
223902f2d4
36
autoPyLoT.py
36
autoPyLoT.py
@ -32,19 +32,17 @@ def autoPyLoT(inputfile):
|
||||
.. rubric:: Example
|
||||
|
||||
"""
|
||||
print '************************************'
|
||||
print '*********autoPyLoT starting*********'
|
||||
print 'The Python picking and Location Tool'
|
||||
print ' Version ', _getVersionString(), '2015'
|
||||
print ' '
|
||||
print 'Authors:'
|
||||
print 'S. Wehling-Benatelli'
|
||||
print ' Ruhr-Universität Bochum'
|
||||
print 'L. Küperkoch'
|
||||
print ' BESTEC GmbH, Landau (Pfalz)'
|
||||
print 'K. Olbert'
|
||||
print ' Christian-Albrechts Universität Kiel'
|
||||
print '************************************'
|
||||
splash = '''************************************\n
|
||||
*********autoPyLoT starting*********\n
|
||||
The Python picking and Location Tool\n
|
||||
Version {version} 2015\n
|
||||
\n
|
||||
Authors:\n
|
||||
S. Wehling-Benatelli (Ruhr-Universität Bochum)\n
|
||||
L. Küperkoch (BESTEC GmbH, Landau i. d. Pfalz)\n
|
||||
K. Olbert (Christian-Albrechts Universität zu Kiel)\n
|
||||
***********************************'''.format(version=_getVersionString())
|
||||
print(splash)
|
||||
|
||||
# reading parameter file
|
||||
|
||||
@ -99,8 +97,8 @@ def autoPyLoT(inputfile):
|
||||
if not parameter.hasParam('eventID'):
|
||||
for event in [events for events in glob.glob(os.path.join(datapath, '*')) if os.path.isdir(events)]:
|
||||
data.setWFData(glob.glob(os.path.join(datapath, event, '*')))
|
||||
print 'Working on event %s' % event
|
||||
print data
|
||||
print('Working on event %s' % event)
|
||||
print(data)
|
||||
|
||||
wfdat = data.getWFData() # all available streams
|
||||
##########################################################
|
||||
@ -166,10 +164,10 @@ def autoPyLoT(inputfile):
|
||||
filedata = nllfile.read()
|
||||
if filedata.find(locfiles) < 0:
|
||||
# replace old command
|
||||
filedata = filedata.replace('LOCFILES', locfiles)
|
||||
nllfile = open(locfile, 'w')
|
||||
nllfile.write(filedata)
|
||||
nllfile.close()
|
||||
filedata = filedata.replace('LOCFILES', locfiles)
|
||||
nllfile = open(locfile, 'w')
|
||||
nllfile.write(filedata)
|
||||
nllfile.close()
|
||||
|
||||
# locate the event
|
||||
subprocess.call([nlloccall, locfile])
|
||||
|
Loading…
Reference in New Issue
Block a user