Debuged: Avoids writing multiple LOCFILES-command lines if same event is processed several times.

This commit is contained in:
Ludger Küperkoch 2015-10-27 16:51:42 +01:00
parent d5b3a7d40f
commit 6676484a61

View File

@ -7,7 +7,7 @@ import argparse
import glob import glob
import subprocess import subprocess
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import pdb
from obspy.core import read from obspy.core import read
from pylot.core.read.data import Data from pylot.core.read.data import Data
from pylot.core.read.inputs import AutoPickParameter from pylot.core.read.inputs import AutoPickParameter
@ -157,6 +157,7 @@ def autoPyLoT(inputfile):
filedata = None filedata = None
nllfile = open(locfile, 'r') nllfile = open(locfile, 'r')
filedata = nllfile.read() filedata = nllfile.read()
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')