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 apkMenu(): link = base_info.OPEN_URL(APK).replace('\n','').replace('\r','').replace('\t','') match = re.compile('name="(.+?)".+?rl="(.+?)".+?con="(.+?)".+?anart="(.+?)".+?dult="(.+?)".+?escription="(.+?)"').findall(link) if len(match) > 0: for name, url, icon, fanart, adult, description in match: base_info.addFile(name, 'apkinstall', name, url, description=description, icon=icon, fanart=fanart, themeit=THEME1) else: base_info.loga("[APK Menu] ERROR: Invalid Format.") base_info.setView('files', 'viewType')
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))
fanart = None description = None try: mode=urllib.unquote_plus(params["mode"]) except: pass try: name=urllib.unquote_plus(params["name"]) except: pass try: url=urllib.unquote_plus(params["url"]) except: pass try: iconimage=urllib.unquote_plus(params["iconimage"]) except: pass try: fanart=urllib.unquote_plus(params["fanart"]) except: pass try: description=urllib.unquote_plus(params["description"]) except: pass base_info.loga('[ Version : \'%s\' ] [ Mode : \'%s\' ] [ Name : \'%s\' ] [ Url : \'%s\' ]' % (VERSION, mode if not mode == '' else None, name, url)) def setView(content, viewType): if content: xbmcplugin.setContent(int(sys.argv[1]), content) if base_info.getS('auto-view')=='true': base_info.ebi("Container.SetViewMode(%s)" % base_info.getS(viewType) ) ####################################################################### ####################################################################### # Below we are creating the different modes if mode==None : Categories() elif mode=='adult' : Adult_Menu() elif mode=='krypton' : Krypton_Menu() elif mode=='adultwiz' : base_info.Wizard_Adult(name,url,description) elif mode=='kryptonwiz' : base_info.Wizard_Krypton(name,url,description)
def doRemindMeLater(self): base_info.loga("[Contact Notification] Remind Me Later") self.CloseWindow()
def doDismiss(self): base_info.loga("[Contact Notification] Dismiss") self.CloseWindow()
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")
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") while xbmc.Player().isPlayingVideo(): xbmc.sleep(1000) base_info.loga("[Auto Update Wizard] Started") if AUTOUPDATE == 'Yes': base_info.wizardUpdate('startup') else: base_info.loga("[Auto Update Wizard] Not Enabled") base_info.loga("[Notifications] Started") 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':
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)