def doBuildMenu(self): base_info.loga( "[Check Updates] [User Selected: Open Build Menu] [Next Check: %s]" % str(NEXTCHECK)) base_info.setS('lastbuildcheck', str(NEXTCHECK)) self.CloseWindow() url = 'plugin://%s/?mode=builds' % ADDON_ID xbmc.executebuiltin('ActivateWindow(10025, "%s", return)' % url)
def doDismiss(self): try: base_info.setS("notedismiss", "true") base_info.log("[Notification] NotifyID %s Dismissed" % base_info.getS('noteid')) except: pass self.CloseWindow()
def doRemindMeLater(self): try: base_info.setS("notedismiss", "false") base_info.loga("[Notification] NotifyID %s Remind Me Later" % base_info.getS('noteid')) except: pass self.CloseWindow()
def contact(msg='', TxtColor='0xFFFFFFFF', Font='font12', BorderWidth=10): base_info.loga("[Contact Notification] Started") url = base_info.workingURL(CONT_NOT) if url == True: link = base_info.OPEN_URL(CONT_NOT).replace('\r','').replace('\t','') id, msg = link.split('|||') base_info.loga("[Contact Notification] id: %s" % str(int(id))) base_info.setS('contnoteid', str(int(id))) base_info.setS('contnotedismiss', 'false') Contact_Notification(msg=msg) base_info.loga("[Contact Notification] Complete") else: base_info.loga("[Contact Notification] URL(%s): %s" % (CONT_NOT, url))
elif mode=='clearthumb' : base_info.Clear_Thumb() elif mode=='contact' : contact.contact(CONT_NOT) elif mode=='convertpath' : backuprestore.Convert_Special(url) elif mode=='delete' : backuprestore.Delete_Backup(url) elif mode=='deleteall' : backuprestore.Delete_All_Backups() elif mode=='deletesingle' : backuprestore.ListBackDel() elif mode=='developer' : Developer_Menu() elif mode=='forceclose' : base_info.killxbmc() elif mode=='freshstart' : base_info.Fresh_Start() elif mode=='install' : base_info.Wizard(name,url,description) elif mode=='maint' : Maintenance() elif mode=='restore' : backuprestore.Restore() elif mode=='restoredata' : backuprestore.Restore_Login() elif mode=='restorezip' : backuprestore.Read_Zip(url) elif mode=='restorelog' : backuprestore.Read_Login_Data_Zip(url) elif mode=='restoremenu' : Restore_Menu() elif mode=='savedata' : Backup_Menu() elif mode=='theme' : base_info.Wizard_Theme(name,url,description) elif mode=='thememenu' : Theme_Menu() elif mode=='togglesetting' : base_info.setS(name, 'false' if base_info.getS(name) == 'true' else 'true'); base_info.ebi('Container.Refresh') elif mode=='viewlog' : base_info.viewLogFile() elif mode=='wizcreds' : contact.credits(CRED_NOT) elif mode=='wizardupdate' : base_info.wizardUpdate() elif mode=='apkinstaller' : apkMenu() elif mode=='apkinstall' : base_info.apkInstaller(name, url) ####################################################################### ####################################################################### #End of Directory xbmcplugin.endOfDirectory(int(sys.argv[1])) #######################################################################
elif mode == 'install': base_info.Wizard(name, url, description) elif mode == 'maint': Maintenance() elif mode == 'reloadskin': xbmc.executebuiltin('ReloadSkin()') elif mode == 'restore': backuprestore.Restore() elif mode == 'restoredata': backuprestore.Restore_Login() elif mode == 'restorezip': backuprestore.Read_Zip(url) elif mode == 'restorelog': backuprestore.Read_Login_Data_Zip(url) elif mode == 'restoremenu': Restore_Menu() elif mode == 'rootpatch': backuprestore.reset_backup_location() elif mode == 'savedata': Backup_Menu() elif mode == 'sdfix': sportsdevil.SDFix() elif mode == 'skindebugtoggle': xbmc.executebuiltin('Skin.ToggleDebug()') elif mode == 'theme': base_info.Wizard_Theme(name, url, description) elif mode == 'thememenu': Theme_Menu() elif mode == 'togglesetting': base_info.setS(name, 'false' if base_info.getS(name) == 'true' else 'true') base_info.ebi('Container.Refresh') elif mode == 'forceupdate': wiz.forceUpdate() elif mode == 'viewlog': base_info.viewLogFile('kodi.log') elif mode == 'viewoldlog': base_info.viewLogFile('kodi.old.log') elif mode == 'viewwizlog': base_info.viewLogFile('wizard.log') elif mode == 'wizcreds': contact.credits(CREDITSFILE) elif mode == 'wizardupdate': base_info.wizardUpdate() elif mode == 'youtubefix': youtube.YoutubeFix()
def doIgnore(self): base_info.loga( "[First Run] [User Selected: Ignore Build Menu] [Next Check: %s]" % str(NEXTCHECK)) base_info.setS('lastbuildcheck', str(NEXTCHECK)) self.CloseWindow()
def checkSkin(): base_info.loga("[Build Check] Invalid Skin Check Start") DEFAULTSKIN = base_info.getS('defaultskin') DEFAULTNAME = base_info.getS('defaultskinname') DEFAULTIGNORE = base_info.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: base_info.loga("Skin was not reset") base_info.setS('defaultskinignore', 'true') gotoskin = False else: base_info.setS('defaultskin', '') base_info.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 = re.compile('<addon.+?id="(.+?)".+?>').findall(g) match2 = re.compile('<addon.+?name="(.+?)".+?>').findall(g) base_info.loga("%s: %s" % (folder, str(match[0]))) if len(match) > 0: skinlist.append(str(match[0])) skinname.append(str(match2[0])) else: base_info.loga("ID not found for %s" % folder) else: base_info.loga("ID not found for %s" % folder) 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: base_info.loga("Skin was not reset") base_info.setS('defaultskinignore', 'true') else: gotoskin = skinlist[choice] gotoname = skinname[choice] else: base_info.loga("Skin was not reset") base_info.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: base_info.loga("Skin was not reset") base_info.setS('defaultskinignore', 'true') else: base_info.loga("No skins found in addons folder.") base_info.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)"): xbmc.executebuiltin('SendClick(11)') base_info.lookandFeelData('restore') else: base_info.LogNotify(ADDONTITLE, '[COLOR red]Skin Swap Timed Out![/COLOR]') base_info.loga("[Build Check] Invalid Skin Check End")
if ENABLE == 'Yes': if not NOTIFY == 'true': url = base_info.workingURL(NOTIFICATION) if url == True: link = base_info.OPEN_URL(NOTIFICATION).replace('\r', '').replace( '\t', '') id, msg = link.split('|||') if int(id) == int(NOTEID): if NOTEDISMISS == 'false': notify.notification(msg=msg) else: base_info.loga("[Notifications] id[%s] Dismissed" % int(id)) elif int(id) > int(NOTEID): base_info.loga("[Notifications] id: %s" % str(int(id))) base_info.setS('noteid', str(int(id))) base_info.setS('notedismiss', 'false') notify.notification(msg=msg) base_info.loga("[Notifications] Complete") else: base_info.loga("[Notifications] URL(%s): %s" % (NOTIFICATION, url)) else: base_info.loga("[Notifications] Turned Off") else: base_info.loga("[Notifications] Not Enabled") base_info.loga("[Version Check] Version Check Start") if not os.path.exists(CHECKVERSION): file = open(CHECKVERSION, 'w') file.write("<version>0</version>") file.close()
def doSaveMenu(self): base_info.loga("[Check Updates] [User Selected: Open Save Data Menu] [Next Check: %s]" % str(NEXTCHECK)) base_info.setS('lastbuildcheck', str(NEXTCHECK)) self.CloseWindow() url = 'plugin://plugin.program.kodihelp/?mode=savedata' xbmc.executebuiltin('ActivateWindow(10025, "%s", return)' % url)