Fix Installazione Elementum

This commit is contained in:
Alhaziel01
2020-11-07 18:10:59 +01:00
parent da471c5f6e
commit d90062f6d3
2 changed files with 12 additions and 2 deletions

View File

@@ -18,6 +18,9 @@ def download(item=None):
if filetools.exists(elementum_path):
if platformtools.dialog_yesno(config.get_localized_string(70784), config.get_localized_string(70783)):
addon_file = filetools.file_open(filetools.join(elementum_path,'addon.xml')).read()
required = support.match(addon_file, patron=r'addon="([^"]+)').matches
for r in required: xbmc.executebuiltin('InstallAddon(' + r + ')', wait=True)
setting()
platformtools.dialog_ok('Elementum', config.get_localized_string(70783))
@@ -32,6 +35,9 @@ def download(item=None):
downloadtools.downloadfile(host + url, filename)
extract()
xbmc.sleep(1000)
addon_file = filetools.file_open(filetools.join(elementum_path,'addon.xml')).read()
required = support.match(addon_file, patron=r'addon="([^"]+)').matches
for r in required: xbmc.executebuiltin('InstallAddon(' + r + ')', wait=True)
setting()
@@ -40,8 +46,8 @@ def extract():
from platformcode.updater import fixZipGetHash
support.info('Estraggo Elementum in:', elementum_path)
try:
hash = fixZipGetHash(filename)
support.info(hash)
# hash = fixZipGetHash(filename)
# support.info(hash)
with zipfile.ZipFile(filetools.file_open(filename, 'rb', vfs=False)) as zip_ref:
zip_ref.extractall(xbmc.translatePath(addon_path))

View File

@@ -129,6 +129,10 @@ def run(item=None):
from platformcode import backup
return getattr(backup, item.action)(item)
elif item.channel == "elementum_download":
from platformcode import elementum_download
return getattr(elementum_download, item.action)(item)
elif item.channel == "shortcuts":
from platformcode import shortcuts
return getattr(shortcuts, item.action)(item)