Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--collaboration/telepathyclient.py17
-rw-r--r--extra/collaborationplugin.py2
2 files changed, 14 insertions, 5 deletions
diff --git a/collaboration/telepathyclient.py b/collaboration/telepathyclient.py
index 5491530..f3e8578 100644
--- a/collaboration/telepathyclient.py
+++ b/collaboration/telepathyclient.py
@@ -18,11 +18,15 @@ import logging
import dbus
from dbus import PROPERTIES_IFACE
-from telepathy.interfaces import CLIENT, \
- CLIENT_APPROVER, \
- CLIENT_HANDLER, \
- CLIENT_INTERFACE_REQUESTS
-from telepathy.server import DBusProperties
+try:
+ from telepathy.interfaces import CLIENT, \
+ CLIENT_APPROVER, \
+ CLIENT_HANDLER, \
+ CLIENT_INTERFACE_REQUESTS
+ from telepathy.server import DBusProperties
+ TELEPATHY_AVAILABLE = True
+except ImportError:
+ TELEPATHY_AVAILABLE = False
import dispatch
@@ -34,7 +38,10 @@ _instance = None
class TelepathyClient(dbus.service.Object, DBusProperties):
+
def __init__(self):
+ if not TELEPATHY_AVAILABLE:
+ return None
self._interfaces = set([CLIENT, CLIENT_HANDLER,
CLIENT_INTERFACE_REQUESTS, PROPERTIES_IFACE,
CLIENT_APPROVER])
diff --git a/extra/collaborationplugin.py b/extra/collaborationplugin.py
index a910991..b07d892 100644
--- a/extra/collaborationplugin.py
+++ b/extra/collaborationplugin.py
@@ -169,6 +169,8 @@ class CollaborationPlugin(Plugin):
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
self._client_handler = telepathyclient.get_instance()
+ if self._client_handler == None:
+ raise RuntimeError('Telepathy client unavailable')
self._neighborhood = get_neighborhood(params)
self._neighborhood.connect('activity-added', self._activity_added_cb)
self._neighborhood.connect('activity-removed',