Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/collaboration
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-02-16 04:20:49 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-02-16 04:20:49 (GMT)
commit3635ae42e9e47208542b3f95ac1bfb79a6707339 (patch)
treeebeb3dc272b53c54b54248e9cbb86b05ba19fd8f /collaboration
parent0510cde0adbf6dca69060fdccec83ee227c57a8f (diff)
catch exception when importing telepathyclient
Diffstat (limited to 'collaboration')
-rw-r--r--collaboration/telepathyclient.py17
1 files changed, 12 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])