[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:
Candice Bentéjac 2024-12-26 15:51:49 +01:00
parent 5791bdb1bd
commit 40fd46d476
2 changed files with 9 additions and 0 deletions

View file

@ -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