Enable "file:///" URI paths for addons location
This commit is contained in:
@ -215,12 +215,12 @@ def available_updates():
|
|||||||
LOG.warning("Failed to open addon metadata for {lang} {url}: {err}".
|
LOG.warning("Failed to open addon metadata for {lang} {url}: {err}".
|
||||||
format(lang=lang, url=URL, err=err))
|
format(lang=lang, url=URL, err=err))
|
||||||
fp = None
|
fp = None
|
||||||
if fp and fp.getcode() == 200: # ok
|
if fp and (fp.getcode() == 200 or fp.file):
|
||||||
break
|
break
|
||||||
|
|
||||||
pmgr = BasePluginManager.get_instance()
|
pmgr = BasePluginManager.get_instance()
|
||||||
addon_update_list = []
|
addon_update_list = []
|
||||||
if fp and fp.getcode() == 200:
|
if fp and (fp.getcode() == 200 or fp.file):
|
||||||
lines = list(fp.readlines())
|
lines = list(fp.readlines())
|
||||||
count = 0
|
count = 0
|
||||||
for line in lines:
|
for line in lines:
|
||||||
@ -282,7 +282,8 @@ def load_addon_file(path, callback=None):
|
|||||||
import tarfile
|
import tarfile
|
||||||
if (path.startswith("http://") or
|
if (path.startswith("http://") or
|
||||||
path.startswith("https://") or
|
path.startswith("https://") or
|
||||||
path.startswith("ftp://")):
|
path.startswith("ftp://") or
|
||||||
|
path.startswith("file://")):
|
||||||
try:
|
try:
|
||||||
fp = urlopen_maybe_no_check_cert(path)
|
fp = urlopen_maybe_no_check_cert(path)
|
||||||
except:
|
except:
|
||||||
@ -291,7 +292,7 @@ def load_addon_file(path, callback=None):
|
|||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
fp = open(path)
|
fp = open(path, 'rb')
|
||||||
except:
|
except:
|
||||||
if callback:
|
if callback:
|
||||||
callback(_("Unable to open '%s'") % path)
|
callback(_("Unable to open '%s'") % path)
|
||||||
|
Reference in New Issue
Block a user