[add] check for event data
This commit is contained in:
parent
4918448d92
commit
8dabfb41d8
13
PyLoT.py
13
PyLoT.py
@ -1138,7 +1138,7 @@ class MainWindow(QMainWindow):
|
||||
Initiate GUI widgets in case of changed or newly added events.
|
||||
'''
|
||||
nitems = self.eventBox.count()
|
||||
if len(self.project.eventlist) == 0:
|
||||
if len(self.project.eventlist) == 0 or not self.data_check():
|
||||
print('No events to init.')
|
||||
self.clearWaveformDataPlot()
|
||||
return
|
||||
@ -1151,6 +1151,17 @@ class MainWindow(QMainWindow):
|
||||
self.refreshEvents()
|
||||
tabindex = self.tabs.currentIndex()
|
||||
|
||||
def data_check(self):
|
||||
paths_exist = [os.path.exists(event.path) for event in self.project.eventlist]
|
||||
if all(paths_exist):
|
||||
return True
|
||||
else:
|
||||
info_str = ''
|
||||
for event, path_exists in zip(self.project.eventlist, paths_exist):
|
||||
info_str += '\n{} exists: {}'.format(event.path, path_exists)
|
||||
print('Unable to find certain event paths:{}'.format(info_str))
|
||||
return False
|
||||
|
||||
def fill_eventbox(self, event=None, eventBox=None, select_events='all'):
|
||||
'''
|
||||
(Re)fill the selected eventBox (type = QtGui.QComboBox).
|
||||
|
@ -1 +1 @@
|
||||
9e74-dirty
|
||||
4918-dirty
|
||||
|
Loading…
Reference in New Issue
Block a user