Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions meshroom/core/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,32 +787,32 @@ def getDocumentation(self):
else:
return self.nodeDesc.__doc__

def getNodeInfos(self):
def getNodeInfo(self):
if not self.nodeDesc:
return []
infos = OrderedDict([
info = OrderedDict([
("module", self.nodeDesc.__module__),
("modulePath", self.nodeDesc.plugin.path),
])
# > Infos from the plugin module
# > Info from the plugin module
plugin_module = sys.modules.get(self.nodeDesc.__module__)
if getattr(plugin_module, "__author__", None):
infos["author"] = plugin_module.__author__
info["author"] = plugin_module.__author__
if getattr(plugin_module, "__license__", None):
infos["license"] = plugin_module.__license__
info["license"] = plugin_module.__license__
if getattr(plugin_module, "__version__", None):
infos["version"] = plugin_module.__version__
info["version"] = plugin_module.__version__
# > Overrides at the node-level
if getattr(self.nodeDesc, "author", None):
infos["author"] = self.nodeDesc.author
info["author"] = self.nodeDesc.author
if getattr(self.nodeDesc, "version", None):
infos["version"] = self.nodeDesc.version
# > Additional node infos stored in a __nodeInfo__ parameter
additionalNodeInfos = getattr(self.nodeDesc, "__nodeInfo__", None)
if additionalNodeInfos:
for key, value in additionalNodeInfos:
infos[key] = value
return [{"key": k, "value": v} for k, v in infos.items()]
info["version"] = self.nodeDesc.version
# > Additional node information stored in a __nodeInfo__ parameter
additionalNodeInfo = getattr(self.nodeDesc, "__nodeInfo__", None)
if additionalNodeInfo:
for key, value in additionalNodeInfo:
info[key] = value
return [{"key": k, "value": v} for k, v in info.items()]

@property
def packageFullName(self):
Expand Down Expand Up @@ -1767,7 +1767,7 @@ def _hasDisplayableShape(self):
defaultLabel = Property(str, getDefaultLabel, constant=True)
nodeType = Property(str, nodeType.fget, constant=True)
documentation = Property(str, getDocumentation, constant=True)
nodeInfos = Property(Variant, getNodeInfos, constant=True)
nodeInfo = Property(Variant, getNodeInfo, constant=True)
positionChanged = Signal()
position = Property(Variant, position.fget, position.fset, notify=positionChanged)
x = Property(float, lambda self: self._position.x, notify=positionChanged)
Expand Down
2 changes: 1 addition & 1 deletion meshroom/ui/components/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _getMessagesDict(self, fullDate=False):
return messages

def getMessages(self):
""" Get the messages with simple date infos.
""" Get the messages with simple date information.
Reverse the list to make sure we see the most recent item on top
"""
return self._getMessagesDict()[::-1]
Expand Down
2 changes: 1 addition & 1 deletion meshroom/ui/qml/GraphEditor/NodeDocumentation.qml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ FocusScope {
height: childrenRect.height
Layout.preferredWidth: width
spacing: 3
model: node.nodeInfos
model: node.nodeInfo
delegate: nodeInfoItem
}

Expand Down
4 changes: 2 additions & 2 deletions meshroom/ui/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

class QmlInstantEngine(QQmlApplicationEngine):
"""
QmlInstantEngine is an utility class helping developing QML applications.
QmlInstantEngine is a utility class helping to develop QML applications.
It reloads itself whenever one of the watched source files is modified.
As it consumes resources, make sure to disable file watching in production mode.
"""

def __init__(self, sourceFile="", watching=True, verbose=False, parent=None):
"""
watching -- Defines whether the watcher is active (default: True)
verbose -- if True, output log infos (default: False)
verbose -- if True, output log information (default: False)
"""
super().__init__(parent)

Expand Down
14 changes: 7 additions & 7 deletions tests/test_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from .utils import registerNodeDesc


class TestNodeInfos:
class TestNodeInfo:
plugin = None

@classmethod
Expand Down Expand Up @@ -43,13 +43,13 @@ def test_loadedPlugin(self):

nodeDocumentation = node.getDocumentation()
assert nodeDocumentation == "PluginCNodeA"
nodeInfos = {item["key"]: item["value"] for item in node.getNodeInfos()}
assert nodeInfos["module"] == "pluginC.PluginCNodeA"
nodeInfo = {item["key"]: item["value"] for item in node.getNodeInfo()}
assert nodeInfo["module"] == "pluginC.PluginCNodeA"
pluginPath = os.path.join(self.folder, "pluginC", "PluginCNodeA.py")
assert nodeInfos["modulePath"] == Path(pluginPath).as_posix() # modulePath seems to follow linux convention
assert nodeInfos["author"] == "testAuthor"
assert nodeInfos["license"] == "no-license"
assert nodeInfos["version"] == "1.0"
assert nodeInfo["modulePath"] == Path(pluginPath).as_posix() # modulePath seems to follow Linux convention
assert nodeInfo["author"] == "testAuthor"
assert nodeInfo["license"] == "no-license"
assert nodeInfo["version"] == "1.0"


class TestNodeVariables:
Expand Down