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: if wiz.swapSkins(gotoskin): wiz.lookandFeelData('restore') wiz.log("[Build Check] Invalid Skin Check End", xbmc.LOGNOTICE)
yeslabel='[B]Retry Install[/B]') wiz.clearS('build') FAILED = True if yes: wiz.ebi("PlayMedia(plugin://%s/?mode=install&name=%s&url=fresh)" % (ADDON_ID, urllib.quote_plus(BUILDNAME))) wiz.log("[Installed Check] Fresh Install Re-activated", xbmc.LOGNOTICE) else: wiz.log("[Installed Check] Reinstall Ignored") elif SKIN in ['skin.confluence', 'skin.estuary']: wiz.log("[Installed Check] Incorrect skin: %s" % SKIN, xbmc.LOGNOTICE) defaults = wiz.getS('defaultskin') if not defaults == '': if os.path.exists(os.path.join(ADDONS, defaults)): if wiz.swapSkins(defaults): wiz.lookandFeelData('restore') if not wiz.currSkin() == defaults and not BUILDNAME == "": gui = wiz.checkBuild(BUILDNAME, 'gui') FAILED = True if gui == 'http://': wiz.log("[Installed Check] Guifix was set to http://", xbmc.LOGNOTICE) DIALOG.ok( ADDONTITLE, "[COLOR %s]It looks like the skin settings was not applied to the build." % COLOR2, "Sadly no gui fix was attatched to the build", "You will need to reinstall the build and make sure to do a force close[/COLOR]" ) elif wiz.workingURL(gui): yes = DIALOG.yesno(
FAILED = True elif not EXTRACT == '100' and not BUILDNAME == "": wiz.log("[Installed Check] Build was extracted %s/100 with [ERRORS: %s]" % (EXTRACT, EXTERROR), xbmc.LOGNOTICE) yes=DIALOG.yesno(ADDONTITLE, '[COLOR %s]%s[/COLOR] [COLOR %s]was not installed correctly!' % (COLOR1, COLOR2, BUILDNAME), 'Installed: [COLOR %s]%s[/COLOR] / Error Count: [COLOR %s]%s[/COLOR]' % (COLOR1, EXTRACT, COLOR1, EXTERROR), 'Would you like to try again?[/COLOR]', nolabel='[B]No Thanks![/B]', yeslabel='[B]Retry Install[/B]') wiz.clearS('build') FAILED = True if yes: wiz.ebi("PlayMedia(plugin://%s/?mode=install&name=%s&url=fresh)" % (ADDON_ID, urllib.quote_plus(BUILDNAME))) wiz.log("[Installed Check] Fresh Install Re-activated", xbmc.LOGNOTICE) else: wiz.log("[Installed Check] Reinstall Ignored") elif SKIN in ['skin.confluence', 'skin.estuary']: wiz.log("[Installed Check] Incorrect skin: %s" % SKIN, xbmc.LOGNOTICE) defaults = wiz.getS('defaultskin') if not defaults == '': if os.path.exists(os.path.join(ADDONS, defaults)): if wiz.swapSkins(defaults): wiz.lookandFeelData('restore') if not wiz.currSkin() == defaults and not BUILDNAME == "": gui = wiz.checkBuild(BUILDNAME, 'gui') FAILED = True if gui == 'http://': wiz.log("[Installed Check] Guifix was set to http://", xbmc.LOGNOTICE) DIALOG.ok(ADDONTITLE, "[COLOR %s]It looks like the skin settings was not applied to the build." % COLOR2, "Sadly no gui fix was attatched to the build", "You will need to reinstall the build and make sure to do a force close[/COLOR]") elif wiz.workingURL(gui): yes=DIALOG.yesno(ADDONTITLE, '%s was not installed correctly!' % BUILDNAME, 'It looks like the skin settings was not applied to the build.', 'Would you like to apply the GuiFix?', nolabel='[B]No, Cancel[/B]', yeslabel='[B]Apply Fix[/B]') if yes: wiz.ebi("PlayMedia(plugin://%s/?mode=install&name=%s&url=gui)" % (ADDON_ID, urllib.quote_plus(BUILDNAME))); wiz.log("[Installed Check] Guifix attempting to install") else: wiz.log('[Installed Check] Guifix url working but cancelled: %s' % gui, xbmc.LOGNOTICE) else: DIALOG.ok(ADDONTITLE, "[COLOR %s]It looks like the skin settings was not applied to the build." % COLOR2, "Sadly no gui fix was attatched to the build", "You will need to reinstall the build and make sure to do a force close[/COLOR]") wiz.log('[Installed Check] Guifix url not working: %s' % gui, xbmc.LOGNOTICE) else: