def checkSkin(): wiz.log("[Build Check] Invalid Skin Check Start") DEFAULTSKIN = wiz.getS('defaultskin') DEFAULTNAME = wiz.getS('defaultskinname') DEFAULTIGNORE = wiz.getS('defaultskinignore') gotoskin = False if not DEFAULTSKIN == '': if os.path.exists(os.path.join(ADDONS, DEFAULTSKIN)): if DIALOG.yesno(ADDONTITLE, "[COLOR %s]It seems that the skin has been set back to [COLOR %s]%s[/COLOR]" % (COLOR2, COLOR1, SKIN[5:].title()), "Would you like to set the skin back to:[/COLOR]", '[COLOR %s]%s[/COLOR]' % (COLOR1, DEFAULTNAME)): gotoskin = DEFAULTSKIN gotoname = DEFAULTNAME else: wiz.log("Skin was not reset", xbmc.LOGNOTICE); wiz.setS('defaultskinignore', 'true'); gotoskin = False else: wiz.setS('defaultskin', ''); wiz.setS('defaultskinname', ''); DEFAULTSKIN = ''; DEFAULTNAME = '' if DEFAULTSKIN == '': skinname = [] skinlist = [] for folder in glob.glob(os.path.join(ADDONS, 'skin.*/')): xml = "%s/addon.xml" % folder if os.path.exists(xml): f = open(xml,mode='r'); g = f.read().replace('\n','').replace('\r','').replace('\t',''); f.close(); match = wiz.parseDOM(g, 'addon', ret='id') match2 = wiz.parseDOM(g, 'addon', ret='name') wiz.log("%s: %s" % (folder, str(match[0])), xbmc.LOGNOTICE) if len(match) > 0: skinlist.append(str(match[0])); skinname.append(str(match2[0])) else: wiz.log("ID not found for %s" % folder, xbmc.LOGNOTICE) else: wiz.log("ID not found for %s" % folder, xbmc.LOGNOTICE) if len(skinlist) > 0: if len(skinlist) > 1: if DIALOG.yesno(ADDONTITLE, "[COLOR %s]It seems that the skin has been set back to [COLOR %s]%s[/COLOR]" % (COLOR2, COLOR1, SKIN[5:].title()), "Would you like to view a list of avaliable skins?[/COLOR]"): choice = DIALOG.select("Select skin to switch to!", skinname) if choice == -1: wiz.log("Skin was not reset", xbmc.LOGNOTICE); wiz.setS('defaultskinignore', 'true') else: gotoskin = skinlist[choice] gotoname = skinname[choice] else: wiz.log("Skin was not reset", xbmc.LOGNOTICE); wiz.setS('defaultskinignore', 'true') else: if DIALOG.yesno(ADDONTITLE, "[COLOR %s]It seems that the skin has been set back to [COLOR %s]%s[/COLOR]" % (COLOR2, COLOR1, SKIN[5:].title()), "Would you like to set the skin back to:[/COLOR]", '[COLOR %s]%s[/COLOR]' % (COLOR1, skinname[0])): gotoskin = skinlist[0] gotoname = skinname[0] else: wiz.log("Skin was not reset", xbmc.LOGNOTICE); wiz.setS('defaultskinignore', 'true') else: wiz.log("No skins found in addons folder.", xbmc.LOGNOTICE); wiz.setS('defaultskinignore', 'true'); gotoskin = False if gotoskin: skinSwitch.swapSkins(gotoskin) x = 0 xbmc.sleep(1000) while not xbmc.getCondVisibility("Window.isVisible(yesnodialog)") and x < 150: x += 1 xbmc.sleep(200) if xbmc.getCondVisibility("Window.isVisible(yesnodialog)"): wiz.ebi('SendClick(11)') wiz.lookandFeelData('restore') else: wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, ADDONTITLE),'[COLOR %s]Skin Swap Timed Out![/COLOR]' % COLOR2) wiz.log("[Build Check] Invalid Skin Check End", xbmc.LOGNOTICE)
def dependsList(plugin): addonxml = os.path.join(ADDONS, plugin, 'addon.xml') if os.path.exists(addonxml): source = open(addonxml, mode='r') link = source.read() source.close() match = wiz.parseDOM(link, 'import', ret='addon') items = [] for depends in match: if not 'xbmc.python' in depends: items.append(depends) return items return []
icon) except Exception, e: wiz.log( "[Debrid Info] Unable to Restore %s (%s)" % (who, str(e)), xbmc.LOGERROR) #else: wiz.LogNotify(name,'Real Debrid Info: [COLOR red]Not Found![/COLOR]', 2000, icon) elif do == 'clearaddon': wiz.log('%s SETTINGS: %s' % (name, settings), xbmc.LOGDEBUG) if os.path.exists(settings): try: f = open(settings, "r") lines = f.readlines() f.close() f = open(settings, "w") for line in lines: match = wiz.parseDOM(line, 'setting', ret='id') if len(match) == 0: f.write(line) else: if match[0] not in data: f.write(line) else: wiz.log('Removing Line: %s' % line, xbmc.LOGNOTICE) f.close() wiz.LogNotify( "[COLOR %s]%s[/COLOR]" % (COLOR1, name), '[COLOR %s]Addon Data: Cleared![/COLOR]' % COLOR2, 2000, icon) except Exception, e: wiz.log( "[Debrid Info] Unable to Clear Addon %s (%s)" % (who, str(e)), xbmc.LOGERROR) wiz.refresh()
wiz.copytree(ADDONPATH, newpath) except Exception, e: pass wiz.forceUpdate(True) try: mybuilds = xbmc.translatePath(MYBUILDS) if not os.path.exists(mybuilds): xbmcvfs.mkdirs(mybuilds) except: pass wiz.log("[Auto Install Repo] Started", xbmc.LOGNOTICE) if AUTOINSTALL == 'Yes' and not os.path.exists(os.path.join(ADDONS, REPOID)): workingxml = wiz.workingURL(REPOADDONXML) if workingxml == True: ver = wiz.parseDOM(wiz.openURL(REPOADDONXML), 'addon', ret='version', attrs = {'id': REPOID}) if len(ver) > 0: installzip = '%s-%s.zip' % (REPOID, ver[0]) workingrepo = wiz.workingURL(REPOZIPURL+installzip) if workingrepo == True: DP.create(ADDONTITLE,'Downloading Repo...','', 'Please Wait') if not os.path.exists(PACKAGES): os.makedirs(PACKAGES) lib=os.path.join(PACKAGES, installzip) try: os.remove(lib) except: pass downloader.download(REPOZIPURL+installzip,lib, DP) extract.all(lib, ADDONS, DP) try: f = open(os.path.join(ADDONS, REPOID, 'addon.xml'), mode='r'); g = f.read(); f.close() name = wiz.parseDOM(g, 'addon', ret='name', attrs = {'id': REPOID}) wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name[0]), "[COLOR %s]Add-on updated[/COLOR]" % COLOR2, icon=os.path.join(ADDONS, REPOID, 'icon.png'))
for trakt, value in match: addonid.setSetting(trakt, value) user = addonid.getSetting(default) wiz.setS(saved, user) wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name), '[COLOR %s]Trakt: Restored![/COLOR]' % COLOR2, 2000, icon) except Exception, e: wiz.log("[Trakt Data] Unable to Restore %s (%s)" % (who, str(e)), xbmc.LOGERROR) #else: wiz.LogNotify(name,'Trakt Data: [COLOR red]Not Found![/COLOR]', 2000, icon) elif do == 'clearaddon': wiz.log('%s SETTINGS: %s' % (name, settings), xbmc.LOGDEBUG) if os.path.exists(settings): try: f = open(settings, "r"); lines = f.readlines(); f.close() f = open(settings, "w") for line in lines: match = wiz.parseDOM(line, 'setting', ret='id') if len(match) == 0: f.write(line) else: if match[0] not in data: f.write(line) else: wiz.log('Removing Line: %s' % line, xbmc.LOGNOTICE) f.close() wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name),'[COLOR %s]Addon Data: Cleared![/COLOR]' % COLOR2, 2000, icon) except Exception, e: wiz.log("[Trakt Data] Unable to Clear Addon %s (%s)" % (who, str(e)), xbmc.LOGERROR) wiz.refresh() def autoUpdate(who): if who == 'all': for log in TRAKTID: if os.path.exists(TRAKTID[log]['path']): autoUpdate(log)
if not os.path.exists(ADVANCED): writeAdvanced() try: mybuilds = xbmc.translatePath(MYBUILDS) if not os.path.exists(mybuilds): xbmcvfs.mkdirs(mybuilds) except: pass wiz.log("Flushing Aged Cached Text Files") wiz.flushOldCache() wiz.log("[Auto Install Repo] Started", xbmc.LOGNOTICE) if AUTOINSTALL == 'Yes' and not os.path.exists(os.path.join(ADDONS, REPOID)): workingxml = wiz.workingURL(REPOADDONXML) if workingxml == True: ver = wiz.parseDOM(wiz.openURL(REPOADDONXML), 'addon', ret='version', attrs = {'id': REPOID}) if len(ver) > 0: installzip = '%s-%s.zip' % (REPOID, ver[0]) workingrepo = wiz.workingURL(REPOZIPURL+installzip) if workingrepo == True: DP.create(ADDONTITLE,'Downloading Repo...','', 'Please Wait') if not os.path.exists(PACKAGES): os.makedirs(PACKAGES) lib=os.path.join(PACKAGES, installzip) try: os.remove(lib) except: pass downloader.download(REPOZIPURL+installzip,lib, DP) extract.all(lib, ADDONS, DP) try: f = open(os.path.join(ADDONS, REPOID, 'addon.xml'), mode='r'); g = f.read(); f.close() name = wiz.parseDOM(g, 'addon', ret='name', attrs = {'id': REPOID}) wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name[0]), "[COLOR %s]Add-on updated[/COLOR]" % COLOR2, icon=os.path.join(ADDONS, REPOID, 'icon.png'))
def checkSkin(): wiz.log("[Wizard] Skin no localizado") DEFAULTSKIN = wiz.getS('defaultskin') DEFAULTNAME = wiz.getS('defaultskinname') DEFAULTIGNORE = wiz.getS('defaultskinignore') gotoskin = False if not DEFAULTSKIN == '': if os.path.exists(os.path.join(ADDONS, DEFAULTSKIN)): if DIALOG.yesno( ADDONTITLE, "[COLOR %s]Parece que el skin se ha establecido de nuevo a [COLOR %s]%s[/COLOR]" % (COLOR2, COLOR1, SKIN[5:].title()), "Le gustaria volver a configurar el skin:[/COLOR]", '[COLOR %s]%s[/COLOR]' % (COLOR1, DEFAULTNAME)): gotoskin = DEFAULTSKIN gotoname = DEFAULTNAME else: wiz.log("El skin no se reinicio", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') gotoskin = False else: wiz.setS('defaultskin', '') wiz.setS('defaultskinname', '') DEFAULTSKIN = '' DEFAULTNAME = '' if DEFAULTSKIN == '': skinname = [] skinlist = [] for folder in glob.glob(os.path.join(ADDONS, 'skin.*/')): xml = "%s/addon.xml" % folder if os.path.exists(xml): f = open(xml, mode='r') g = f.read().replace('\n', '').replace('\r', '').replace('\t', '') f.close() match = wiz.parseDOM(g, 'addon', ret='id') match2 = wiz.parseDOM(g, 'addon', ret='name') wiz.log("%s: %s" % (folder, str(match[0])), xbmc.LOGNOTICE) if len(match) > 0: skinlist.append(str(match[0])) skinname.append(str(match2[0])) else: wiz.log("ID not found for %s" % folder, xbmc.LOGNOTICE) else: wiz.log("ID not found for %s" % folder, xbmc.LOGNOTICE) if len(skinlist) > 0: if len(skinlist) > 1: if DIALOG.yesno( ADDONTITLE, "[COLOR %s]Parece que el skin se ha establecido de nuevo a [COLOR %s]%s[/COLOR]" % (COLOR2, COLOR1, SKIN[5:].title()), "Le gustaria ver una lista de los skin disponibles?[/COLOR]" ): choice = DIALOG.select("Seleccione el skin para cambiar", skinname) if choice == -1: wiz.log("El skin no se reinicio", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') else: gotoskin = skinlist[choice] gotoname = skinname[choice] else: wiz.log("El skin no se reinicio", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') else: if DIALOG.yesno( ADDONTITLE, "[COLOR %s]Parece que el skin se ha establecido de nuevo a [COLOR %s]%s[/COLOR]" % (COLOR2, COLOR1, SKIN[5:].title()), "Le gustaria volver a configurar el skin:[/COLOR]", '[COLOR %s]%s[/COLOR]' % (COLOR1, skinname[0])): gotoskin = skinlist[0] gotoname = skinname[0] else: wiz.log("El skin no se reinicio", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') else: wiz.log("No se encontraron skins en la carpeta de complementos.", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') gotoskin = False if gotoskin: skinSwitch.swapSkins(gotoskin) x = 0 xbmc.sleep(1000) while not xbmc.getCondVisibility( "Window.isVisible(yesnodialog)") and x < 150: x += 1 xbmc.sleep(200) if xbmc.getCondVisibility("Window.isVisible(yesnodialog)"): wiz.ebi('SendClick(11)') wiz.lookandFeelData('restore') else: wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, ADDONTITLE), '[COLOR %s]Tiempo agotato[/COLOR]' % COLOR2) wiz.log("[Build Check] Skin Error", xbmc.LOGNOTICE)
def checkSkin(): wiz.log("[Build Check] Invalid Skin Check Start") DEFAULTSKIN = wiz.getS('defaultskin') DEFAULTNAME = wiz.getS('defaultskinname') DEFAULTIGNORE = wiz.getS('defaultskinignore') gotoskin = False if not DEFAULTSKIN == '': if os.path.exists(os.path.join(ADDONS, DEFAULTSKIN)): if DIALOG.yesno( ADDONTITLE, "[COLOR %s]Es scheint der Skin wurde zuruck gesetzt auf [COLOR %s]%s[/COLOR]" % (COLOR2, COLOR1, SKIN[5:].title()), "Willst du den Skin zuruck setzten auf:[/COLOR]", '[COLOR %s]%s[/COLOR]' % (COLOR1, DEFAULTNAME)): gotoskin = DEFAULTSKIN gotoname = DEFAULTNAME else: wiz.log("Skin was not reset", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') gotoskin = False else: wiz.setS('defaultskin', '') wiz.setS('defaultskinname', '') DEFAULTSKIN = '' DEFAULTNAME = '' if DEFAULTSKIN == '': skinname = [] skinlist = [] for folder in glob.glob(os.path.join(ADDONS, 'skin.*/')): xml = "%s/addon.xml" % folder if os.path.exists(xml): f = open(xml, mode='r') g = f.read().replace('\n', '').replace('\r', '').replace('\t', '') f.close() match = wiz.parseDOM(g, 'addon', ret='id') match2 = wiz.parseDOM(g, 'addon', ret='name') wiz.log("%s: %s" % (folder, str(match[0])), xbmc.LOGNOTICE) if len(match) > 0: skinlist.append(str(match[0])) skinname.append(str(match2[0])) else: wiz.log("ID not found for %s" % folder, xbmc.LOGNOTICE) else: wiz.log("ID not found for %s" % folder, xbmc.LOGNOTICE) if len(skinlist) > 0: if len(skinlist) > 1: if DIALOG.yesno( ADDONTITLE, "[COLOR %s]Es scheint der Skin wurde zuruck gesetzt auf [COLOR %s]%s[/COLOR]" % (COLOR2, COLOR1, SKIN[5:].title()), "Willst du eine Liste aller Skins sehen?[/COLOR]"): choice = DIALOG.select("Wahle Skin aus!", skinname) if choice == -1: wiz.log("Skin was not reset", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') else: gotoskin = skinlist[choice] gotoname = skinname[choice] else: wiz.log("Skin was not reset", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') else: if DIALOG.yesno( ADDONTITLE, "[COLOR %s]Es scheint der Skin wurde zuruck gesetzt auf [COLOR %s]%s[/COLOR]" % (COLOR2, COLOR1, SKIN[5:].title()), "Willst du den Skin zuruck setzten auf:[/COLOR]", '[COLOR %s]%s[/COLOR]' % (COLOR1, skinname[0])): gotoskin = skinlist[0] gotoname = skinname[0] else: wiz.log("Skin was not reset", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') else: wiz.log("No skins found in addons folder.", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') gotoskin = False if gotoskin: skinSwitch.swapSkins(gotoskin) x = 0 xbmc.sleep(1000) while not xbmc.getCondVisibility( "Window.isVisible(yesnodialog)") and x < 150: x += 1 xbmc.sleep(200) if xbmc.getCondVisibility("Window.isVisible(yesnodialog)"): wiz.ebi('SendClick(11)') wiz.lookandFeelData('restore') else: wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, ADDONTITLE), '[COLOR %s]Skin Wechsel Timed Out![/COLOR]' % COLOR2) wiz.log("[Build Check] Invalid Skin Check End", xbmc.LOGNOTICE)