diff --git a/wrapping/python/plugins/ExamplePlugin/Plugin.py b/wrapping/python/plugins/ExamplePlugin/Plugin.py index e22f969ead..e68edda334 100644 --- a/wrapping/python/plugins/ExamplePlugin/Plugin.py +++ b/wrapping/python/plugins/ExamplePlugin/Plugin.py @@ -3,11 +3,33 @@ Insert documentation here. """ -from ExamplePlugin.ExampleFilter1 import ExampleFilter1 -from ExamplePlugin.ExampleFilter2 import ExampleFilter2 -from ExamplePlugin.CreateArray import CreateArrayFilter -from ExamplePlugin.InitializeData import InitializeDataPythonFilter -from ExamplePlugin.TemplateFilter import TemplateFilter +_filters = [] + +try: + from ExamplePlugin.ExampleFilter1 import ExampleFilter1 + _filters.append(ExampleFilter1) +except ImportError: + pass +try: + from ExamplePlugin.ExampleFilter2 import ExampleFilter2 + _filters.append(ExampleFilter2) +except ImportError: + pass +try: + from ExamplePlugin.CreateArray import CreateArrayFilter + _filters.append(CreateArrayFilter) +except ImportError: + pass +try: + from ExamplePlugin.InitializeData import InitializeDataPythonFilter + _filters.append(InitializeDataPythonFilter) +except ImportError: + pass +try: + from ExamplePlugin.TemplateFilter import TemplateFilter + _filters.append(TemplateFilter) +except ImportError: + pass # FILTER_INCLUDE_INSERT @@ -30,4 +52,4 @@ def vendor(self) -> str: return 'Description' def get_filters(self): - return [ExampleFilter1,ExampleFilter2,CreateArrayFilter,InitializeDataPythonFilter,TemplateFilter] # FILTER_NAME_INSERT + return _filters # FILTER_NAME_INSERT diff --git a/wrapping/python/plugins/ExamplePlugin/__init__.py b/wrapping/python/plugins/ExamplePlugin/__init__.py index 8117594a4e..b47890133c 100644 --- a/wrapping/python/plugins/ExamplePlugin/__init__.py +++ b/wrapping/python/plugins/ExamplePlugin/__init__.py @@ -1,15 +1,34 @@ from ExamplePlugin.Plugin import ExamplePlugin -from ExamplePlugin.ExampleFilter1 import ExampleFilter1 -from ExamplePlugin.ExampleFilter2 import ExampleFilter2 -from ExamplePlugin.CreateArray import CreateArrayFilter -from ExamplePlugin.InitializeData import InitializeDataPythonFilter -from ExamplePlugin.TemplateFilter import TemplateFilter +__all__ = ['ExamplePlugin', 'get_plugin'] + +try: + from ExamplePlugin.ExampleFilter1 import ExampleFilter1 + __all__.append('ExampleFilter1') +except ImportError: + pass +try: + from ExamplePlugin.ExampleFilter2 import ExampleFilter2 + __all__.append('ExampleFilter2') +except ImportError: + pass +try: + from ExamplePlugin.CreateArray import CreateArrayFilter + __all__.append('CreateArrayFilter') +except ImportError: + pass +try: + from ExamplePlugin.InitializeData import InitializeDataPythonFilter + __all__.append('InitializeDataPythonFilter') +except ImportError: + pass +try: + from ExamplePlugin.TemplateFilter import TemplateFilter + __all__.append('TemplateFilter') +except ImportError: + pass # FILTER_INCLUDE_INSERT def get_plugin(): return ExamplePlugin() - -__all__ = ['ExamplePlugin','ExampleFilter1', 'ExampleFilter2', 'CreateArrayFilter', 'InitializeDataPythonFilter', 'TemplateFilter', 'get_plugin'] # FILTER_NAME_INSERT -