From 43d243e0a1a1123802bd0b8dd7eda28c4e9eafdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludger=20K=C3=BCperkoch?= Date: Tue, 27 Oct 2015 16:53:11 +0100 Subject: [PATCH] Same for multiple event processing. --- autoPyLoT.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/autoPyLoT.py b/autoPyLoT.py index 9ae760f7..77436b66 100755 --- a/autoPyLoT.py +++ b/autoPyLoT.py @@ -119,11 +119,12 @@ def autoPyLoT(inputfile): filedata = None nllfile = open(locfile, 'r') filedata = nllfile.read() - # replace old command - filedata = filedata.replace('LOCFILES', locfiles) - nllfile = open(locfile, 'w') - nllfile.write(filedata) - nllfile.close() + if filedata.find(locfiles) < 0: + # replace old command + filedata = filedata.replace('LOCFILES', locfiles) + nllfile = open(locfile, 'w') + nllfile.write(filedata) + nllfile.close() # locate the event subprocess.call([nlloccall, locfile])