mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
ignore some predefined names to import
This commit is contained in:
parent
68f7826cf6
commit
a704fd44e8
1 changed files with 10 additions and 0 deletions
|
|
@ -434,8 +434,18 @@ def _load_ayon_addons(openpype_modules, modules_key, log):
|
|||
sys.path.insert(0, addon_dir)
|
||||
imported_modules = []
|
||||
for name in os.listdir(addon_dir):
|
||||
# Ignore of files is implemented to be able to run code from code
|
||||
# where usually is more files than just the addon
|
||||
# Ignore start and setup scripts
|
||||
if name in ("setup.py", "start.py"):
|
||||
continue
|
||||
|
||||
path = os.path.join(addon_dir, name)
|
||||
basename, ext = os.path.splitext(name)
|
||||
# Ignore folders/files with dot in name
|
||||
# - dot names cannot be imported in Python
|
||||
if "." in basename:
|
||||
continue
|
||||
is_dir = os.path.isdir(path)
|
||||
is_py_file = ext.lower() == ".py"
|
||||
if not is_py_file and not is_dir:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue