コード例 #1
0
ファイル: default.py プロジェクト: ADMPhantom/Phantom
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)
コード例 #2
0
ファイル: default.py プロジェクト: noba3/KoTos
ExitBH=os.path.join(mediaFolder,'navi-x3.png')
try: LastVerMessageID=str(SettingG("LastVerMessageID"))
except: LastVerMessageID=""
try: curVerID=str(gAI("version"))
except: curVerID=''
#print [LastVerMessageID,curVerID]
#LastVerMessageID="" ## Used for testing.
if (len(LastVerMessageID)==0) or (not LastVerMessageID==curVerID):
	SettingS("LastVerMessageID",curVerID)
	#SplashTxt="Hello User,\n\n        "
	#SplashTxt+="NAVI-X may now be found for download on the XBMCHUB.COM repository."
	SplashTxt="Navi-X and Team XBMCHUB.com\n\n"
	SplashTxt+="If you're receiving this message it\n"
	SplashTxt+="means that Navi-X has for the first\n"
	SplashTxt+="time updated automatically on your\n"
	SplashTxt+="system and is now located in the\n"
	SplashTxt+="XBMCHUB.com repository!"
	#splash.do_My_TextSplash(SplashTxt,SplashBH,12,TxtColor='0xff00ff00',Font='font14',BorderWidth=70); 
	splash.do_My_TextSplash2(SplashTxt,SplashBH,12,TxtColor='0xff00ff00',Font='font14',BorderWidth=70,ImgexitBtn=ExitBH); 
	
#############################################################################
#Start Navi-X
#############################################################################
import navix
win = navix.MainWindow("skin2.xml", addon.getAddonInfo('path')) #,'Default','720p'
win.doModal()
del win

#xbmc.executescript(RootDir + 'default_.py')

コード例 #3
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)