File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 22from unittest .mock import patch
33
44import meshroom
5- from meshroom .core import desc , pluginManager
5+ from meshroom .core import desc , pluginManager , loadPluginFolder
66from meshroom .core .plugins import NodePlugin , NodePluginStatus
77
8+ import os
89
910@contextmanager
1011def registeredNodeTypes (nodeTypes : list [desc .Node ]):
@@ -45,3 +46,13 @@ def unregisterNodeDesc(nodeDesc: desc.Node):
4546 plugin = pluginManager .getRegisteredNodePlugin (name )
4647 plugin .status = NodePluginStatus .NOT_LOADED
4748 del pluginManager ._nodePlugins [name ]
49+
50+ @contextmanager
51+ def registeredPlugins (folder : str ):
52+ folder = os .path .join (os .path .dirname (__file__ ), "plugins" )
53+ plugins = loadPluginFolder (folder )
54+
55+ yield
56+
57+ for plugin in plugins :
58+ pluginManager .removePlugin (plugin )
You can’t perform that action at this time.
0 commit comments