diff --git a/openpype/lib/__init__.py b/openpype/lib/__init__.py index 52a6024feb..9bcd0f7587 100644 --- a/openpype/lib/__init__.py +++ b/openpype/lib/__init__.py @@ -56,7 +56,7 @@ from .python_module_tools import ( modules_from_path, recursive_bases_from_class, classes_from_module, - load_module_from_dirpath + import_module_from_dirpath ) from .avalon_context import ( @@ -176,7 +176,7 @@ __all__ = [ "modules_from_path", "recursive_bases_from_class", "classes_from_module", - "load_module_from_dirpath", + "import_module_from_dirpath", "CURRENT_DOC_SCHEMAS", "PROJECT_NAME_ALLOWED_SYMBOLS", diff --git a/openpype/lib/python_module_tools.py b/openpype/lib/python_module_tools.py index 102ae7e71a..59e7ad9123 100644 --- a/openpype/lib/python_module_tools.py +++ b/openpype/lib/python_module_tools.py @@ -136,7 +136,7 @@ def classes_from_module(superclass, module): return classes -def _load_module_from_dirpath_py2(dirpath, module_name, dst_module_name): +def _import_module_from_dirpath_py2(dirpath, module_name, dst_module_name): full_module_name = "{}.{}".format(dst_module_name, module_name) if full_module_name in sys.modules: return sys.modules[full_module_name] @@ -152,7 +152,7 @@ def _load_module_from_dirpath_py2(dirpath, module_name, dst_module_name): return module -def _load_module_from_dirpath_py3(dirpath, module_name, dst_module_name): +def _import_module_from_dirpath_py3(dirpath, module_name, dst_module_name): full_module_name = "{}.{}".format(dst_module_name, module_name) if full_module_name in sys.modules: return sys.modules[full_module_name] @@ -179,13 +179,13 @@ def _load_module_from_dirpath_py3(dirpath, module_name, dst_module_name): return module -def load_module_from_dirpath(dirpath, folder_name, dst_module_name): +def import_module_from_dirpath(dirpath, folder_name, dst_module_name): if PY3: - module = _load_module_from_dirpath_py3( + module = _import_module_from_dirpath_py3( dirpath, folder_name, dst_module_name ) else: - module = _load_module_from_dirpath_py2( + module = _import_module_from_dirpath_py2( dirpath, folder_name, dst_module_name ) return module diff --git a/openpype/modules/base.py b/openpype/modules/base.py index f0fb6c91fa..fc53d3b27a 100644 --- a/openpype/modules/base.py +++ b/openpype/modules/base.py @@ -173,7 +173,7 @@ def load_modules(force=False): # Import helper functions from lib from openpype.lib import ( import_filepath, - load_module_from_dirpath + import_module_from_dirpath ) # Change `sys.modules` @@ -203,7 +203,7 @@ def load_modules(force=False): # TODO add more logic how to define if folder is module or not # - check manifest and content of manifest if os.path.isdir(fullpath): - module = load_module_from_dirpath( + module = import_module_from_dirpath( dirpath, filename, modules_key ) module_name = filename