From 624d0dd5d4ea23553a83121218a9d445257e7427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Fri, 4 Jul 2008 17:37:01 +0200 Subject: Ignore errors on plugin loading --- portato/plugin.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'portato/plugin.py') diff --git a/portato/plugin.py b/portato/plugin.py index ada7a0f..b6376da 100644 --- a/portato/plugin.py +++ b/portato/plugin.py @@ -14,6 +14,7 @@ from __future__ import absolute_import import os import os.path as osp +import traceback from collections import defaultdict from functools import wraps @@ -145,6 +146,8 @@ class PluginQueue (object): else: if f.endswith(".py"): plugins.append(f[:-3]) + elif f.endswith(".pyc") or f.endswith(".pyo"): + pass # ignore .pyc and .pyo else: debug("'%s' is not a plugin: not a .py file", path) @@ -157,6 +160,9 @@ class PluginQueue (object): exec "from portato.plugins import %s" % p in {} except PluginLoadException, e: error(_("Loading plugin '%(plugin)s' failed: %(error)s"), {"plugin" : p, "error" : e.message}) + except: + tb = traceback.format_exc() + error(_("Loading plugin '%(plugin)s' failed: %(error)s"), {"plugin" : p, "error" : tb}) self._organize() -- cgit v1.2.3