From 06543f89a95e8f1220a636fc7af4088b5026fce5 Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Sat, 21 Sep 2019 18:19:17 +0200 Subject: [PATCH] [core] use more explicit argument name: setupFileRef --- bin/meshroom_photogrammetry | 2 +- meshroom/core/graph.py | 12 ++++++------ meshroom/ui/graph.py | 6 +++--- meshroom/ui/reconstruction.py | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bin/meshroom_photogrammetry b/bin/meshroom_photogrammetry index 0fdb7974..050e0e20 100755 --- a/bin/meshroom_photogrammetry +++ b/bin/meshroom_photogrammetry @@ -134,7 +134,7 @@ if args.scale > 0: graph.cacheDir = args.cache if args.cache else meshroom.core.defaultCacheFolder if args.save: - graph.save(args.save, fileLink=not bool(args.cache)) + graph.save(args.save, setupFileRef=not bool(args.cache)) print('File successfully saved: "{}"'.format(args.save)) if not args.output: diff --git a/meshroom/core/graph.py b/meshroom/core/graph.py index 6ac38e4c..4f854c7a 100644 --- a/meshroom/core/graph.py +++ b/meshroom/core/graph.py @@ -234,14 +234,14 @@ class Graph(BaseObject): return Graph.IO.getFeaturesForVersion(self.header.get(Graph.IO.Keys.FileVersion, "0.0")) @Slot(str) - def load(self, filepath, fileLink=True): + def load(self, filepath, setupFileRef=True): """ Load a meshroom graph ".mg" file. Args: filepath: project filepath to load - fileLink: Setup link to the project file, like setup cacheDir, keep filepath for save, etc. - This option allows to disable it, to only load the project file as a template + setupFileRef: Setup reference to the project file, like setup cacheDir, keep filepath for save, etc. + This option allows to disable it, to only load the project file as a template. """ self.clear() with open(filepath) as jsonFile: @@ -273,7 +273,7 @@ class Graph(BaseObject): # Add node to the graph with raw attributes values self._addNode(n, nodeName) - if fileLink: + if setupFileRef: # Update filepath related members self._setFilepath(filepath) @@ -905,7 +905,7 @@ class Graph(BaseObject): def asString(self): return str(self.toDict()) - def save(self, filepath=None, fileLink=True): + def save(self, filepath=None, setupFileRef=True): path = filepath or self._filepath if not path: raise ValueError("filepath must be specified for unsaved files.") @@ -929,7 +929,7 @@ class Graph(BaseObject): with open(path, 'w') as jsonFile: json.dump(data, jsonFile, indent=4) - if path != self._filepath and fileLink: + if path != self._filepath and setupFileRef: self._setFilepath(path) def _setFilepath(self, filepath): diff --git a/meshroom/ui/graph.py b/meshroom/ui/graph.py index 3042e115..d46a2469 100644 --- a/meshroom/ui/graph.py +++ b/meshroom/ui/graph.py @@ -313,11 +313,11 @@ class UIGraph(QObject): def setDefaultPipeline(self, pipelineFilepath): self._defaultPipelineFilepath = pipelineFilepath - self._graph.load(pipelineFilepath, fileLink=False) + self._graph.load(pipelineFilepath, setupFileRef=False) - def load(self, filepath, fileLink=True): + def load(self, filepath, setupFileRef=True): g = Graph('') - g.load(filepath, fileLink) + g.load(filepath, setupFileRef) if not os.path.exists(g.cacheDir): os.mkdir(g.cacheDir) self.setGraph(g) diff --git a/meshroom/ui/reconstruction.py b/meshroom/ui/reconstruction.py index b8852480..ad43b473 100755 --- a/meshroom/ui/reconstruction.py +++ b/meshroom/ui/reconstruction.py @@ -197,14 +197,14 @@ class Reconstruction(UIGraph): """ Create a new photogrammetry pipeline. """ if self._defaultPipelineFilepath: # use the user-provided default photogrammetry project file - self.load(self._defaultPipelineFilepath, fileLink=False) + self.load(self._defaultPipelineFilepath, setupFileRef=False) else: # default photogrammetry pipeline self.setGraph(multiview.photogrammetry()) - def load(self, filepath, fileLink=True): + def load(self, filepath, setupFileRef=True): try: - super(Reconstruction, self).load(filepath, fileLink) + super(Reconstruction, self).load(filepath, setupFileRef) # warn about pre-release projects being automatically upgraded if Version(self._graph.fileReleaseVersion).major == "0": self.warning.emit(Message(