From 2d6e3e256844637d566644e7b481dfdaad62c26d Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 5 Jan 2010 20:39:39 -0600 Subject: [PATCH] Adding hack for change in python-telepathy __init__ params --- src/channel/call.py | 7 ++++++- src/channel/contact_list.py | 7 ++++++- src/channel/text.py | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/channel/call.py b/src/channel/call.py index 52d17ad..19837dc 100644 --- a/src/channel/call.py +++ b/src/channel/call.py @@ -19,7 +19,12 @@ class CallChannel( self._manager = manager self._props = props - telepathy.server.ChannelTypeStreamedMedia.__init__(self, connection, None) + try: + # Older python-telepathy way + telepathy.server.ChannelTypeStreamedMedia.__init__(self, connection, None) + except TypeError: + # Newer python-telepathy way + telepathy.server.ChannelTypeStreamedMedia.__init__(self, connection, manager, props) telepathy.server.ChannelInterfaceCallState.__init__(self) telepathy.server.ChannelInterfaceGroup.__init__(self) self._contactHandle = contactHandle diff --git a/src/channel/contact_list.py b/src/channel/contact_list.py index 8c0860e..111ae2a 100644 --- a/src/channel/contact_list.py +++ b/src/channel/contact_list.py @@ -21,7 +21,12 @@ class AbstractListChannel( self._manager = manager self._props = props - telepathy.server.ChannelTypeContactList.__init__(self, connection, h) + try: + # Older python-telepathy way + telepathy.server.ChannelTypeContactList.__init__(self, connection, h) + except TypeError: + # Newer python-telepathy way + telepathy.server.ChannelTypeContactList.__init__(self, connection, manager, props) telepathy.server.ChannelInterfaceGroup.__init__(self) self._session = connection.session diff --git a/src/channel/text.py b/src/channel/text.py index 4166c6e..31aa4e3 100644 --- a/src/channel/text.py +++ b/src/channel/text.py @@ -21,7 +21,12 @@ class TextChannel(telepathy.server.ChannelTypeText): self._manager = manager self._props = props - telepathy.server.ChannelTypeText.__init__(self, connection, contactHandle) + try: + # Older python-telepathy way + telepathy.server.ChannelTypeText.__init__(self, connection, contactHandle) + except TypeError: + # Newer python-telepathy way + telepathy.server.ChannelTypeText.__init__(self, connection, manager, props) self._nextRecievedId = 0 self._lastMessageTimestamp = datetime.datetime(1, 1, 1) -- 1.7.9.5