Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2018-01-18 16:13:40 +0300
committerOlivier Goffart <ogoffart@woboq.com>2018-01-23 14:30:58 +0300
commitf254ee3211d18af79ed5c2fd1fa87c23658c7b6b (patch)
treea6a4218548987d80e6795a2381e20f055c32ff35 /shell_integration
parent497b327d438b04da4c998e0663a98f4a7f5d2054 (diff)
Nautilus shell integration: Port to Python 3
Diffstat (limited to 'shell_integration')
-rw-r--r--shell_integration/nautilus/syncstate.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/shell_integration/nautilus/syncstate.py b/shell_integration/nautilus/syncstate.py
index 082be4e22..6ea719100 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