summaryrefslogtreecommitdiff
path: root/sunshine/capabilities.py
diff options
context:
space:
mode:
authorKrzysztof Klinikowski <kkszysiu@gmail.com>2011-04-13 21:35:40 +0200
committerKrzysztof Klinikowski <kkszysiu@gmail.com>2011-04-13 21:35:40 +0200
commit06828a8ac10eda02712c3042ac3b27002810c170 (patch)
tree33de70e371e222b7a7331aecfdbbe72c3924222a /sunshine/capabilities.py
parentf0cba645f6a1f9981b5c9a5909b5cbf1c0117f8a (diff)
Update to have backward compatibility with older telepathy-python versions.
Diffstat (limited to 'sunshine/capabilities.py')
-rw-r--r--sunshine/capabilities.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/sunshine/capabilities.py b/sunshine/capabilities.py
index 6fc0f82..a0512cb 100644
--- a/sunshine/capabilities.py
+++ b/sunshine/capabilities.py
@@ -22,8 +22,11 @@ import dbus
import telepathy
-#from telepathy._generated.Connection_Interface_Contact_Capabilities \
-# import ConnectionInterfaceContactCapabilities
+try:
+ from telepathy.server import ConnectionInterfaceContactCapabilities
+except:
+from telepathy._generated.Connection_Interface_Contact_Capabilities \
+ import ConnectionInterfaceContactCapabilities
from sunshine.util.decorator import async
from sunshine.handle import SunshineHandleFactory
@@ -33,7 +36,7 @@ __all__ = ['SunshineCapabilities']
logger = logging.getLogger('Sunshine.Capabilities')
class SunshineCapabilities(telepathy.server.ConnectionInterfaceCapabilities,
- telepathy.server.ConnectionInterfaceContactCapabilities):
+ ConnectionInterfaceContactCapabilities):
text_chat_class = \
({telepathy.CHANNEL_INTERFACE + '.ChannelType':
@@ -64,7 +67,7 @@ class SunshineCapabilities(telepathy.server.ConnectionInterfaceCapabilities,
def __init__(self):
telepathy.server.ConnectionInterfaceCapabilities.__init__(self)
- telepathy.server.ConnectionInterfaceContactCapabilities.__init__(self)
+ ConnectionInterfaceContactCapabilities.__init__(self)
# handle -> list(RCC)
#self._contact_caps = {}