本文整理汇总了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')
示例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)
示例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)
示例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
示例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,
}