Check if data directory exists to avoid program abortion.
This commit is contained in:
parent
37c8858096
commit
dccbaa357a
17
PyLoT.py
17
PyLoT.py
@ -3807,13 +3807,16 @@ class Project(object):
|
|||||||
datapaths.append(event.datapath)
|
datapaths.append(event.datapath)
|
||||||
for datapath in datapaths:
|
for datapath in datapaths:
|
||||||
datapath = os.path.join(self.rootpath, datapath)
|
datapath = os.path.join(self.rootpath, datapath)
|
||||||
for filename in os.listdir(datapath):
|
if os.path.isdir(datapath):
|
||||||
filename = os.path.join(datapath, filename)
|
for filename in os.listdir(datapath):
|
||||||
if os.path.isfile(filename) and filename.endswith(fext):
|
filename = os.path.join(datapath, filename)
|
||||||
try:
|
if os.path.isfile(filename) and filename.endswith(fext):
|
||||||
self.read_eventfile_info(filename)
|
try:
|
||||||
except Exception as e:
|
self.read_eventfile_info(filename)
|
||||||
print('Failed on reading eventfile info from file {}: {}'.format(filename, e))
|
except Exception as e:
|
||||||
|
print('Failed on reading eventfile info from file {}: {}'.format(filename, e))
|
||||||
|
else:
|
||||||
|
print("Directory %s does not exist!" % datapath)
|
||||||
|
|
||||||
def getPaths(self):
|
def getPaths(self):
|
||||||
'''
|
'''
|
||||||
|
Loading…
Reference in New Issue
Block a user