[Pkg-owncloud-commits] [owncloud-client] 49/94: Nautilus integration: Work with python2 and python3
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 72363155d86b4b51b1bfbd75c7a4a19fed3f8ee9
Author: Christian Kamm <mail at ckamm.de>
Date: Tue Jan 23 11:47:23 2018 +0100
Nautilus integration: Work with python2 and python3
---
shell_integration/nautilus/syncstate.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/shell_integration/nautilus/syncstate.py b/shell_integration/nautilus/syncstate.py
index 6ea7191..77a233d 100644
--- a/shell_integration/nautilus/syncstate.py
+++ b/shell_integration/nautilus/syncstate.py
@@ -15,9 +15,13 @@
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
+import sys
+python3 = sys.version_info[0] >= 3
+
import os
import urllib
-import urllib.parse
+if python3:
+ import urllib.parse
import socket
import tempfile
@@ -31,11 +35,11 @@ appname = 'ownCloud'
print("Initializing "+appname+"-client-nautilus extension")
-
def get_local_path(url):
if url[0:7] == 'file://':
url = url[7:]
- return urllib.parse.unquote(url)
+ unquote = urllib.parse.unquote if python3 else urllib.unquote
+ return unquote(url)
def get_runtime_dir():
"""Returns the value of $XDG_RUNTIME_DIR, a directory path.
--
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