Check if data directory exists to avoid program abortion.

This commit is contained in:
Ludger Küperkoch 2020-09-22 10:30:48 +02:00
parent 37c8858096
commit dccbaa357a

View File

@ -3807,6 +3807,7 @@ class Project(object):
datapaths.append(event.datapath)
for datapath in datapaths:
datapath = os.path.join(self.rootpath, datapath)
if os.path.isdir(datapath):
for filename in os.listdir(datapath):
filename = os.path.join(datapath, filename)
if os.path.isfile(filename) and filename.endswith(fext):
@ -3814,6 +3815,8 @@ class Project(object):
self.read_eventfile_info(filename)
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):
'''