Adding hack for change in python-telepathy __init__ params
authorEd Page <eopage@byu.net>
Wed, 6 Jan 2010 02:39:39 +0000 (20:39 -0600)
committerEd Page <eopage@byu.net>
Wed, 6 Jan 2010 02:39:39 +0000 (20:39 -0600)
src/channel/call.py
src/channel/contact_list.py
src/channel/text.py

index 52d17ad..19837dc 100644 (file)
@@ -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
index 8c0860e..111ae2a 100644 (file)
@@ -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
index 4166c6e..31aa4e3 100644 (file)
@@ -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)