Skip to content

Commit

Permalink
empathy: Properly check exception if Empathy is not installed/available
Browse files Browse the repository at this point in the history
  • Loading branch information
bluss committed Jul 3, 2012
1 parent 9d48a13 commit 160466b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions kupfer/plugin/empathy.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from kupfer import icons
from kupfer import plugin_support
from kupfer import pretty
from kupfer.objects import Leaf, Action, Source, AppLeaf
from kupfer.weaklib import dbus_signal_connect_weakly
from kupfer.obj.helplib import PicklingHelperMixin
Expand Down Expand Up @@ -67,10 +68,13 @@
EMPATHY_CONTACT_ID = "EMPATHY_CONTACT_ID"

def _create_dbus_connection():
sbus = dbus.SessionBus()
proxy_obj = sbus.get_object(ACCOUNTMANAGER_IFACE, ACCOUNTMANAGER_PATH)
dbus_iface = dbus.Interface(proxy_obj, DBUS_PROPS_IFACE)
return dbus_iface
try:
sbus = dbus.SessionBus()
proxy_obj = sbus.get_object(ACCOUNTMANAGER_IFACE, ACCOUNTMANAGER_PATH)
dbus_iface = dbus.Interface(proxy_obj, DBUS_PROPS_IFACE)
return dbus_iface
except dbus.DBusException as exc:
pretty.print_exc(__name__)


class EmpathyContact(JabberContact):
Expand Down

0 comments on commit 160466b

Please sign in to comment.