-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[ui] Add additional node information in the documentation tab #2802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d2c3ca3
Add additional node information in the documentation tab
Alxiice 5e676c6
[ui] Node documentation cleanup the code
Alxiice 91182cb
[ui] node documentation : Add specific case for license in the module
Alxiice cd46b8b
[ui] NodeDocumentation : Add author and version overrides at the node…
Alxiice b4fe975
[tests] Add tests for the node documentation and infos
Alxiice 2cb2c1a
[ui] Documentation : capitalize names
Alxiice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| __version__ = "1.0" | ||
| __license__ = "no-license" | ||
|
|
||
| from meshroom.core import desc | ||
|
|
||
|
|
||
| class PluginCNodeA(desc.Node): | ||
| """PluginCNodeA""" | ||
|
|
||
| author = "testAuthor" | ||
|
|
||
| inputs = [ | ||
| desc.File( | ||
| name="input", | ||
| label="Input", | ||
| description="", | ||
| value="", | ||
| ), | ||
| ] | ||
|
|
||
| outputs = [ | ||
| desc.File( | ||
| name="output", | ||
| label="Output", | ||
| description="", | ||
| value="", | ||
| ), | ||
| ] |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| #!/usr/bin/env python | ||
| # coding:utf-8 | ||
|
|
||
| import os | ||
| from pathlib import Path | ||
|
|
||
| from meshroom.core import pluginManager, loadClassesNodes | ||
| from meshroom.core.plugins import Plugin | ||
| from meshroom.core import pluginManager | ||
| from meshroom.core import pluginManager | ||
| from meshroom.core.graph import Graph | ||
|
|
||
| from .utils import registerNodeDesc | ||
|
|
||
|
|
||
| class TestNodeInfos: | ||
| plugin = None | ||
|
|
||
| @classmethod | ||
| def setup_class(cls): | ||
| cls.folder = os.path.join(os.path.dirname(__file__), "plugins", "meshroom") | ||
| package = "pluginC" | ||
| cls.plugin = Plugin(package, cls.folder) | ||
| nodes = loadClassesNodes(cls.folder, package) | ||
| for node in nodes: | ||
| cls.plugin.addNodePlugin(node) | ||
| pluginManager.addPlugin(cls.plugin) | ||
|
|
||
| @classmethod | ||
| def teardown_class(cls): | ||
| for node in cls.plugin.nodes.values(): | ||
| pluginManager.unregisterNode(node) | ||
| cls.plugin = None | ||
|
|
||
| def test_loadedPlugin(self): | ||
| assert len(pluginManager.getPlugins()) >= 1 | ||
| plugin = pluginManager.getPlugin("pluginC") | ||
| assert plugin == self.plugin | ||
| node = plugin.nodes["PluginCNodeA"] | ||
| nodeType = node.nodeDescriptor | ||
|
|
||
| g = Graph("") | ||
| registerNodeDesc(nodeType) | ||
| node = g.addNewNode(nodeType.__name__) | ||
|
|
||
| nodeDocumentation = node.getDocumentation() | ||
| assert nodeDocumentation == "PluginCNodeA" | ||
| nodeInfos = {item["key"]: item["value"] for item in node.getNodeInfos()} | ||
| assert nodeInfos["module"] == "pluginC.PluginCNodeA" | ||
| plugin_path = os.path.join(self.folder, "pluginC", "PluginCNodeA.py") | ||
| assert nodeInfos["modulePath"] == Path(plugin_path).as_posix() # modulePath seems to follow linux convention | ||
| assert nodeInfos["author"] == "testAuthor" | ||
| assert nodeInfos["license"] == "no-license" | ||
| assert nodeInfos["version"] == "1.0" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.