def loadSettings(self): log( " > loadSettings()") def _checkSettings(): # check mandatory settings are set self.email = xbmcplugin.getSetting( "user_email" ) self.password = xbmcplugin.getSetting( "user_password" ) ok = bool( self.email and self.password ) log(" _checkSettings() ok=%s" % ok) return ok ok = _checkSettings() if not ok: # call settings menu - if xbmc builds has feature try: if ( os.environ.get( "OS", "n/a" ) == "xbox" ): xbmc.sleep( 2000 ) xbmcplugin.openSettings(sys.argv[0]) ok = _checkSettings() except: # builtin missing from build - inform user to use ContextMenu for settings messageOK(__plugin__, __lang__(30901), __lang__(30902), __lang__(30903)) log( "< loadSettings() ok=%s" % ok) return ok
def _run_once(self): # is this the first time plugin was run and user has not set email if (not sys.argv[2] and xbmcplugin.getSetting("user_id") == "" and xbmcplugin.getSetting("runonce") != "1" and xbmcplugin.getSetting("runonce") != "2"): # set runonce xbmcplugin.setSetting("runonce", "1") # sleep for xbox so dialogs don't clash. (TODO: report this as a bug?) if (os.environ.get("OS", "n/a") == "xbox"): xbmc.sleep(2000) # open settings xbmcplugin.openSettings(sys.argv[0]) # check again to see if authentication is necessary if (not sys.argv[2] and xbmcplugin.getSetting("user_id") != "" and xbmcplugin.getSetting("runonce") != "2" and xbmcplugin.getSetting("authtoken") == ""): # set runonce xbmcplugin.setSetting("runonce", "2") # sleep for xbox so dialogs don't clash. (TODO: report this as a bug?) if (os.environ.get("OS", "n/a") == "xbox"): xbmc.sleep(2000) # ask user if they want to authorize ok = xbmcgui.Dialog().yesno(xbmc.getLocalizedString(30907), xbmc.getLocalizedString(30908), "", xbmc.getLocalizedString(30909), xbmc.getLocalizedString(30910), xbmc.getLocalizedString(30911)) # authorize if (ok): self._authorize()
def loadSettings(self): log(" > loadSettings()") def _checkSettings(): # check mandatory settings are set self.email = xbmcplugin.getSetting("user_email") self.password = xbmcplugin.getSetting("user_password") ok = bool(self.email and self.password) log(" _checkSettings() ok=%s" % ok) return ok ok = _checkSettings() if not ok: # call settings menu - if xbmc builds has feature try: if (os.environ.get("OS", "n/a") == "xbox"): xbmc.sleep(2000) xbmcplugin.openSettings(sys.argv[0]) ok = _checkSettings() except: # builtin missing from build - inform user to use ContextMenu for settings messageOK(__plugin__, __lang__(30901), __lang__(30902), __lang__(30903)) log("< loadSettings() ok=%s" % ok) return ok
def showSettingsWindow(self): if (self.__bIsDharma): self.__oSettings.openSettings() else: try: xbmcplugin.openSettings( sys.argv[ 0 ] ) except: pass
def openSettings(): # Nuevo XBMC if DHARMA: __settings__.openSettings() # Antiguo XBMC else: xbmcplugin.openSettings( sys.argv[ 0 ] )
def mainlist(params,url,category): xbmc.output("[configuracion.py] mainlist") # Verifica ruta de descargas downloadpath = downloadtools.getDownloadPath() downloadlistpath = downloadtools.getDownloadListPath() xbmcplugin.openSettings( sys.argv[ 0 ] )
def mainlist(params, url, category): xbmc.output("[configuracion.py] mainlist") # Verifica ruta de descargas downloadpath = downloadtools.getDownloadPath() downloadlistpath = downloadtools.getDownloadListPath() xbmcplugin.openSettings(sys.argv[0])
def showSettingsWindow(self): if (self.__bIsDharma): self.__oSettings.openSettings() else: try: xbmcplugin.openSettings(sys.argv[0]) except: pass
def __init__(self) : # Init debug = False # # Parse parameters... # params = dict(part.split('=', 1) for part in sys.argv[ 2 ][ 1: ].split('&')) # # Init # self.action = urllib.unquote_plus ( params[ "action" ] ) self.title = urllib.unquote_plus ( params[ "title" ] ) self.link = urllib.unquote_plus ( params[ "link" ] ) # # Check installation path... # if xbmcplugin.getSetting ("install_path") == "" : # Open plugin settings... xbmcplugin.openSettings(url=sys.argv[0]) # User didn't select an installation path, return with no action... if xbmcplugin.getSetting ("install_path") == "" : return # Set installation / download path... self.install_path = xbmcplugin.getSetting ("install_path") # Check path... if not os.path.isdir( self.install_path ) : xbmcgui.Dialog().ok( xbmc.getLocalizedString(30000), xbmc.getLocalizedString(30450), self.install_path) return # # Prepare zip name / location... # self.zip = os.path.basename(self.link) self.zip = os.path.join( self.install_path, self.zip ) # # Download build... # if self.action == "build-download" or ( self.action == "build-install" and not os.path.isfile(self.zip) ) : download_success = self.download_build ( self.title, self.link, self.zip ) if not download_success : return # # Install build... # if self.action == "build-install" and os.path.isfile( self.zip ) : build_dir = os.path.basename(self.link).replace( ".zip", "" ) self.install_build( self.zip, self.install_path, build_dir )
def openPluginSettings(): '''Abre la pantalla de configuración del Plugin Adaptado a los cambios en los plugins a partir de PRE10.5 ''' dlog ('[xbmctools] openPluginSettings') if VERSION_XBMC <= 28764: xbmcplugin.openSettings( sys.argv[ 0 ] ) else: sys.modules["__main__"].__settings__.openSettings()
def openSettings( self ): # is this the first time plugin was run and user has not set email if ( not sys.argv[ 2 ] and xbmcplugin.getSetting( "username" ) == "" and xbmcplugin.getSetting( "runonce" ) == "" ): # set runonce xbmcplugin.setSetting( "runonce", "1" ) # sleep for xbox so dialogs don't clash. (TODO: report this as a bug?) if ( os.environ.get( "OS", "n/a" ) == "xbox" ): xbmc.sleep( 2000 ) # open settings xbmcplugin.openSettings( sys.argv[ 0 ] ) # we need to get the users email self.username = xbmcplugin.getSetting( "username" )
def openSettings(): # Nuevo XBMC if DHARMA: __settings__.openSettings() # Antiguo XBMC else: try: import xbmcplugin xbmcplugin.openSettings( sys.argv[ 0 ] ) except: pass
def openSettings(): # Nuevo XBMC if DHARMA: __settings__.openSettings() # Antiguo XBMC else: try: import xbmcplugin xbmcplugin.openSettings(sys.argv[0]) except: pass
def openSettings(self): try: # is this the first time plugin was run and user has not set email if not sys.argv[2] and xbmcplugin.getSetting("username") == "" and xbmcplugin.getSetting("runonce") == "": # set runonce xbmcplugin.setSetting("runonce", "1") # sleep for xbox so dialogs don't clash. (TODO: report this as a bug?) if os.environ.get("OS", "n/a") == "xbox": xbmc.sleep(2000) # open settings xbmcplugin.openSettings(sys.argv[0]) except: # new methods not in build pass
def loadSettings(self): """ Settings are set in the script, this is just to check all settings exist """ log("> loadSettings") self.settings = reeplayit.ReeplayitSettings() success = self.settings.check() if not success: # call settings menu - if xbmc builds has feature try: if os.environ.get("OS", "n/a") == "xbox": xbmc.sleep(2000) xbmcplugin.openSettings(sys.argv[0]) success = self.settings.check() except: # builtin missing from build - inform user to use ContextMenu for settings traceback.print_exc() messageOK(__lang__(0), __lang__(107)) log("< loadSettings() success=%s" % success) return success
def loadSettings(self): """ Settings are set in the script, this is just to check all settings exist """ log( "> loadSettings") self.settings = reeplayit.ReeplayitSettings() success = self.settings.check() if not success: # call settings menu - if xbmc builds has feature try: if ( os.environ.get( "OS", "n/a" ) == "xbox" ): xbmc.sleep( 2000 ) xbmcplugin.openSettings(sys.argv[0]) success = self.settings.check() except: # builtin missing from build - inform user to use ContextMenu for settings traceback.print_exc() messageOK(__lang__(0), __lang__(107)) log( "< loadSettings() success=%s" % success) return success
def _run_once( self ): # is this the first time plugin was run and user has not set email if ( not sys.argv[ 2 ] and xbmcplugin.getSetting( "user_id" ) == "" and xbmcplugin.getSetting( "runonce" ) != "1" and xbmcplugin.getSetting( "runonce" ) != "2" ): # set runonce xbmcplugin.setSetting( "runonce", "1" ) # sleep for xbox so dialogs don't clash. (TODO: report this as a bug?) if ( os.environ.get( "OS", "n/a" ) == "xbox" ): xbmc.sleep( 2000 ) # open settings xbmcplugin.openSettings( sys.argv[ 0 ] ) # check again to see if authentication is necessary if ( not sys.argv[ 2 ] and xbmcplugin.getSetting( "user_id" ) != "" and xbmcplugin.getSetting( "runonce" ) != "2" and xbmcplugin.getSetting( "authtoken" ) =="" ): # set runonce xbmcplugin.setSetting( "runonce", "2" ) # sleep for xbox so dialogs don't clash. (TODO: report this as a bug?) if ( os.environ.get( "OS", "n/a" ) == "xbox" ): xbmc.sleep( 2000 ) # ask user if they want to authorize ok = xbmcgui.Dialog().yesno( xbmc.getLocalizedString( 30907 ), xbmc.getLocalizedString( 30908 ), "", xbmc.getLocalizedString( 30909 ), xbmc.getLocalizedString( 30910 ), xbmc.getLocalizedString( 30911 ) ) # authorize if (ok ): self._authorize()
__XBMC_Revision__ = "22965" if (__name__ == "__main__"): if (not sys.argv[2]): # we need check compatible() from resources.lib.utils import check_compatible # only run if compatible if (check_compatible()): import resources.lib.trailers as plugin plugin.Main() elif (sys.argv[2].startswith("?category=")): import resources.lib.trailers as plugin plugin.Main() elif (sys.argv[2].startswith("?showtimes=")): import os import resources.lib.showtimes as showtimes s = showtimes.GUI("plugin-AMTII-showtimes.xml", os.getcwd(), "default") del s elif (sys.argv[2].startswith("?download=")): import resources.lib.download as download download.Main() elif (sys.argv[2].startswith("?settings=")): import xbmc import xbmcplugin xbmcplugin.openSettings(sys.argv[0]) # sleep for a few milliseconds, to give dialog time to close. had issues early, may not be necessary #TODO: verify this is necessary #xbmc.sleep( 100 ) # refresh listing in case settings changed xbmc.executebuiltin("Container.Refresh")
def configuracion(params, url, category): xbmc.output("[goear.py] configuracion") xbmcplugin.openSettings(sys.argv[0])
from convert import set_entity_or_charref from convert import translate_string Language = xbmc.Language(os.getcwd()) #variables OK = True db_path = os.path.join(xbmc.translatePath( "special://profile/Database/" ), "MyMusic7.db") xmlfile = os.path.join( BASE_RESOURCE_PATH , "temp.xml" ) artist_url = "http://www.xbmcstuff.com/music_scraper.php?&id_scraper=OIBNYbNUYBCezub&t=artists" album_url = "http://www.xbmcstuff.com/music_scraper.php?&id_scraper=OIBNYbNUYBCezub&t=cdarts" cross_url = "http://www.xbmcstuff.com/music_scraper.php?&id_scraper=OIBNYbNUYBCezub&t=cross" DIALOG_PROGRESS = xbmcgui.DialogProgress() try: storage=( "skin", "albumfolder" )[ int( xbmcplugin.getSetting("folder") ) ] except: xbmcplugin.openSettings(sys.argv[0]) storage=( "skin", "albumfolder" )[ int( xbmcplugin.getSetting("folder") ) ] print "storage = %s" % storage if storage == "skin": cdart_path = os.path.join(xbmc.translatePath("special://skin\media"),"backdrops","artist_fanart","cd") if not os.path.exists(cdart_path): os.makedirs(cdart_path) print cdart_path def addLink(name,url,iconimage): ok=True liz=xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage) liz.setInfo( type="Video", infoLabels={ "Title": name } ) ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz) return ok def addDir(name,url,mode,iconimage):
def open_settings(): import xbmcplugin import sys xbmcplugin.openSettings(sys.argv[0])
def open_settings(): if __has_addons__: __addon__.openSettings() else: xbmcplugin.openSettings(sys.argv[0])
def open_settings(): if __has_addons__: __addon__.openSettings() else: xbmcplugin.openSettings(sys.argv[ 0 ])
sys.path.append( os.path.join( BASE_RESOURCE_PATH, "platform_libraries", env ) ) #import platform's librairies from pysqlite2 import dbapi2 as sqlite3 import elementtree.ElementTree as ET from PIL import Image from file_item import Thumbnails thumbnails = Thumbnails() #chargement des settings try: resolution=( "500", "356" )[ int( xbmcplugin.getSetting("resolution") ) ] except: xbmcplugin.openSettings(sys.argv[0]) resolution=( "500", "356" )[ int( xbmcplugin.getSetting("resolution") ) ] try: clearart_in_tv_folder=(False,True)[ int( xbmcplugin.getSetting("clearart folder") ) ] except: print_exc() print "clearart_in_tv_folder= %s" % clearart_in_tv_folder if not clearart_in_tv_folder: print "skin folder" try: clearart_path=xbmcplugin.getSetting("path") except: xbmcplugin.openSettings(sys.argv[0]) clearart_path=xbmcplugin.getSetting("path") if clearart_path == "special://skin": xbmcplugin.openSettings(sys.argv[0]) if clearart_path.startswith( "special://" ): clearart_path = xbmc.translatePath( clearart_path )
def open_settings(): import xbmcplugin import sys xbmcplugin.openSettings( sys.argv[ 0 ] )
def mainlist(params,url,category): xbmc.output("[configuracion.py] mainlist") xbmcplugin.openSettings( sys.argv[ 0 ] )
def open_settings(): xbmcplugin.openSettings( sys.argv[ 0 ] )
def configuracion(params,url,category): xbmc.output("[goear.py] configuracion") xbmcplugin.openSettings( sys.argv[ 0 ] )
def open_settings(): xbmcplugin.openSettings(sys.argv[0])
def open_settings(): print "OPEN SETTINGS" print sys.argv[0] xbmcplugin.openSettings(sys.argv[0])