Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clarify fail and warning messages #397

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions pyblish/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@ def discover(type=None, regex=None, paths=None):
for path in paths or plugin_paths():
path = os.path.normpath(path)
if not os.path.isdir(path):
log.debug("Skipped: \"%s\", path is not a valid folder", path)
log.warning("Skipped: \"%s\", path is not a valid folder", path)
continue

for fname in os.listdir(path):
Expand Down Expand Up @@ -1373,7 +1373,7 @@ def discover(type=None, regex=None, paths=None):

for plugin in plugins_from_module(module):
if not ALLOW_DUPLICATES and plugin.__name__ in plugin_names:
log.debug("Duplicate plug-in found: %s", plugin)
log.warning("Duplicate plug-in found: %s", plugin)
continue

plugin_names.append(plugin.__name__)
Expand All @@ -1386,7 +1386,7 @@ def discover(type=None, regex=None, paths=None):
# Directly registered plug-ins take precedence.
for plugin in registered_plugins():
if not ALLOW_DUPLICATES and plugin.__name__ in plugin_names:
log.debug("Duplicate plug-in found: %s", plugin)
log.warning("Duplicate plug-in found: %s", plugin)
continue

plugin_names.append(plugin.__name__)
Expand Down Expand Up @@ -1419,29 +1419,32 @@ def plugins_from_module(module):

for name in dir(module):
if name.startswith("_"):
log.debug("skipping plugins start with _ %s", obj)
continue

# It could be anything at this point
obj = getattr(module, name)

if not inspect.isclass(obj):
log.debug("Plug-in is not a class %s", obj)
continue

if not issubclass(obj, Plugin):
log.debug("Plug-in is not a subclass of Plugin %s", obj)
continue

if not plugin_is_valid(obj):
log.debug("Plug-in invalid: %s", obj)
log.warning("Plug-in invalid: %s", obj)
continue

if not version_is_compatible(obj):
log.debug("Plug-in %s not compatible with "
log.warning("Plug-in %s not compatible with "
"this version (%s) of Pyblish." % (
obj, __version__))
continue

if not host_is_compatible(obj):
log.debug("No supported host found for plugin:%s", obj)
log.warning("No supported host found for plugin:%s", obj)
continue

plugins.append(obj)
Expand Down