diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2009-07-28 12:51:08 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2009-07-28 12:51:08 +0200 |
commit | 9a33be6294316f6a974b87ea67d363c9ddcb5798 (patch) | |
tree | 69290133baead393001c95341c30abf263f6ad79 | |
parent | 91758613ba284f6bda3ac0c8ffe34f1a8b308e95 (diff) | |
download | portato-9a33be6294316f6a974b87ea67d363c9ddcb5798.tar.gz portato-9a33be6294316f6a974b87ea67d363c9ddcb5798.tar.bz2 portato-9a33be6294316f6a974b87ea67d363c9ddcb5798.zip |
Make the plugins print warnings, if they get disabled due to missing imports
Diffstat (limited to '')
-rw-r--r-- | plugins/new_version.py | 5 | ||||
-rw-r--r-- | plugins/notify.py | 11 |
2 files changed, 10 insertions, 6 deletions
diff --git a/plugins/new_version.py b/plugins/new_version.py index f8d5d3c..94e61ca 100644 --- a/plugins/new_version.py +++ b/plugins/new_version.py @@ -10,13 +10,16 @@ # # Written by René 'Necoro' Neumann <necoro@necoro.net> +from portato.helper import debug, warning + try: from bzrlib import plugin, branch except ImportError: plugin = branch = None + warning("NEW_VERSION :: Cannot import 'bzrlib'") + import gobject -from portato.helper import debug, warning from portato import get_listener from portato.constants import REPOURI, VERSION, APP_ICON, APP from portato.gui.utils import GtkThread diff --git a/plugins/notify.py b/plugins/notify.py index 8f21de5..3670e20 100644 --- a/plugins/notify.py +++ b/plugins/notify.py @@ -12,16 +12,17 @@ disable = False -try: - import pynotify -except ImportError: - disable = True - from portato import get_listener from portato.helper import warning, error, debug from portato.constants import APP_ICON, APP +try: + import pynotify +except ImportError: + disable = True + warning("NOTIFY :: %s", _("Cannot import 'pynotify'.")) + class Notify (Plugin): __author__ = "René 'Necoro' Neumann" __description__ = "Show notifications when an emerge process finishes." |