本文整理汇总了Python中xbmcplugin.setSetting函数的典型用法代码示例。如果您正苦于以下问题:Python setSetting函数的具体用法?Python setSetting怎么用?Python setSetting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setSetting函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: set_setting
def set_setting(name, value, channel=""):
"""
Fija el valor de configuracion del parametro indicado.
Establece 'value' como el valor del parametro 'name' en la configuracion global o en la configuracion propia del
canal 'channel'.
Devuelve el valor cambiado o None si la asignacion no se ha podido completar.
Si se especifica el nombre del canal busca en la ruta \addon_data\plugin.video.pelisalacarta\settings_channels el
archivo channel_data.json y establece el parametro 'name' al valor indicado por 'value'. Si el archivo
channel_data.json no existe busca en la carpeta channels el archivo channel.xml y crea un archivo channel_data.json
antes de modificar el parametro 'name'.
Si el parametro 'name' no existe lo añade, con su valor, al archivo correspondiente.
Parametros:
name -- nombre del parametro
value -- valor del parametro
channel [opcional] -- nombre del canal
Retorna:
'value' en caso de que se haya podido fijar el valor y None en caso contrario
"""
if channel:
from core import channeltools
return channeltools.set_channel_setting(name, value, channel)
else:
try:
xbmcplugin.setSetting(name, value)
except:
return None
return value
开发者ID:Hernanarce,项目名称:pelisalacarta,代码行数:34,代码来源:config.py
示例2: onClick
def onClick(self, controlID):
"""
Notice: onClick not onControl
Notice: it gives the ID of the control not the control object
"""
#action sur la liste
print "Control %d clicked" % controlID
if controlID == 200 :
print "Processing control 200"
#Renvoie le numéro de l'item sélectionné
num = self.xml_list.getSelectedPosition()
print "got xml list"
#Traitement de l'information
if self.list_items[num]['selection'] == "false" :
self.list_items[num]['selection'] = "true"
else :
self.list_items[num]['selection'] = "false"
print "updating list"
self.listItems(self.list_items)
print "list updated"
self.xml_list.selectItem(num)
print "done processing 200"
if controlID == 9001 :
print "processing 9001"
matchfilter=[]
for item in self.list_items:
if item['selection'] == "true" :
matchfilter.append(str(item['genreid']))
xbmcplugin.setSetting('genreignore', ",".join(matchfilter))
self.close()
print "done with 9001"
print "done with control"
开发者ID:drrlramsey,项目名称:xbmc-addons,代码行数:35,代码来源:mydialog.py
示例3: __init__
def __init__( self, *args, **kwargs ):
if True: #self._check_compatible():
self.pluginMgr = PluginMgr()
self.parameters = self.pluginMgr.parse_params()
# if 1st start create missing directories
self.fileMgr = fileMgr()
self.fileMgr.verifrep( DIR_ADDON_MODULE )
self.fileMgr.verifrep( DIR_ADDON_REPO )
self.fileMgr.verifrep( DIR_CACHE )
self.fileMgr.verifrep( DIR_CACHE_ADDONS )
# Check settings
if xbmcplugin.getSetting('first_run') == 'true':
# Check (only the 1st time) is xbmcaddon module is available
print( " **First run")
if self._check_addon_lib():
print( " XBMC Addon 4 XBOX Addon Library already installed")
print( " Installing default repositories")
if ( self._installRepos() ):
xbmcplugin.setSetting('first_run','false')
self._createRootDir()
else:
print( " ERROR - XBMC Addon 4 XBOX Addon Library MISSING")
dialog = xbmcgui.Dialog()
dialog.ok( __language__(30000), __language__(30091) ,__language__(30092))
else:
self._createRootDir()
self.pluginMgr.add_sort_methods( False )
self.pluginMgr.end_of_directory( True, update=False )
开发者ID:Quihico,项目名称:passion-xbmc,代码行数:31,代码来源:Addons4Xbox_list_root.py
示例4: editB
def editB(name,url):
type = 'presets_' + url
presets = xbmcplugin.getSetting( type )
save = presets.split( " | " )
del save[save.index(name)]
x=0
for item in save:
if x == 0:
sets = item
else:
sets = sets + ' | ' + item
x=x+1
searchStr = name
keyboard = xbmc.Keyboard(searchStr, "Edit user name")
keyboard.doModal()
if (keyboard.isConfirmed() == False):
return
searchstring = keyboard.getText()
newStr = searchstring
if len(newStr) == 0:
return
if len(save) == 0:
sets = newStr
else:
sets = sets + ' | ' + newStr
xbmcplugin.setSetting(type, sets)
xbmc.executebuiltin( "Container.Refresh" )
开发者ID:drrlramsey,项目名称:xbmc-addons,代码行数:27,代码来源:default.py
示例5: setSetting
def setSetting(name,value):
# Nuevo XBMC
if DHARMA:
__settings__.setSetting( name,value ) # this will return "foo" setting value
# Antiguo XBMC
else:
xbmcplugin.setSetting(name,value)
开发者ID:jorik041,项目名称:pelisalacarta-personal-fork,代码行数:7,代码来源:config.py
示例6: _authorize
def _authorize( self ):
# flickr client
client = FlickrClient( api_key=True, secret=True )
# authenticate
authtoken = client.authenticate()
# write it to the settings file
if ( authtoken ):
xbmcplugin.setSetting( "authtoken", authtoken )
开发者ID:nuka1195,项目名称:plugin.image.flickr,代码行数:8,代码来源:categories.py
示例7: setSetting
def setSetting(name,value):
# Nuevo XBMC
if DHARMA:
__settings__.setSetting( name,value ) # this will return "foo" setting value
# Antiguo XBMC
else:
try:
import xbmcplugin
xbmcplugin.setSetting(name,value)
except:
pass
开发者ID:jorik041,项目名称:pelisalacarta-personal-fork,代码行数:11,代码来源:config.py
示例8: 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" )
开发者ID:drrlramsey,项目名称:xbmc-addons,代码行数:12,代码来源:xbmcplugin_categories.py
示例9: openSettings
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
开发者ID:nolenfelten,项目名称:xbmc-addons,代码行数:14,代码来源:xbmcplugin_categories.py
示例10: __init__
def __init__( self, *args, **kwargs ):
#
# User to choose an address...
#
# Previously pinged addresses...
try :
ping_addrs = eval( xbmcplugin.getSetting( "ping_addrs" ) )
except :
ping_addrs = []
# Insert entry for "New address"...
ping_addrs.insert(0, xbmc.getLocalizedString(30302))
# User choice...
dialogAddrs = xbmcgui.Dialog()
index = dialogAddrs.select( xbmc.getLocalizedString(30201), ping_addrs )
self.ping_addr = ""
# New address...
if index == 0 :
keyboard = xbmc.Keyboard( "", xbmc.getLocalizedString( 30301 ) )
keyboard.doModal()
if keyboard.isConfirmed() :
self.ping_addr = keyboard.getText()
# Previous address..
if index > 0 :
self.ping_addr = ping_addrs[ index ]
#
# User made a choice...
#
if self.ping_addr > "" :
#
# Save address for future use...
#
ping_addrs.pop( 0 )
try :
ping_addrs.index ( self.ping_addr )
except :
ping_addrs.append( self.ping_addr )
ping_addrs.sort()
xbmcplugin.setSetting( "ping_addrs", repr( ping_addrs ))
#
# Show text window (+ pinging, see onInit)...
#
self.doModal()
开发者ID:abellujan,项目名称:xbmc4xbox-addons,代码行数:49,代码来源:xbmcplugin_ping.py
示例11: removeB
def removeB(name,url):
type = 'presets_' + url
presets = xbmcplugin.getSetting( type )
save = presets.split( " | " )
del save[save.index(name)]
sets = ''
x=0
for item in save:
if x == 0:
sets = sets + item
else:
sets = sets + ' | ' + item
x=x+1
xbmcplugin.setSetting(type, sets)
xbmc.executebuiltin( "Container.Refresh" )
开发者ID:drrlramsey,项目名称:xbmc-addons,代码行数:15,代码来源:default.py
示例12: authenticate
def authenticate( self ):
log( " > authenticate()")
ok = False
# make the authentication call
try:
authkey = self.client.authenticate( self.email, self.password )
if authkey and authkey.startswith("ERROR"): raise "neterror", authkey
if not authkey:
messageOK(__plugin__, __lang__(30904))
else:
try:
xbmcplugin.setSetting( "authkey", authkey )
ok = True
except: pass
except "neterror", e:
messageOK(__plugin__, e)
开发者ID:drrlramsey,项目名称:xbmc-addons,代码行数:16,代码来源:xbmcplugin_categories.py
示例13: delete_preset
def delete_preset( self ):
try:
# read the queries
presets = eval( xbmcplugin.getSetting( "presets_%s" % ( "videos", "users", "categories", )[ self.args.issearch - 1 ], ) )
# if this is an existing search, move it up
for count, preset in enumerate( presets ):
if ( self.args.query in repr( preset ) ):
del presets[ count ]
break
except:
# no presets found
presets = []
# save presets
xbmcplugin.setSetting( "presets_%s" % ( "videos", "users", "categories", )[ self.args.issearch - 1 ], repr( presets ) )
# refresh container so item is removed
xbmc.executebuiltin( "Container.Refresh" )
开发者ID:drrlramsey,项目名称:xbmc-addons,代码行数:16,代码来源:xbmcplugin_categories.py
示例14: authenticate
def authenticate( self ):
# if this is first run open settings
self.openSettings()
# authentication is not permanent, so do this only when first launching plugin
if ( not sys.argv[ 2 ] ):
# get the users settings
password = xbmcplugin.getSetting( "user_password" )
# we can only authenticate if both email and password are entered
self.authkey = ""
if ( self.username and password ):
# our client api
from YoutubeAPI.YoutubeClient import YoutubeClient
client = YoutubeClient()
# make the authentication call
self.authkey, userid = client.authenticate( self.username, password )
# save authkey even if failed, so no token expired error
xbmcplugin.setSetting( "authkey", self.authkey )
开发者ID:drrlramsey,项目名称:xbmc-addons,代码行数:17,代码来源:xbmcplugin_categories.py
示例15: authenticate
def authenticate( self ):
# if this is first run open settings
self.openSettings()
# authentication is not permanent, so do this only when first launching plugin
if ( not sys.argv[ 2 ] ):
# get the users settings
password = xbmcplugin.getSetting( "user_password" )
# we can only authenticate if both email and password are entered
if ( self.email and password ):
# our client api
from PicasaAPI.PicasaClient import PicasaClient
client = PicasaClient()
# make the authentication call
authkey = client.authenticate( self.email, password )
# if authentication succeeded, save it for later
if ( authkey ):
xbmcplugin.setSetting( "authkey", authkey )
开发者ID:drrlramsey,项目名称:xbmc-addons,代码行数:17,代码来源:xbmcplugin_categories.py
示例16: runKeyboard3
def runKeyboard3():
searchStr = ''
keyboard = xbmc.Keyboard(searchStr, "Enter the exact user name")
keyboard.doModal()
if (keyboard.isConfirmed() == False):
return
searchstring = keyboard.getText()
newStr = searchstring.replace(' ','+')
if len(newStr) == 0:
return
presets = xbmcplugin.getSetting( "presets_users" )
if presets == '':
save_str = newStr
else:
save_str = presets + " | " + newStr
xbmcplugin.setSetting("presets_users", save_str)
if len(newStr) != 0:
thumb = xbmc.getInfoImage( "ListItem.Thumb" )
playVideo(newStr, 'get_cat', thumb)
开发者ID:drrlramsey,项目名称:xbmc-addons,代码行数:19,代码来源:default.py
示例17: runKeyboard4
def runKeyboard4():
searchStr = ''
keyboard = xbmc.Keyboard(searchStr, "Search")
keyboard.doModal()
if (keyboard.isConfirmed() == False):
return
searchstring = keyboard.getText()
newStr = searchstring.replace(' ','+')
if len(newStr) == 0:
return
presets = xbmcplugin.getSetting( "presets_search" )
if presets == '':
save_str = newStr
else:
save_str = presets + " | " + newStr
xbmcplugin.setSetting("presets_search", save_str)
if len(newStr) != 0:
url = 'http://www.justin.tv/search?q='+newStr
runSearch(url)
开发者ID:drrlramsey,项目名称:xbmc-addons,代码行数:19,代码来源:default.py
示例18: setSetting
def setSetting(*args, **kwargs):
"""Sets a plugin setting for the current running plugin.
handle: integer - handle the plugin was started with.
id: string - id of the setting that the module needs to access.
value: string or unicode - value of the setting.
Example:
xbmcplugin.setSetting(int(sys.argv[1]), id='username', value='teamxbmc')
"""
return mundane_xbmcplugin.setSetting(*args, **kwargs)
开发者ID:bstrdsmkr,项目名称:plugin.video.waldo,代码行数:11,代码来源:magic_xbmcplugin.py
示例19: _run_once
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()
开发者ID:nuka1195,项目名称:plugin.image.flickr,代码行数:22,代码来源:categories.py
示例20: save_as_preset
def save_as_preset( self ):
# select correct query
query = ( self.args.pq, self.args.gq, self.args.uq )[ self.args.issearch - 1 ]
# fetch saved presets
try:
# read the queries
presets = eval( xbmcplugin.getSetting( "presets_%s" % ( "photos", "groups", "users", )[ self.args.issearch - 1 ], ) )
# if this is an existing search, move it up
for count, preset in enumerate( presets ):
if ( repr( query + " | " )[ : -1 ] in repr( preset ) ):
del presets[ count ]
break
# limit to number of searches to save
if ( len( presets ) >= self.settings[ "saved_searches" ] ):
presets = presets[ : self.settings[ "saved_searches" ] - 1 ]
except:
# no presets found
presets = []
# insert our new search
presets = [ self.args.title + " | " + query + " | " + self.query_thumbnail ] + presets
# save search query
xbmcplugin.setSetting( "presets_%s" % ( "photos", "groups", "users", )[ self.args.issearch - 1 ], repr( presets ) )
开发者ID:drrlramsey,项目名称:xbmc-addons,代码行数:22,代码来源:xbmcplugin_pictures.py
注:本文中的xbmcplugin.setSetting函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论