diff --git a/shapeout/gui/explorer.py b/shapeout/gui/explorer.py index 782d000..d3778bf 100644 --- a/shapeout/gui/explorer.py +++ b/shapeout/gui/explorer.py @@ -117,7 +117,7 @@ def BoldifyData(self, data=[]): k.SetBold(True) def external_analyze(self, *args, **kwargs): - """ to be overwritten """ + """ to be overridden """ pass def OnAnalyze(self, e=None): @@ -193,7 +193,7 @@ def SelectData(self, data=[]): self.htreectrl.CheckItem(k) def SetProjectTree(self, data, add=False, marked=[]): - """ Find projects in `directory` and update tree view + """ Update tree view with measurement data information Parameters ---------- diff --git a/shapeout/tlabwrap.py b/shapeout/tlabwrap.py index 665e184..919686a 100644 --- a/shapeout/tlabwrap.py +++ b/shapeout/tlabwrap.py @@ -1232,7 +1232,7 @@ def GetTDMSTreeGUI(directories): for f in files: if not IsFullMeasurement(f): - # Ignore measurements that have missing camera or para inis. + # Ignore broken measurements continue path, name = os.path.split(f) # try to find the path in pathdict @@ -1262,15 +1262,26 @@ def IsFullMeasurement(fname): """ Checks for existence of ini files and returns False if some files are missing. """ + is_ok = True path, name = os.path.split(fname) mx = name.split("_")[0] stem = os.path.join(path, mx) + + # Check if all config files are present if ( (not os.path.exists(stem+"_para.ini")) or (not os.path.exists(stem+"_camera.ini")) or (not os.path.exists(fname)) ): - return False - else: - return True + is_ok = False + + # Check if we can perform all standard file operations + for test in [GetRegion, GetFlowRate, GetEvents]: + try: + test(fname) + except: + is_ok = False + break + + return is_ok def GetDefaultConfiguration(key=None):