def loadCompleted(self, *args, **kwargs): self.lockView(False) if 'dataset_name' in kwargs: filedir = kwargs['dataset_base'] filename = kwargs['dataset_name'] tree = kwargs['dataset_tree'] links = kwargs['dataset_references'] paths = kwargs['dataset_paths'] fgprint = Q7FingerPrint(self, filedir, filename, tree, links, paths, **kwargs) else: fgprint = self.signals.fgprint if len(fgprint) > 1: code = fgprint[1][0] msg0 = fgprint[1][1] msg1 = fgprint[1][2] MSG.wError(self, code, msg0, msg1) elif fgprint.tree is None: MSG.wError(self, 201, 'Load error', 'Fatal error while loading file, empty tree') else: child = self.loadQ7Tree(fgprint) child.show() self.setHistory(fgprint.filedir, fgprint.filename) self.updateViews() fgprint.getInfo(force=True) self.signals.fgprint = None Q7FingerPrint.killProxy() self.readyCursor()
def treeSave(cls, control, fgprint, f, saveas): flags = CGNS.MAP.S2P_DEFAULT if OCTXT.CHLoneTrace: flags |= CGNS.MAP.S2P_TRACE if not saveas: flags |= CGNS.MAP.S2P_UPDATE flags |= CGNS.MAP.S2P_DELETEMISSING tree = fgprint.tree lazylist = [CGU.getPathNoRoot(path) for path in list(fgprint.lazy)] try: CGNS.MAP.save(f, tree, links=fgprint.links, flags=flags, skip=lazylist) except (CGNS.MAP.error, ) as chlex: txt = """The current save operation has been aborted (CHLone):""" control.readyCursor() MSG.wError(control, 130, chlex[0], txt, chlex[1]) return None except (Exception, ) as e: txt = """The current save operation has been aborted: %s""" % e control.readyCursor() MSG.wError(control, 131, 0, txt, '') return None fgprint.updateFileStats(f, saveas=True)