From 40b47b84401130b48b957a969822806345a8667c Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Wed, 20 Apr 2016 10:59:45 +0200 Subject: [PATCH] browser: robustify loading --- artiq/browser/files.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/artiq/browser/files.py b/artiq/browser/files.py index 38bfec7f3..ed62a950f 100644 --- a/artiq/browser/files.py +++ b/artiq/browser/files.py @@ -116,13 +116,9 @@ class FilesDock(QtWidgets.QDockWidget): return logger.info("loading datasets from %s", info.filePath()) with f: - rd = {} - try: - group = f["datasets"] - except KeyError: + if "datasets" not in f: return - for k in f["datasets"]: - rd[k] = True, group[k].value + rd = dict((k, (True, v.value)) for k, v in f["datasets"].items()) self.datasets.init(rd) def double_clicked(self, current): @@ -138,6 +134,8 @@ class FilesDock(QtWidgets.QDockWidget): return logger.info("loading experiment for %s", info.filePath()) with f: + if "expid" not in f: + return expid = pyon.decode(f["expid"].value) def select_dir(self, path):