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
Esempio n. 2
0
 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()
Esempio n. 3
0
    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
Esempio n. 4
0
    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 ] )
Esempio n. 7
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])
Esempio n. 8
0
 def showSettingsWindow(self):
     if (self.__bIsDharma):
         self.__oSettings.openSettings()
     else:
         try:
             xbmcplugin.openSettings(sys.argv[0])
         except:
             pass
Esempio n. 9
0
 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()
Esempio n. 11
0
 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
Esempio n. 13
0
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
Esempio n. 15
0
    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
Esempio n. 16
0
	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
Esempio n. 17
0
 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()
Esempio n. 18
0
__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")
Esempio n. 19
0
def configuracion(params, url, category):
    xbmc.output("[goear.py] configuracion")
    xbmcplugin.openSettings(sys.argv[0])
Esempio n. 20
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):
Esempio n. 21
0
def open_settings():
    import xbmcplugin
    import sys
    xbmcplugin.openSettings(sys.argv[0])
Esempio n. 22
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 ])
Esempio n. 24
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 )
Esempio n. 25
0
def open_settings():
    import xbmcplugin
    import sys
    xbmcplugin.openSettings( sys.argv[ 0 ] )
Esempio n. 26
0
def mainlist(params,url,category):
	xbmc.output("[configuracion.py] mainlist")
	xbmcplugin.openSettings( sys.argv[ 0 ] )
def open_settings():
    xbmcplugin.openSettings( sys.argv[ 0 ] )
Esempio n. 28
0
def configuracion(params,url,category):
	xbmc.output("[goear.py] configuracion")
	xbmcplugin.openSettings( sys.argv[ 0 ] )
Esempio n. 29
0
def open_settings():
    xbmcplugin.openSettings(sys.argv[0])
Esempio n. 30
0
def open_settings():
    print "OPEN SETTINGS"
    print sys.argv[0]
    xbmcplugin.openSettings(sys.argv[0])