diff --git a/GTG/plugins/hamster/hamster.py b/GTG/plugins/hamster/hamster.py index c0494d8cc..d4dbbc103 100644 --- a/GTG/plugins/hamster/hamster.py +++ b/GTG/plugins/hamster/hamster.py @@ -16,6 +16,7 @@ # this program. If not, see . # ----------------------------------------------------------------------------- +import logging import datetime import os import time @@ -28,6 +29,7 @@ from GTG.core.tasks import Task from GTG.plugins.hamster.helper import FactBuilder +log = logging.getLogger(__name__) class HamsterPlugin(): PLUGIN_NAMESPACE = 'hamster-plugin' @@ -150,8 +152,13 @@ def on_task_modified(self, task_id, path): # Plugin api methods ### def activate(self, plugin_api): self.plugin_api = plugin_api - self.hamster = dbus.SessionBus().get_object('org.gnome.Hamster', - '/org/gnome/Hamster') + + try: + self.hamster = dbus.SessionBus().get_object('org.gnome.Hamster', + '/org/gnome/Hamster') + except dbus.exceptions.DBusException: + log.error('Hamster plugin failed to activate. Is Hamster installed?') + return # add button if plugin_api.is_browser():