Skip to content

Commit

Permalink
Added warning when trying to import plugin from wrong path
Browse files Browse the repository at this point in the history
Signed-off-by: Sergio Oliveira <sergio@tracy.com.br>
  • Loading branch information
seocam committed Aug 18, 2015
1 parent fd74767 commit 721677c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion colab/utils/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
logger = logging.getLogger('colab.init')
if os.environ.get('COLAB_DEBUG'):
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.INFO)
logger.setLevel(logging.DEBUG)


class InaccessibleSettings(ImproperlyConfigured):
Expand Down Expand Up @@ -107,6 +107,11 @@ def load_colab_apps():
if not app_name:
warnings.warn("Plugin missing name variable")
continue
try:
importlib.import_module(app_name)
except ImportError:
logger.warning("Cannot import plugin %s (%s)", app_name, file_name)
continue

COLAB_APPS[app_name] = {}
COLAB_APPS[app_name]['menu_title'] = py_settings_d.get('menu_title')
Expand Down

0 comments on commit 721677c

Please sign in to comment.