From 3635ae42e9e47208542b3f95ac1bfb79a6707339 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Wed, 16 Feb 2011 04:20:49 +0000 Subject: catch exception when importing telepathyclient --- (limited to 'collaboration/telepathyclient.py') 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]) -- cgit v0.9.1