コード例 #1
0
ファイル: default.py プロジェクト: lockers90/Isengard
def HELPCATEGORIES():
    if ((XBMCversion['Ver'] in ['','']) or (int(XBMCversion['two']) < 12)) and (settings.getSetting('bypass-xbmcversion')=='false'):
        eod(); addon.show_ok_dialog(["Compatibility Issue: Outdated Kodi Setup","Please upgrade to a newer version of XBMC first!","Visit %s for Support!"%SiteDomain],title="XBMC "+XBMCversion['Ver'],is_error=False); DoA('Back'); 
    else:
        if main.isFile(LocalLinks)==True: link=main.nolines(main.FileOpen(LocalLinks))
        else: link=main.OPEN_URL(LinksUrl).replace('\n','').replace('\r','').replace('\a','')
        match=re.compile('name="(.+?)".+?rl="(.+?)".+?mg="(.+?)".+?anart="(.+?)".+?escription="(.+?)".+?ype="(.+?)"').findall(link)
        for name,url,iconimage,fanart,description,filetype in match:
            #if 'status' in filetype:
                #main.addHELPDir(name,url,'wizardstatus',iconimage,fanart,description,filetype)
            #else:    
                main.addHELPDir(name,url,'helpwizard',iconimage,fanart,description,filetype)
        CustomUrl=settings.getSetting('custom-url')
        try:
            if (len(CustomUrl) > 10) and ('://' in CustomUrl):
                main.addHELPDir('Custom Url[CR](Addon Settings)',CustomUrl,'helpwizard',main.AddonIcon,main.AddonFanart,"Custom url found in addon settings.","main") ## For Testing to test a url with a FileHost.
        except: pass
        #main.addHELPDir('Testing','http://www.firedrive.com/file/################','helpwizard',iconimage,fanart,description,filetype) ## For Testing to test a url with a FileHost.
        main.AUTO_VIEW('movies')
コード例 #2
0
ファイル: default.py プロジェクト: lockers90/Isengard
def HELPWIZARD(name,url,description,filetype):
    path=xbmc.translatePath(os.path.join('special://home','addons','packages')); confirm=xbmcgui.Dialog(); filetype=filetype.lower(); 
    if filetype=='splash':
        try: html=main.OPEN_URL(url)
        except: return
        import splash_highway as splash
        SplashBH=xbmc.translatePath(os.path.join(main.AddonPath,'ContentPanel.png'))
        ExitBH=xbmc.translatePath(os.path.join(main.AddonPath,'Exit.png'))
        splash.do_My_TextSplash2(html,SplashBH,12,TxtColor='0xff00bfff',Font='font12',BorderWidth=40,ImgexitBtn=ExitBH,colorDiffuse='0xff00bfff'); 
        return
    if confirm.yesno(TeamName,"Would you like %s to "%SiteDomain,"customize your add-on selection? "," "):
        dp=xbmcgui.DialogProgress(); dp.create(AddonTitle,"Downloading ",'','Please Wait')
        lib=os.path.join(path,name+'.zip')
        try: os.remove(lib)
        except: pass
        ### ## ... ## 
        #try:
        #    if (main.isFile(LocalLinks)==False) or (main.isFile(RequiredHostsPath)==False): FHTML=main.OPEN_URL(RequiredHostsUrl); main.FileSave(RequiredHostsPath,FHTML); time.sleep(2)
        #except: pass
        if main.isFile(RequiredHostsPath)==False: dialog=xbmcgui.Dialog(); dialog.ok("Error!",'import not found.'); return
        try: import requiredhosts as RequiredHosts
        except: print "error attempting to import requiredhosts as RequiredHosts"; dialog=xbmcgui.Dialog(); dialog.ok("Error!","import failed."); return
        #print {'url':url}
        url=RequiredHosts.CheckForHosts(url); #print {'url':url}
        ### ## ... ## 
        if str(url).endswith('[error]'): print url; dialog=xbmcgui.Dialog(); dialog.ok("Error!",url); return
        if '[error]' in url: print url; dialog=xbmcgui.Dialog(); dialog.ok("Error!",url); return
        if not str(url).lower().startswith('http://'): print url; dialog=xbmcgui.Dialog(); dialog.ok("Error!",url); return
        print {'url':url}
        downloader.download(url,lib,dp)
        ### ## ... ## 
        #return ## For Testing 2 Black Overwrite of stuff. ##
        ### ## ... ## 
        if   filetype=='main':  addonfolder=xbmc.translatePath('special://home')
        elif filetype=='addon': addonfolder=xbmc.translatePath(os.path.join('special://home','addons'))
        else: print {'filetype':filetype}; dialog=xbmcgui.Dialog(); dialog.ok("Error!",'filetype: "%s"'%str(filetype)); return
        #time.sleep(2)
        xbmc.sleep(4000)
        dp.update(0,"","Extracting Zip Please Wait")
        print '======================================='; print addonfolder; print '======================================='
        extract.all(lib,addonfolder,dp)
        proname=xbmc.getInfoLabel("System.ProfileName")
        if (filetype=='main') and (settings.getSetting('homescreen-shortcuts')=='true'):
            link=main.OPEN_URL(wizardUrl+'shortcuts.txt')
            shorts=re.compile('shortcut="(.+?)"').findall(link)
            for shortname in shorts: main.xEB('Skin.SetString(%s)'%shortname)
        if (filetype=='main') and (settings.getSetting('other-skin-settings')=='true'):
            #main.xEB('Skin.SetString(CustomBackgroundPath,%s)' %img)
            #main.xEB('Skin.SetBool(ShowBackgroundVideo)')       ## Set to true so we can later set them to false.
            #main.xEB('Skin.SetBool(ShowBackgroundVis)')         ## Set to true so we can later set them to false.
            #main.xEB('Skin.ToggleSetting(ShowBackgroundVideo)') ## Switching from true to false.
            #main.xEB('Skin.ToggleSetting(ShowBackgroundVis)')   ## Switching from true to false.
            xEBb('HideBackGroundFanart')
            xEBb('HideVisualizationFanart')
            xEBb('AutoScroll')
        if (filetype=='main') and (main.isFile(xbmc.translatePath(SkinBackGroundImg))==True): 
            xEBS('CustomBackgroundPath',SkinBackGroundImg)
            xEBb('UseCustomBackground')
        #time.sleep(2)
        xbmc.sleep(4000)
        xbmc.executebuiltin('UnloadSkin()'); xbmc.executebuiltin('ReloadSkin()'); xbmc.executebuiltin("LoadProfile(%s)" % proname)
        dialog=xbmcgui.Dialog(); dialog.ok("Success!","Installation Complete","   [COLOR gold]Brought To You By %s[/COLOR]"%SiteDomain)