forked from M-Labs/artiq
1
0
Fork 0

browser: robustify loading

This commit is contained in:
Robert Jördens 2016-04-20 10:59:45 +02:00
parent 5ebdd5c106
commit 40b47b8440
1 changed files with 4 additions and 6 deletions

View File

@ -116,13 +116,9 @@ class FilesDock(QtWidgets.QDockWidget):
return return
logger.info("loading datasets from %s", info.filePath()) logger.info("loading datasets from %s", info.filePath())
with f: with f:
rd = {} if "datasets" not in f:
try:
group = f["datasets"]
except KeyError:
return return
for k in f["datasets"]: rd = dict((k, (True, v.value)) for k, v in f["datasets"].items())
rd[k] = True, group[k].value
self.datasets.init(rd) self.datasets.init(rd)
def double_clicked(self, current): def double_clicked(self, current):
@ -138,6 +134,8 @@ class FilesDock(QtWidgets.QDockWidget):
return return
logger.info("loading experiment for %s", info.filePath()) logger.info("loading experiment for %s", info.filePath())
with f: with f:
if "expid" not in f:
return
expid = pyon.decode(f["expid"].value) expid = pyon.decode(f["expid"].value)
def select_dir(self, path): def select_dir(self, path):