本文整理汇总了Python中resources.libs.wizard.addonId函数的典型用法代码示例。如果您正苦于以下问题:Python addonId函数的具体用法?Python addonId怎么用?Python addonId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addonId函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: updateDebrid
def updateDebrid(do, who):
file = DEBRIDID[who]['file']
settings = DEBRIDID[who]['settings']
data = DEBRIDID[who]['data']
addonid = wiz.addonId(DEBRIDID[who]['plugin'])
saved = DEBRIDID[who]['saved']
default = DEBRIDID[who]['default']
user = addonid.getSetting(default)
suser = wiz.getS(saved)
name = DEBRIDID[who]['name']
icon = DEBRIDID[who]['icon']
if do == 'update':
if not user == '':
try:
with open(file, 'w') as f:
for debrid in data:
f.write('<debrid>\n\t<id>%s</id>\n\t<value>%s</value>\n</debrid>\n' % (debrid, addonid.getSetting(debrid)))
f.close()
user = addonid.getSetting(default)
wiz.setS(saved, user)
wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name), '[COLOR %s]Datos de Real Debrid: Guardados![/COLOR]' % COLOR2, 2000, icon)
except Exception, e:
wiz.log("[Real Debrid Data] Unable to Update %s (%s)" % (who, str(e)), xbmc.LOGERROR)
else: wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name), '[COLOR %s]Datos de Real Debrid: No registrado![/COLOR]' % COLOR2, 2000, icon)
示例2: updateTrakt
def updateTrakt(do, who):
file = TRAKTID[who]['file']
settings = TRAKTID[who]['settings']
data = TRAKTID[who]['data']
addonid = wiz.addonId(TRAKTID[who]['plugin'])
saved = TRAKTID[who]['saved']
default = TRAKTID[who]['default']
user = addonid.getSetting(default)
suser = wiz.getS(saved)
name = TRAKTID[who]['name']
icon = TRAKTID[who]['icon']
if do == 'update':
if not user == '':
try:
with open(file, 'w') as f:
for trakt in data:
f.write('<trakt>\n\t<id>%s</id>\n\t<value>%s</value>\n</trakt>\n' % (trakt, addonid.getSetting(trakt)))
f.close()
user = addonid.getSetting(default)
wiz.setS(saved, user)
wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name), '[COLOR %s]Trakt Data: Saved![/COLOR]' % COLOR2, 2000, icon)
except Exception, e:
wiz.log("[Trakt Data] Unable to Update %s (%s)" % (who, str(e)), xbmc.LOGERROR)
else: wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name), '[COLOR %s]Trakt Data: Not Registered![/COLOR]' % COLOR2, 2000, icon)
示例3: traktUser
def traktUser(who):
user=None
if who == 'exodus' and os.path.exists(PATHEXODUS): ADD_EXODUS = wiz.addonId(EXODUS); user = ADD_EXODUS.getSetting('trakt.user')
if who == 'velocity' and os.path.exists(PATHVELOCITY): ADD_VELOCITY = wiz.addonId(VELOCITY); user = ADD_VELOCITY.getSetting('trakt_username')
if who == 'velocitykids' and os.path.exists(PATHVELOCITYKI): ADD_VELOCITYKIDS = wiz.addonId(VELOCITYKIDS); user = ADD_VELOCITYKIDS.getSetting('trakt_username')
if who == 'salts' and os.path.exists(PATHSALTS): ADD_SALTS = wiz.addonId(SALTS); user = ADD_SALTS.getSetting('trakt_user')
if who == 'saltshd' and os.path.exists(PATHSALTSHD): ADD_SALTSHD = wiz.addonId(SALTSHD); user = ADD_SALTSHD.getSetting('trakt_user')
if who == 'royalwe' and os.path.exists(PATHROYALWE): ADD_ROYALWE = wiz.addonId(ROYALWE); user = ADD_ROYALWE.getSetting('trakt_account')
if who == 'specto' and os.path.exists(PATHSPECTO): ADD_SPECTO = wiz.addonId(SPECTO); user = ADD_SPECTO.getSetting('trakt.user')
if who == 'trakt' and os.path.exists(PATHTRAKT): ADD_TRAKT = wiz.addonId(TRAKT); user = ADD_TRAKT.getSetting('user')
return user
示例4: traktUser
def traktUser(who):
user=None
if TRAKTID[who]:
if os.path.exists(TRAKTID[who]['path']):
try:
add = wiz.addonId(TRAKTID[who]['plugin'])
user = add.getSetting(TRAKTID[who]['default'])
except:
return None
return user
示例5: loginUser
def loginUser(who):
user=None
if LOGINID[who]:
if os.path.exists(LOGINID[who]['path']):
try:
add = wiz.addonId(LOGINID[who]['plugin'])
user = add.getSetting(LOGINID[who]['default'])
except:
pass
return user
示例6: debridUser
def debridUser(who):
user=None
if DEBRIDID[who]:
if os.path.exists(DEBRIDID[who]['path']):
try:
add = wiz.addonId(DEBRIDID[who]['plugin'])
user = add.getSetting(DEBRIDID[who]['default'])
except:
pass
return user
示例7: activateDebrid
def activateDebrid(who):
if DEBRIDID[who]:
if os.path.exists(DEBRIDID[who]['path']):
act = DEBRIDID[who]['activate']
addonid = wiz.addonId(DEBRIDID[who]['plugin'])
if act == '': addonid.openSettings()
else: url = xbmc.executebuiltin(DEBRIDID[who]['activate'])
else: DIALOG.ok(ADDONTITLE, '%s no esta actualmente instalado.' % DEBRIDID[who]['name'])
else:
wiz.refresh()
return
check = 0
while debridUser(who) == None:
if check == 30: break
check += 1
time.sleep(10)
wiz.refresh()
示例8: activateLogin
def activateLogin(who):
if LOGINID[who]:
if os.path.exists(LOGINID[who]['path']):
act = LOGINID[who]['activate']
addonid = wiz.addonId(LOGINID[who]['plugin'])
if act == '': addonid.openSettings()
else: url = xbmc.executebuiltin(LOGINID[who]['activate'])
else: DIALOG.ok(ADDONTITLE, '%s no esta instalado.' % LOGINID[who]['name'])
else:
wiz.refresh()
return
check = 0
while loginUser(who) == None or loginUser(who) == "":
if check == 30: break
check += 1
time.sleep(10)
wiz.refresh()
示例9: activateDebrid
def activateDebrid(who):
if DEBRIDID[who]:
if os.path.exists(DEBRIDID[who]['path']):
act = DEBRIDID[who]['activate']
addonid = wiz.addonId(DEBRIDID[who]['plugin'])
if act == '': addonid.openSettings()
else: url = xbmc.executebuiltin(DEBRIDID[who]['activate'])
else: DIALOG.ok(ADDONTITLE, '%s is not currently installed.' % DEBRIDID[who]['name'])
else:
xbmc.executebuiltin('Container.Refresh')
return
check = 0
while debridUser(who) == None:
if check == 30: break
check += 1
time.sleep(10)
xbmc.executebuiltin('Container.Refresh')
示例10: activateTrakt
def activateTrakt(who):
if TRAKTID[who]:
if os.path.exists(TRAKTID[who]['path']):
act = TRAKTID[who]['activate']
addonid = wiz.addonId(TRAKTID[who]['plugin'])
if act == '': addonid.openSettings()
else: url = xbmc.executebuiltin(TRAKTID[who]['activate'])
else: DIALOG.ok(ADDONTITLE, '%s is not currently installed.' % TRAKTID[who]['name'])
else:
wiz.refresh()
return
check = 0
while traktUser(who) == None:
if check == 30: break
check += 1
time.sleep(10)
wiz.refresh()
示例11: updateDebrid
def updateDebrid(do, who):
file = DEBRIDID[who]['file']
settings = DEBRIDID[who]['settings']
data = DEBRIDID[who]['data']
addonid = wiz.addonId(DEBRIDID[who]['plugin'])
saved = DEBRIDID[who]['saved']
default = DEBRIDID[who]['default']
user = addonid.getSetting(default)
suser = wiz.getS(saved)
name = DEBRIDID[who]['name']
icon = DEBRIDID[who]['icon']
if do == 'update':
if not user == '':
with open(file, 'w') as f:
for debrid in data: f.write('<debrid>\n\t<id>%s</id>\n\t<value>%s</value>\n</debrid>\n' % (debrid, addonid.getSetting(debrid)))
f.close()
user = addonid.getSetting(default)
wiz.setS(saved, user)
wiz.LogNotify(name,'Real Debrid Data: [COLOR green]Saved![/COLOR]', 2000, icon)
else: wiz.LogNotify(name,'Real Debrid Data: [COLOR red]Not Registered![/COLOR]', 2000, icon)
elif do == 'restore':
if os.path.exists(file):
f = open(file,mode='r'); g = f.read().replace('\n','').replace('\r','').replace('\t',''); f.close();
match = re.compile('<debrid><id>(.+?)</id><value>(.+?)</value></debrid>').findall(g)
if len(match) > 0:
for debrid, value in match:
addonid.setSetting(debrid, value)
user = addonid.getSetting(default)
wiz.setS(saved, user)
wiz.LogNotify(name,'Real Debrid: [COLOR green]Restored![/COLOR]', 2000, icon)
#else: wiz.LogNotify(name,'Real Debrid Data: [COLOR red]Not Found![/COLOR]', 2000, icon)
elif do == 'clearaddon':
wiz.log('%s SETTINGS: %s' % (name, settings))
if os.path.exists(settings):
f = open(settings,"r"); lines = f.readlines(); f.close()
f = open(settings,"w")
for line in lines:
match = re.compile('<setting.+?id="(.+?)".+?/>').findall(line)
if len(match) == 0: f.write(line)
elif match[0] not in data: f.write(line)
else: wiz.log('[Debrid Clear Addon] Removing Line: %s' % line)
f.close()
wiz.LogNotify(name,'Addon Data: [COLOR green]Cleared![/COLOR]', 2000, icon)
else: wiz.LogNotify(name,'Addon Data: [COLOR red]Clear Failed![/COLOR]', 2000, icon)
xbmc.executebuiltin('Container.Refresh')
示例12: debridIt
def debridIt(do, who):
if not os.path.exists(ADDONDATA): os.makedirs(ADDONDATA)
if not os.path.exists(REALFOLD): os.makedirs(REALFOLD)
if who == 'all':
for log in ORDER:
if os.path.exists(DEBRIDID[log]['path']):
try:
addonid = wiz.addonId(DEBRIDID[log]['plugin'])
default = DEBRIDID[log]['default']
user = addonid.getSetting(default)
if user == '' and do == 'update': continue
updateDebrid(do, log)
except: pass
else: wiz.log('[Real Debrid Data] %s(%s) is not installed' % (DEBRIDID[log]['name'],DEBRIDID[log]['plugin']), xbmc.LOGERROR)
wiz.setS('debridlastsave', str(THREEDAYS))
else:
if DEBRIDID[who]:
if os.path.exists(DEBRIDID[who]['path']):
updateDebrid(do, who)
else: wiz.log('[Real Debrid Data] Invalid Entry: %s' % who, xbmc.LOGERROR)
示例13: loginIt
def loginIt(do, who):
if not os.path.exists(ADDONDATA): os.makedirs(ADDONDATA)
if not os.path.exists(LOGINFOLD): os.makedirs(LOGINFOLD)
if who == 'all':
for log in ORDER:
if os.path.exists(LOGINID[log]['path']):
try:
addonid = wiz.addonId(LOGINID[log]['plugin'])
default = LOGINID[log]['default']
user = addonid.getSetting(default)
if user == '' and do == 'update': continue
updateLogin(do, log)
except: pass
else: wiz.log('[Login Info] %s(%s) is not installed' % (LOGINID[log]['name'],LOGINID[log]['plugin']), xbmc.LOGERROR)
wiz.setS('loginlastsave', str(THREEDAYS))
else:
if LOGINID[who]:
if os.path.exists(LOGINID[who]['path']):
updateLogin(do, who)
else: wiz.log('[Login Info] Invalid Entry: %s' % who, xbmc.LOGERROR)
示例14: traktIt
def traktIt(do, who):
if not os.path.exists(ADDONDATA): os.makedirs(ADDONDATA)
if not os.path.exists(TRAKTFOLD): os.makedirs(TRAKTFOLD)
if who == 'all':
for log in ORDER:
if os.path.exists(TRAKTID[log]['path']):
try:
addonid = wiz.addonId(TRAKTID[log]['plugin'])
default = TRAKTID[log]['default']
user = addonid.getSetting(default)
if user == '' and do == 'update': continue
updateTrakt(do, log)
except: pass
else: wiz.log('[Trakt Data] %s(%s) is not installed' % (TRAKTID[log]['name'],TRAKTID[log]['plugin']), xbmc.LOGERROR)
wiz.setS('traktlastsave', str(THREEDAYS))
else:
if TRAKTID[who]:
if os.path.exists(TRAKTID[who]['path']):
updateTrakt(do, who)
else: wiz.log('[Trakt Data] Invalid Entry: %s' % who, xbmc.LOGERROR)
示例15: debrid_Exodus
def debrid_Exodus(do):
EXODUSFILE = os.path.join(REALFOLD, 'exodus_debrid')
EXODUSSETTINGS = os.path.join(USERDATA, 'addon_data', EXODUS,'settings.xml')
EXODUS_DEBRID = ['realdebrid.auth', 'realdebrid.id', 'realdebrid.secret', 'realdebrid.token', 'realdebrid.refresh']
ADD_EXODUS = wiz.addonId(EXODUS)
TRAKTEXODUS = ADD_EXODUS.getSetting('realdebrid.id')
if do == 'update':
if not TRAKTEXODUS == '':
with open(EXODUSFILE, 'w') as f:
for debrid in EXODUS_DEBRID: f.write('<debrid>\n\t<id>%s</id>\n\t<value>%s</value>\n</debrid>\n' % (debrid, ADD_EXODUS.getSetting(debrid)))
f.closed
wiz.setS('realexodus', ADD_EXODUS.getSetting('realdebrid.id'))
wiz.LogNotify('Exodus','Real Debrid Data: [COLOR green]Saved![/COLOR]', 2000, os.path.join(PATHEXODUS,'icon.png'))
else: wiz.LogNotify('Exodus','Real Debrid Data: [COLOR red]Not Registered![/COLOR]', 2000, os.path.join(PATHEXODUS,'icon.png'))
elif do == 'restore':
if os.path.exists(EXODUSFILE):
f = open(EXODUSFILE,mode='r'); g = f.read().replace('\n','').replace('\r','').replace('\t',''); f.close();
match = re.compile('<debrid><id>(.+?)</id><value>(.+?)</value></debrid>').findall(g)
if len(match) > 0:
for debrid, value in match:
ADD_EXODUS.setSetting(debrid, value)
wiz.setS('realexodus', ADD_EXODUS.getSetting('realdebrid.id'))
wiz.LogNotify('Exodus','Real Debrid: [COLOR green]Restored![/COLOR]', 2000, os.path.join(PATHEXODUS,'icon.png'))
else: wiz.LogNotify('Exodus','Real Debrid Data: [COLOR red]Not Found![/COLOR]', 2000, os.path.join(PATHEXODUS,'icon.png'))
elif do == 'clearaddon':
wiz.log('Exodus SETTINGS: %s' % EXODUSSETTINGS)
if os.path.exists(EXODUSSETTINGS):
f = open(EXODUSSETTINGS,"r"); lines = f.readlines(); f.close()
f = open(EXODUSSETTINGS,"w")
for line in lines:
match = re.compile('<setting.+?id="(.+?)".+?/>').findall(line)
if len(match) == 0: f.write(line)
elif match[0] not in EXODUS_DEBRID: f.write(line)
else: wiz.log('Removing Line: %s' % line)
f.close()
wiz.LogNotify('Exodus','Addon Data: [COLOR green]Cleared![/COLOR]', 2000, os.path.join(PATHEXODUS,'icon.png'))
else: wiz.LogNotify('Exodus','Addon Data: [COLOR red]Clear Failed![/COLOR]', 2000, os.path.join(PATHEXODUS,'icon.png'))
xbmc.executebuiltin('Container.Refresh')