当前位置: 首页>>代码示例>>Python>>正文


Python Addon.setSetting方法代码示例

本文整理汇总了Python中addon.common.addon.Addon.setSetting方法的典型用法代码示例。如果您正苦于以下问题:Python Addon.setSetting方法的具体用法?Python Addon.setSetting怎么用?Python Addon.setSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在addon.common.addon.Addon的用法示例。


在下文中一共展示了Addon.setSetting方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Transform

# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import setSetting [as 别名]
def Transform():
    if addon.get_setting('transform') == 'true':
        return
    if xbmcvfs.exists(xbmc.translatePath('special://masterprofile/sources.xml')):
        with open(xbmc.translatePath(os.path.join( addon.get_path(), 'resources', 'sourcesapp.xml'))) as f:
            sourcesapp = f.read()
            f.close()
        with open(xbmc.translatePath('special://masterprofile/sources.xml'), 'r+') as f:
            my_file = f.read()
            if re.search(r'http://transform.mega-tron.tv/', my_file):
                addon.log('Transform Source Found in sources.xml, Not adding.')
                return
            addon.log('Adding Transform source in sources.xml')
            my_file = re.split(r'</files>\n</sources>\n', my_file)
            my_file = my_file[0]+sourcesapp
            f.seek(0)
            f.truncate()
            f.write(my_file)
            f.close()
            Addon.setSetting(id='transform', value='true')
            

    else:
        xbmcvfs.copy(xbmc.translatePath(os.path.join( addon.get_path(), 'resources', 'sources.xml')),
                       xbmc.translatePath('special://masterprofile/sources.xml'))
        Addon.setSetting(id='transform', value='true')
开发者ID:jas0npc,项目名称:kodi,代码行数:28,代码来源:default.py

示例2: changes

# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import setSetting [as 别名]
def changes():
	installed = Addon.getSetting('version')
	if installed != addon_version:
		f = xbmcvfs.File(xbmcaddon.Addon().getAddonInfo('changelog'))
		text = f.read(); f.close()
		
		# xbmc.log(text)
		
		label = '%s - %s' % (xbmc.getLocalizedString(24054), xbmcaddon.Addon().getAddonInfo('name'))
		id = 10147
		xbmc.executebuiltin('ActivateWindow(%d)' % id)
		xbmc.sleep(500)
		
		win = xbmcgui.Window(id)
		retry = 50
		# win.getControl(5).setText(text)
		while (retry > 0):
			try:
				xbmc.sleep(10)
				win.getControl(1).setLabel(label)
				win.getControl(5).setText(text)
				retry = 0
			except:
				retry -= 1

		Addon.setSetting('version', addon_version)
开发者ID:gahan9,项目名称:Hotstar-Rain,代码行数:28,代码来源:default.py

示例3: Announce

# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import setSetting [as 别名]
def Announce(date,announce):
    date = re.sub(r'/','-', date)

    if addon.get_setting('seen_anounce') == 'true':
        seen_date = addon.get_setting('seen_date')
        if date > seen_date:
            pass
        else:
            return

    from pyxbmct.addonwindow import *
    Addon.setSetting('seen_anounce', value='true')
    
    window = AddonDialogWindow('Whitecream [COLOR red]*ANNOUNCEMENT*[/COLOR] %s'%date)
    window.setGeometry(850, 600, 12, 8)
    textBox = TextBox(textColor='0xFFFFFFFF')
    window.placeControl(textBox, 0, 0, columnspan=7, rowspan=11)
    textBox.setText(announce)

    button = Button('Close')
    window.placeControl(button, 11, 3, columnspan=2)
    window.setFocus(button)
    window.connect(button, window.close)
    window.connect(ACTION_NAV_BACK, window.close)
    window.doModal()

    Addon.setSetting(id='seen_date', value=date)
开发者ID:c0ns0le,项目名称:YCBuilds,代码行数:29,代码来源:utils.py

示例4: RealDebrid

# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import setSetting [as 别名]
def RealDebrid():
    rdv = addon.get_setting('realdebrid-video')
    addon.log('RealDebrid Video setting: %s'% rdv)
    
    if addon.get_setting('realdebrid-video') == 'true':
        return
    resolverSettings = xbmc.translatePath('special://masterprofile/addon_data/script.module.urlresolver/settings.xml')
    with open(resolverSettings, 'r') as f:
        my_file = f.read()
        f.close()
        r = re.search(r'RealDebridResolver_login\"\svalue\=\"false\"', my_file, re.I)
        
        if r:
            xbmcgui.Dialog().ok("TvRelease Realdebrid Info Video", "@veedubt25 Has made a video on HOW realdebrid works",
                                "You will ONLY see this ONCE")
            xbmc.executebuiltin("PlayMedia(plugin://plugin.video.youtube/?action=play_video&videoid=s-C4DdG4FF0&quality=720p)")
            Addon.setSetting(id='realdebrid-video', value='true')
        else:
            return
开发者ID:jas0npc,项目名称:kodi,代码行数:21,代码来源:plugin.py

示例5: addon_log

# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import setSetting [as 别名]
local_db = os.path.join(profile, "local_db.db")
pluginDir = sys.argv[0]
dialog = xbmcgui.Dialog()

language = (Addon.getSetting("langType")).lower()
tvsort = (Addon.getSetting("tvsortType")).lower()
moviessort = (Addon.getSetting("moviessortType")).lower()
ipaddress = Addon.getSetting("ipaddress")

base_url = "http://origin.dittotv.com"
base2_url = "/tvshows/all/0/" + language + "/"
listitem = ""

# Create addon folder in user_data, necessary for the sqlite db
if Addon.getSetting("firstrun") != "false":
    Addon.setSetting("firstrun", "false")


def addon_log(string):
    if debug == "true":
        xbmc.log("[plugin.video.DesiTVLive-%s]: %s" % (addon_version, string))


def make_request(url):
    try:
        if ipaddress != "0.0.0.0":
            headers = {
                "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0",
                "Accept": "text/html,application/xhtml+xml,application/xml",
                "X-Forwarded-For": ipaddress,
            }
开发者ID:RozebMomin,项目名称:KodiAddons,代码行数:33,代码来源:default.py


注:本文中的addon.common.addon.Addon.setSetting方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。