mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-26 15:59:48 -05:00
Make nautilus plugin work in python3
This commit is contained in:
parent
58bc258507
commit
7e06872a39
@ -3,7 +3,10 @@ import sys
|
||||
import json
|
||||
import locale
|
||||
import subprocess
|
||||
import urllib
|
||||
try:
|
||||
import urllib.request
|
||||
except:
|
||||
import urllib
|
||||
import gi
|
||||
|
||||
gi.require_version("Nautilus", "3.0")
|
||||
@ -67,6 +70,9 @@ class OnionShareExtension(GObject.GObject, Nautilus.MenuProvider):
|
||||
def url2path(self, url):
|
||||
file_uri = url.get_activation_uri()
|
||||
arg_uri = file_uri[7:]
|
||||
try:
|
||||
path = urllib.request.url2pathname(arg_uri)
|
||||
except:
|
||||
path = urllib.url2pathname(arg_uri)
|
||||
return path
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user