mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-14 00:39:33 -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 json
|
||||||
import locale
|
import locale
|
||||||
import subprocess
|
import subprocess
|
||||||
import urllib
|
try:
|
||||||
|
import urllib.request
|
||||||
|
except:
|
||||||
|
import urllib
|
||||||
import gi
|
import gi
|
||||||
|
|
||||||
gi.require_version("Nautilus", "3.0")
|
gi.require_version("Nautilus", "3.0")
|
||||||
@ -67,6 +70,9 @@ class OnionShareExtension(GObject.GObject, Nautilus.MenuProvider):
|
|||||||
def url2path(self, url):
|
def url2path(self, url):
|
||||||
file_uri = url.get_activation_uri()
|
file_uri = url.get_activation_uri()
|
||||||
arg_uri = file_uri[7:]
|
arg_uri = file_uri[7:]
|
||||||
|
try:
|
||||||
|
path = urllib.request.url2pathname(arg_uri)
|
||||||
|
except:
|
||||||
path = urllib.url2pathname(arg_uri)
|
path = urllib.url2pathname(arg_uri)
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user