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

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2018-04-25 14:22:34 +0300
committerOlivier Goffart <olivier@woboq.com>2018-04-25 14:58:45 +0300
commit1ab3a9fc130bc028ff3246cb617a2cd893238b49 (patch)
treee921f6c411311487accdf97a66cbec6c013ed81d /shell_integration
parent9d4ece4b3afff7c08fa5e55ee99cfcf609b11784 (diff)
Nautilus: Fix Python3 and remove many debug
Use b'\n' in the call to rfind, as the _remainder is bytes, not a string. Remove most of the debug message which happens during normal operation. They are mostly spamming the nautilus console, and can also cause bug as they may throw exception in case of wrong encoding. Relates to issue: #6406
Diffstat (limited to 'shell_integration')
-rw-r--r--shell_integration/nautilus/syncstate.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/shell_integration/nautilus/syncstate.py b/shell_integration/nautilus/syncstate.py
index 64c76d55b..b47987afd 100644
--- a/shell_integration/nautilus/syncstate.py
+++ b/shell_integration/nautilus/syncstate.py
@@ -99,19 +99,16 @@ class SocketConnect(GObject.GObject):
self._sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock_file = os.path.join(get_runtime_dir(), appname, "socket")
try:
- print("Socket File: " + sock_file)
self._sock.connect(sock_file) # fails if sock_file doesn't exist
self.connected = True
- print("Setting connected to %r." % self.connected )
self._watch_id = GObject.io_add_watch(self._sock, GObject.IO_IN, self._handle_notify)
- print("Socket watch id: " + str(self._watch_id))
self.sendCommand('VERSION:\n')
self.sendCommand('GET_STRINGS:\n')
return False # Don't run again
except Exception as e:
- print("Could not connect to unix socket. " + str(e))
+ print("Could not connect to unix socket " + sock_file + ". " + str(e))
except Exception as e: # Bad habbit
print("Connect could not be established, try again later.")
self._sock.close()
@@ -134,7 +131,7 @@ class SocketConnect(GObject.GObject):
# Parses response lines out of collected data, returns list of strings
def get_available_responses(self):
- end = self._remainder.rfind('\n')
+ end = self._remainder.rfind(b'\n')
if end == -1:
return []
data = self._remainder[:end]
@@ -155,7 +152,7 @@ class SocketConnect(GObject.GObject):
return True # Run again
def handle_server_response(self, line):
- print("Server response: " + line)
+ # print("Server response: " + line)
parts = line.split(':')
action = parts[0]
args = parts[1:]
@@ -345,7 +342,7 @@ class MenuExtension(GObject.GObject, Nautilus.MenuProvider):
def context_menu_action(self, menu, action, filename):
- print("Context menu: " + action + ' ' + filename)
+ # print("Context menu: " + action + ' ' + filename)
socketConnect.sendCommand(action + ":" + filename + "\n")