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
|
.. rubric:: Example
|
||||||
|
|
||||||
"""
|
"""
|
||||||
print '************************************'
|
splash = '''************************************\n
|
||||||
print '*********autoPyLoT starting*********'
|
*********autoPyLoT starting*********\n
|
||||||
print 'The Python picking and Location Tool'
|
The Python picking and Location Tool\n
|
||||||
print ' Version ', _getVersionString(), '2015'
|
Version {version} 2015\n
|
||||||
print ' '
|
\n
|
||||||
print 'Authors:'
|
Authors:\n
|
||||||
print 'S. Wehling-Benatelli'
|
S. Wehling-Benatelli (Ruhr-Universität Bochum)\n
|
||||||
print ' Ruhr-Universität Bochum'
|
L. Küperkoch (BESTEC GmbH, Landau i. d. Pfalz)\n
|
||||||
print 'L. Küperkoch'
|
K. Olbert (Christian-Albrechts Universität zu Kiel)\n
|
||||||
print ' BESTEC GmbH, Landau (Pfalz)'
|
***********************************'''.format(version=_getVersionString())
|
||||||
print 'K. Olbert'
|
print(splash)
|
||||||
print ' Christian-Albrechts Universität Kiel'
|
|
||||||
print '************************************'
|
|
||||||
|
|
||||||
# reading parameter file
|
# reading parameter file
|
||||||
|
|
||||||
@ -99,8 +97,8 @@ def autoPyLoT(inputfile):
|
|||||||
if not parameter.hasParam('eventID'):
|
if not parameter.hasParam('eventID'):
|
||||||
for event in [events for events in glob.glob(os.path.join(datapath, '*')) if os.path.isdir(events)]:
|
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, '*')))
|
data.setWFData(glob.glob(os.path.join(datapath, event, '*')))
|
||||||
print 'Working on event %s' % event
|
print('Working on event %s' % event)
|
||||||
print data
|
print(data)
|
||||||
|
|
||||||
wfdat = data.getWFData() # all available streams
|
wfdat = data.getWFData() # all available streams
|
||||||
##########################################################
|
##########################################################
|
||||||
@ -166,10 +164,10 @@ def autoPyLoT(inputfile):
|
|||||||
filedata = nllfile.read()
|
filedata = nllfile.read()
|
||||||
if filedata.find(locfiles) < 0:
|
if filedata.find(locfiles) < 0:
|
||||||
# replace old command
|
# replace old command
|
||||||
filedata = filedata.replace('LOCFILES', locfiles)
|
filedata = filedata.replace('LOCFILES', locfiles)
|
||||||
nllfile = open(locfile, 'w')
|
nllfile = open(locfile, 'w')
|
||||||
nllfile.write(filedata)
|
nllfile.write(filedata)
|
||||||
nllfile.close()
|
nllfile.close()
|
||||||
|
|
||||||
# locate the event
|
# locate the event
|
||||||
subprocess.call([nlloccall, locfile])
|
subprocess.call([nlloccall, locfile])
|
||||||
|
Loading…
Reference in New Issue
Block a user