[Pkg-owncloud-commits] [owncloud-client] 48/94: Nautilus shell integration: Port to Python 3

Sandro Knauß hefee at debian.org
Thu Mar 29 11:12:13 UTC 2018


This is an automated email from the git hooks/post-receive script.

hefee pushed a commit to branch upstream
in repository owncloud-client.

commit f254ee3211d18af79ed5c2fd1fa87c23658c7b6b
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Thu Jan 18 14:13:40 2018 +0100

    Nautilus shell integration: Port to Python 3
---
 shell_integration/nautilus/syncstate.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/shell_integration/nautilus/syncstate.py b/shell_integration/nautilus/syncstate.py
index 082be4e..6ea7191 100644
--- a/shell_integration/nautilus/syncstate.py
+++ b/shell_integration/nautilus/syncstate.py
@@ -17,6 +17,7 @@
 
 import os
 import urllib
+import urllib.parse
 import socket
 import tempfile
 
@@ -34,7 +35,7 @@ print("Initializing "+appname+"-client-nautilus extension")
 def get_local_path(url):
     if url[0:7] == 'file://':
         url = url[7:]
-    return urllib.unquote(url)
+    return urllib.parse.unquote(url)
 
 def get_runtime_dir():
     """Returns the value of $XDG_RUNTIME_DIR, a directory path.
@@ -56,7 +57,7 @@ class SocketConnect(GObject.GObject):
         self._watch_id = 0
         self._sock = None
         self._listeners = [self._update_registered_paths]
-        self._remainder = ''
+        self._remainder = ''.encode()
         self.nautilusVFSFile_table = {}  # not needed in this object actually but shared 
                                          # all over the other objects.
 
@@ -74,7 +75,7 @@ class SocketConnect(GObject.GObject):
         # print("Server command: " + cmd)
         if self.connected:
             try:
-                self._sock.send(cmd)
+                self._sock.send(cmd.encode())
             except:
                 print("Sending failed.")
                 self.reconnect()
@@ -113,17 +114,17 @@ class SocketConnect(GObject.GObject):
         # Prepend the remaining data from last call
         if len(self._remainder) > 0:
             data = self._remainder + data
-            self._remainder = ''
+            self._remainder = ''.encode()
 
         if len(data) > 0:
             # Remember the remainder for next round
-            lastNL = data.rfind('\n');
+            lastNL = data.rfind('\n'.encode());
             if lastNL > -1 and lastNL < len(data):
                 self._remainder = data[lastNL+1:]
                 data = data[:lastNL]
 
-            for l in data.split('\n'):
-                self._handle_server_response(l)
+            for l in data.split('\n'.encode()):
+                self._handle_server_response(l.decode())
         else:
             return False
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list