[Telepathy-commits] [telepathy-python/master] file-transfer.py: pass byte_arrays=True to {Accept, Provide}File

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Tue Mar 17 04:50:25 PDT 2009


The unix socket address is supposed to be an 'ay' and not a 's'
according to the spec. This change make the script works with both so it
can be used with old bugged CM's and new ones.
---
 examples/file-transfer.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/examples/file-transfer.py b/examples/file-transfer.py
index 1c1604a..125fca7 100644
--- a/examples/file-transfer.py
+++ b/examples/file-transfer.py
@@ -111,7 +111,8 @@ class FTReceiverClient(FTClient):
     def got_ft_channel(self):
         print "accept FT"
         self.sock_addr = self.ft_channel[CHANNEL_TYPE_FILE_TRANSFER].AcceptFile(
-            SOCKET_ADDRESS_TYPE_UNIX, SOCKET_ACCESS_CONTROL_LOCALHOST, "", 0)
+            SOCKET_ADDRESS_TYPE_UNIX, SOCKET_ACCESS_CONTROL_LOCALHOST, "", 0,
+            byte_arrays=True)
 
     def ft_state_changed_cb(self, state, reason):
         FTClient.ft_state_changed_cb(self, state, reason)
@@ -183,7 +184,7 @@ class FTSenderClient(FTClient):
     def got_ft_channel(self):
         print "Offer %s to %s" % (self.file_to_offer, self.contact)
         self.sock_addr = self.ft_channel[CHANNEL_TYPE_FILE_TRANSFER].ProvideFile(SOCKET_ADDRESS_TYPE_UNIX,
-            SOCKET_ACCESS_CONTROL_LOCALHOST, "")
+            SOCKET_ACCESS_CONTROL_LOCALHOST, "", byte_arrays=True)
 
     def ft_state_changed_cb(self, state, reason):
         FTClient.ft_state_changed_cb(self, state, reason)
-- 
1.5.6.5




More information about the telepathy-commits mailing list