mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-28 17:57:16 +02:00
[core] Node: Add a sourceCodeFolder
property
This property stores the location of the source code for a given node and is not exposed to the QML side.
This commit is contained in:
parent
5791bdb1bd
commit
40fd46d476
2 changed files with 9 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
|||
from inspect import getfile
|
||||
from pathlib import Path
|
||||
import os
|
||||
import psutil
|
||||
import shlex
|
||||
|
@ -63,6 +65,7 @@ class Node(object):
|
|||
def __init__(self):
|
||||
super(Node, self).__init__()
|
||||
self.hasDynamicOutputAttribute = any(output.isDynamicValue for output in self.outputs)
|
||||
self.sourceCodeFolder = Path(getfile(self.__class__)).parent.resolve().as_posix()
|
||||
|
||||
def upgradeAttributeValues(self, attrValues, fromVersion):
|
||||
return attrValues
|
||||
|
|
|
@ -501,6 +501,7 @@ class BaseNode(BaseObject):
|
|||
|
||||
self.packageName = self.packageVersion = ""
|
||||
self._internalFolder = ""
|
||||
self._sourceCodeFolder = ""
|
||||
|
||||
self._name = None
|
||||
self.graph = None
|
||||
|
@ -1039,6 +1040,10 @@ class BaseNode(BaseObject):
|
|||
def internalFolder(self):
|
||||
return self._internalFolder.format(**self._cmdVars)
|
||||
|
||||
@property
|
||||
def sourceCodeFolder(self):
|
||||
return self._sourceCodeFolder
|
||||
|
||||
def updateStatusFromCache(self):
|
||||
"""
|
||||
Update node status based on status file content/existence.
|
||||
|
@ -1441,6 +1446,7 @@ class Node(BaseNode):
|
|||
self.packageName = self.nodeDesc.packageName
|
||||
self.packageVersion = self.nodeDesc.packageVersion
|
||||
self._internalFolder = self.nodeDesc.internalFolder
|
||||
self._sourceCodeFolder = self.nodeDesc.sourceCodeFolder
|
||||
|
||||
for attrDesc in self.nodeDesc.inputs:
|
||||
self._attributes.add(attributeFactory(attrDesc, kwargs.get(attrDesc.name, None), isOutput=False, node=self))
|
||||
|
|
Loading…
Add table
Reference in a new issue