mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-29 10:17:27 +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 os
|
||||||
import psutil
|
import psutil
|
||||||
import shlex
|
import shlex
|
||||||
|
@ -63,6 +65,7 @@ class Node(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Node, self).__init__()
|
super(Node, self).__init__()
|
||||||
self.hasDynamicOutputAttribute = any(output.isDynamicValue for output in self.outputs)
|
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):
|
def upgradeAttributeValues(self, attrValues, fromVersion):
|
||||||
return attrValues
|
return attrValues
|
||||||
|
|
|
@ -501,6 +501,7 @@ class BaseNode(BaseObject):
|
||||||
|
|
||||||
self.packageName = self.packageVersion = ""
|
self.packageName = self.packageVersion = ""
|
||||||
self._internalFolder = ""
|
self._internalFolder = ""
|
||||||
|
self._sourceCodeFolder = ""
|
||||||
|
|
||||||
self._name = None
|
self._name = None
|
||||||
self.graph = None
|
self.graph = None
|
||||||
|
@ -1039,6 +1040,10 @@ class BaseNode(BaseObject):
|
||||||
def internalFolder(self):
|
def internalFolder(self):
|
||||||
return self._internalFolder.format(**self._cmdVars)
|
return self._internalFolder.format(**self._cmdVars)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def sourceCodeFolder(self):
|
||||||
|
return self._sourceCodeFolder
|
||||||
|
|
||||||
def updateStatusFromCache(self):
|
def updateStatusFromCache(self):
|
||||||
"""
|
"""
|
||||||
Update node status based on status file content/existence.
|
Update node status based on status file content/existence.
|
||||||
|
@ -1441,6 +1446,7 @@ class Node(BaseNode):
|
||||||
self.packageName = self.nodeDesc.packageName
|
self.packageName = self.nodeDesc.packageName
|
||||||
self.packageVersion = self.nodeDesc.packageVersion
|
self.packageVersion = self.nodeDesc.packageVersion
|
||||||
self._internalFolder = self.nodeDesc.internalFolder
|
self._internalFolder = self.nodeDesc.internalFolder
|
||||||
|
self._sourceCodeFolder = self.nodeDesc.sourceCodeFolder
|
||||||
|
|
||||||
for attrDesc in self.nodeDesc.inputs:
|
for attrDesc in self.nodeDesc.inputs:
|
||||||
self._attributes.add(attributeFactory(attrDesc, kwargs.get(attrDesc.name, None), isOutput=False, node=self))
|
self._attributes.add(attributeFactory(attrDesc, kwargs.get(attrDesc.name, None), isOutput=False, node=self))
|
||||||
|
|
Loading…
Add table
Reference in a new issue