://home/userdata/addon_data/plugin.programを.super.favourites/Super Favorites/Maintenance/packages/packages.zip ') userdatapackagezip = xbmc.translatePath('特別://home/userdata/addon_data/plugin.program.super.favourites/Superお気に入り/メンテナンス/パッケージ/ (special:// home/userdata/addon_data/') package_ext_loc = xbmc.translatePath addondata_ext_loc = xbmc.translatePath yespackage = os.path。存在する(packagezip) yesaddondata = os.path.exists(userdatapackagezip)
if yespackage:
xbmc.executebuiltin("Notification(New Packages available, Extracting,()")
pz = open(packagezip, 'rb')
packz = zipfile.ZipFile(pz)
for name in packz.namelist():
addonpath = xbmc.translatePath('special://home/addons/' + name)
addonpathexists = os.path.exists(addonpath)
if addonpathexists:
xbmc.executebuiltin("Notification(Previous version exists, removing,()")
shutil.rmtree(addonpath, ignore_errors=False)
xbmc.executebuiltin("Notification(Please wait, preparing extraction,()")
time.sleep(3)
packz.extract(name, package_ext_loc)
xbmc.executebuiltin("Notification(Extracted, REBOOT REQUIRED,()")
else:
xbmc.executebuiltin("Notification(No previous version, Extracting,()")
packz.extract(name, package_ext_loc)
xbmc.executebuiltin("Notification(Extracted, REBOOT REQUIRED,()")
pz.close()
xbmc.executebuiltin("Notification(Packages Extracted, checking addondata,()")
if yesaddondata:
xbmc.executebuiltin("Notification(Extracting addondata, Please wait!,()")
adz = open(userdatapackagezip, 'rb')
paddz = zipfile.ZipFile(adz)
for name in paddz.namelist():
addondatapath = xbmc.translatePath('special://home/userdata/addon_data/' + name)
addondataexists = os.path.exists(addondatapath)
if addondataexists:
xbmc.executebuiltin("Notification(Previous data folder esists, now removing,()")
shutil.rmtree(addondatapath, ignore_errors=False)
xbmc.executebuiltin("Notification(Please wait, preparing extraction,()")
time.sleep(3)
paddz.extract(name, addondata_ext_loc)
xbmc.executebuiltin("Notification(Extracted, maybe needs Reeboot,()")
else:
xbmc.executebuiltin("Notification(No previous version, Extracting,()")
paddz.extract(name, addondata_ext_loc)
adz.close()
else:
xbmc.executebuiltin("Notification(No addondata, at this time,()")
else:
xbmc.executebuiltin("Notification(No packages, at this time,()")
xbmc.executebuiltin("Notification(Checking addondata, for extraction,()")
if yesaddondata:
xbmc.executebuiltin("Notification(Extracting addondata, Please wait!,()")
adz = open(userdatapackagezip, 'rb')
paddz = zipfile.ZipFile(adz)
for name in paddz.namelist():
addondatapath = xbmc.translatePath('special://home/userdata/addon_data/' + name)
addondataexists = os.path.exists(addondatapath)
if addondataexists:
xbmc.executebuiltin("Notification(Previous data folder esists, now removing,()")
shutil.rmtree(addondatapath, ignore_errors=False)
xbmc.executebuiltin("Notification(Please wait, preparing extraction,()")
time.sleep(3)
paddz.extract(name, addondata_ext_loc)
xbmc.executebuiltin("Notification(Extracted, maybe needs Reeboot,()")
else:
xbmc.executebuiltin("Notification(No previous version, Extracting,()")
paddz.extract(name, addondata_ext_loc)
adz.close()
else:
xbmc.executebuiltin("Notification(No addondata, at this time,()")
私は、ZIPファイルがこのkodeがKODIメンテナンスアドオン
です自動的 を上書きするかどうかわから波平