Merge pull request #3022 from pypeclub/bugfix/add_example_addons_to_ignored

General: Add example addons to ignored
This commit is contained in:
Jakub Trllo 2022-04-06 14:25:52 +02:00 committed by GitHub
commit 32f6418c4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 8 deletions

View file

@ -37,6 +37,8 @@ IGNORED_DEFAULT_FILENAMES = (
"__init__.py",
"base.py",
"interfaces.py",
"example_addons",
"default_modules",
)
@ -303,7 +305,16 @@ def _load_modules():
fullpath = os.path.join(current_dir, filename)
basename, ext = os.path.splitext(filename)
if not os.path.isdir(fullpath) and ext not in (".py", ):
if os.path.isdir(fullpath):
# Check existence of init fil
init_path = os.path.join(fullpath, "__init__.py")
if not os.path.exists(init_path):
log.debug((
"Module directory does not contan __init__.py file {}"
).format(fullpath))
continue
elif ext not in (".py", ):
continue
try:
@ -341,7 +352,16 @@ def _load_modules():
fullpath = os.path.join(dirpath, filename)
basename, ext = os.path.splitext(filename)
if not os.path.isdir(fullpath) and ext not in (".py", ):
if os.path.isdir(fullpath):
# Check existence of init fil
init_path = os.path.join(fullpath, "__init__.py")
if not os.path.exists(init_path):
log.debug((
"Module directory does not contan __init__.py file {}"
).format(fullpath))
continue
elif ext not in (".py", ):
continue
# TODO add more logic how to define if folder is module or not

View file

@ -1,11 +1,6 @@
import os
from openpype_modules.ftrack.lib import BaseAction, statics_icon
from avalon import lib as avalonlib
from openpype.api import (
Anatomy,
get_project_settings
)
from openpype.lib import ApplicationManager
from openpype.api import Anatomy
class CreateFolders(BaseAction):