[kupfer] empathy: Properly check exception if Empathy is not installed/available
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [kupfer] empathy: Properly check exception if Empathy is not installed/available
- Date: Tue, 3 Jul 2012 21:24:30 +0000 (UTC)
commit 160466be3239f9b2880011710c91c7368905601d
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Tue Jul 3 23:23:33 2012 +0200
empathy: Properly check exception if Empathy is not installed/available
kupfer/plugin/empathy.py | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/kupfer/plugin/empathy.py b/kupfer/plugin/empathy.py
index cb5dd19..873b9e4 100644
--- a/kupfer/plugin/empathy.py
+++ b/kupfer/plugin/empathy.py
@@ -12,6 +12,7 @@ import time
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
@@ -67,10 +68,13 @@ EMPATHY_ACCOUNT_KEY = "EMPATHY_ACCOUNT"
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):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]