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


Python xbmc.executebuiltin方法代码示例

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


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

示例1: __enter__

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import executebuiltin [as 别名]
def __enter__(self):

        ''' Do everything we need before the sync
        '''
        LOG.info("-->[ fullsync ]")

        if not settings('dbSyncScreensaver.bool'):

            xbmc.executebuiltin('InhibitIdleShutdown(true)')
            self.screensaver = get_screensaver()
            set_screensaver(value="")

        self.running = True

        if settings('enableTextureCache.bool') and settings('lowPowered.bool'):

            self.artwork = True
            settings('enableTextureCache.bool', False)
            LOG.info("[ disable artwork cache ]")

        window('emby_sync.bool', True)

        return self 
开发者ID:MediaBrowser,项目名称:plugin.video.emby,代码行数:25,代码来源:sync.py

示例2: __exit__

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import executebuiltin [as 别名]
def __exit__(self, exc_type, exc_val, exc_tb):

        ''' Exiting sync
        '''
        self.running = False
        window('emby_sync', clear=True)

        if self.screensaver is not None:

            xbmc.executebuiltin('InhibitIdleShutdown(false)')
            set_screensaver(value=self.screensaver)
            self.screensaver = None

        if self.artwork is not None:

            settings('enableTextureCache.bool', True)
            self.artwork = None
            LOG.info("[ enable artwork cache ]")

        LOG.info("--<[ fullsync ]") 
开发者ID:MediaBrowser,项目名称:plugin.video.emby,代码行数:22,代码来源:sync.py

示例3: action_menu

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import executebuiltin [as 别名]
def action_menu(self):

        selected = self._selected_option.decode('utf-8')

        if selected == OPTIONS['Refresh']:
            self.server['api'].refresh_item(self.item['Id'])

        elif selected == OPTIONS['AddFav']:
            self.server['api'].favorite(self.item['Id'], True)

        elif selected == OPTIONS['RemoveFav']:
            self.server['api'].favorite(self.item['Id'], False)

        elif selected == OPTIONS['Addon']:
            xbmc.executebuiltin('Addon.OpenSettings(plugin.video.emby)')

        elif selected == OPTIONS['Delete']:
            self.delete_item() 
开发者ID:MediaBrowser,项目名称:plugin.video.emby,代码行数:20,代码来源:context.py

示例4: queue

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import executebuiltin [as 别名]
def queue():
	playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
	show_title, season, episode, thumb, displayname, qmode, url = args.url.split('<join>')
	name =  base64.b64decode(displayname)
	item = xbmcgui.ListItem(name, path = url)
	try:
		item.setThumbnailImage(thumb)
	except:
		pass
	try:
		item.setInfo('Video', {	'title' : name,
						'season' : season,
						'episode' : episode,
						'TVShowTitle' : show_title})
	except:
		pass
	playlist.add(url, item)
	xbmc.executebuiltin('XBMC.Notification(%s, %s, 5000, %s)' % ("Queued", name, thumb)) 
开发者ID:moneymaker365,项目名称:plugin.video.ustvvod,代码行数:20,代码来源:contextmenu.py

示例5: _scheduleAutoplay

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import executebuiltin [as 别名]
def _scheduleAutoplay(self, channelId, programTitle, startTime, endTime):
        t = startTime - datetime.datetime.now()
        timeToAutoplay = ((t.days * 86400) + t.seconds) / 60
        if timeToAutoplay < 0:
            return
        #timeToAutoplay = 1
        name = self.createAlarmClockName(programTitle, startTime)
        xbmc.executebuiltin('AlarmClock(%s-start,RunScript(special://home/addons/script.tvguide.fullscreen/play.py,%s,%s),%d,True)' %
        (name.encode('utf-8', 'replace'), channelId.encode('utf-8'), startTime, timeToAutoplay - int(ADDON.getSetting('autoplays.before'))))

        t = endTime - datetime.datetime.now()
        timeToAutoplay = ((t.days * 86400) + t.seconds) / 60
        #timeToAutoplay = 0
        if ADDON.getSetting('autoplays.stop') == 'true':
            xbmc.executebuiltin('AlarmClock(%s-stop,RunScript(special://home/addons/script.tvguide.fullscreen/stop.py,%s,%s),%d,True)' %
            (name.encode('utf-8', 'replace'), channelId.encode('utf-8'), startTime, timeToAutoplay + int(ADDON.getSetting('autoplays.after')))) 
开发者ID:primaeval,项目名称:script.tvguide.fullscreen,代码行数:18,代码来源:autoplay.py

示例6: run

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import executebuiltin [as 别名]
def run(self):
        if os.path.isfile(DOWNLOAD_LIST):
            s = read_from_file(DOWNLOAD_LIST)
            search_list = s.split('\n')
            for list in search_list:
                if list != '':
                    splitlist = list.split('<>')
                    filename = os.path.join(splitlist[0], splitlist[4])
                    artist = splitlist[1]
                    album = splitlist[2]
                    track = splitlist[3]
                    trackname = splitlist[4]
                    tracktitle = trackname
                    if os.path.exists(filename):
                        audio = MP3(filename, ID3=EasyID3)
                        audio["title"] = tracktitle
                        audio["artist"] = artist
                        audio["album"] = album
                        audio["tracknumber"] = track
                        audio.save()
                        remove_from_list(list, DOWNLOAD_LIST)
        notification('Music Library', 'ID3 tags updated', '3000', iconart)
        xbmc.executebuiltin('UpdateLibrary(music)') 
开发者ID:bugatsinho,项目名称:bugatsinho.github.io,代码行数:25,代码来源:default.py

示例7: load_color_schemes

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import executebuiltin [as 别名]
def load_color_schemes(self):
        log.info('load_color_schemes')

        color_file = self.Settings.getSetting(util.SETTING_RCB_COLORFILE)
        if not color_file \
            or not xbmcvfs.exists(color_file) \
            or util.getConfiguredSkin() not in color_file:
            log.info('setting "rcb_colorfile" not found or color file not readable. using "defaults.xml"')
            color_file = os.path.join(util.getAddonInstallPath(), 'resources', 'skins', util.getConfiguredSkin(), 'colors', 'defaults.xml')

        tree = ElementTree()
        if sys.version_info >= (2, 7):
            parser = XMLParser(encoding='utf-8')
        else:
            parser = XMLParser()

        log.info('Reading color file: %s' %color_file)
        tree.parse(color_file, parser)

        for color in tree.findall('color'):
            log.debug('set color: %s: %s' % (color.attrib.get('name'), color.text))
            xbmc.executebuiltin("Skin.SetString(%s, %s)" % (color.attrib.get('name'), color.text)) 
开发者ID:maloep,项目名称:romcollectionbrowser,代码行数:24,代码来源:gui.py

示例8: doImport

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import executebuiltin [as 别名]
def doImport(self, romCollections, isRescrape, scrapeInBackground, selectedRomCollection=None,
                 selectedScraper=None):

        if scrapeInBackground:
            path = os.path.join(self.Settings.getAddonInfo('path'), 'dbUpLauncher.py')
            log.info('Launch external update script: %s' % path)
            xbmc.executebuiltin("RunScript(%s, selectedRomCollection=%s, selectedScraper=%s)"
                                % (path, selectedRomCollection, selectedScraper))
            #exit RCB
            self.quit = True
            self.exit()
        else:
            import dbupdate

            progressDialog = dialogprogress.ProgressDialogGUI()
            #32111 = Import Games...
            progressDialog.create(util.localize(32111))

            updater = dbupdate.DBUpdate()
            updater.updateDB(self.gdb, progressDialog, romCollections, isRescrape)
            del updater
            progressDialog.writeMsg("", -1)
            del progressDialog 
开发者ID:maloep,项目名称:romcollectionbrowser,代码行数:25,代码来源:gui.py

示例9: set_acestream_engine_cache_folder

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import executebuiltin [as 别名]
def set_acestream_engine_cache_folder(url):
	if not xbmc.getCondVisibility('system.platform.windows'):
		opcao= xbmcgui.Dialog().yesno(translate(40000), translate(70011))
	else: opcao = ''
	if opcao:
		if not xbmc.getCondVisibility('system.platform.Android'):
			acestream_settings_file = os.path.join(os.getenv("HOME"),'.ACEStream','playerconf.pickle')
		else:
			acestream_settings_file = os.path.join('/sdcard','.ACEStream','playerconf.pickle')
		settings_content = readfile(acestream_settings_file)
		cachefolder = xbmcgui.Dialog().browse(3, translate(70012) , 'myprograms','')
		if cachefolder:
			settings_content = settings_content.replace(url,cachefolder)
			save(acestream_settings_file, settings_content)
			settings.setSetting('acestream_cachefolder',cachefolder)
			xbmc.executebuiltin("Notification(%s,%s,%i,%s)" % (translate(40000), translate(600026), 1,addonpath+"/icon.png"))
			xbmc.executebuiltin("Container.Refresh") 
开发者ID:tvaddonsco,项目名称:program.plexus,代码行数:19,代码来源:advancedfunctions.py

示例10: shutdown_hooks

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import executebuiltin [as 别名]
def shutdown_hooks():
	opcao= xbmcgui.Dialog().yesno(translate(40000), translate(70027),translate(70028) + str(xbmc.getSkinDir()) )
	if opcao:
		mensagemok(translate(40000),translate(70029),translate(70030))
		mensagemok(translate(40000),translate(70031))
		opcao= xbmcgui.Dialog().yesno(translate(40000), translate(70032) )
		if opcao:
			import xml.etree.ElementTree as ET
			skin_path = xbmc.translatePath("special://skin/")
			tree = ET.parse(os.path.join(skin_path, "addon.xml"))
			try: res = tree.findall("./res")[0]
			except: res = tree.findall("./extension/res")[0]
			xml_specific_folder = str(res.attrib["folder"])
			xml_video_osd = os.path.join(xbmc.translatePath("special://skin/"),xml_specific_folder,"VideoOSD.xml")
			xml_content = readfile(xml_video_osd).replace('PlayerControl(Stop)','RunPlugin(plugin://plugin.video.p2p-streams/?mode=7)')
			try:
				save(xml_video_osd,xml_content)
				xbmc.executebuiltin("Notification(%s,%s,%i,%s)" % (translate(40000), translate(600026), 1,addonpath+"/icon.png"))
			except: mensagemok(translate(40000),'No permissions.')
			opcao= xbmcgui.Dialog().yesno(translate(40000), translate(70033) )
			if opcao:
				from peertopeerutils.keymapeditor import *
				run() 
开发者ID:tvaddonsco,项目名称:program.plexus,代码行数:25,代码来源:advancedfunctions.py

示例11: main

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import executebuiltin [as 别名]
def main():
    info = sys.listitem.getVideoInfoTag()
    dbid = info.getDbId()
    db_type = info.getMediaType()
    remote_id = sys.listitem.getProperty("id")
    BASE = "RunScript(script.extendedinfo,info="
    if not dbid:
        dbid = sys.listitem.getProperty("dbid")
    if db_type == "movie":
        xbmc.executebuiltin("%sextendedinfo,dbid=%s,id=%s,name=%s)" % (BASE, dbid, remote_id, info.getTitle()))
    elif db_type == "tvshow":
        xbmc.executebuiltin("%sextendedtvinfo,dbid=%s,id=%s)" % (BASE, dbid, remote_id))
    elif db_type == "season":
        xbmc.executebuiltin("%sseasoninfo,tvshow=%s,season=%s)" % (BASE, info.getTVShowTitle(), info.getSeason()))
    elif db_type in ["actor", "director"]:
        xbmc.executebuiltin("%sextendedactorinfo,name=%s)" % (BASE, sys.listitem.getLabel())) 
开发者ID:Guilouz,项目名称:repository.guilouz,代码行数:18,代码来源:context_menu_extendedinfo.py

示例12: download

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import executebuiltin [as 别名]
def download(link):
  subtitle_list = []

  if xbmcvfs.exists(__temp__):
    shutil.rmtree(__temp__)
  xbmcvfs.mkdirs(__temp__)

  file = os.path.join(__temp__, "addic7ed.srt")

  f = get_url(link)

  local_file_handle = open(file, "wb")
  local_file_handle.write(f)
  local_file_handle.close()

  subtitle_list.append(file)

  if len(subtitle_list) == 0:
    if search_string:
      xbmc.executebuiltin((u'Notification(%s,%s)' % (__scriptname__ , __language__(32002))).encode('utf-8'))
    else:
      xbmc.executebuiltin((u'Notification(%s,%s)' % (__scriptname__ , __language__(32003))).encode('utf-8'))

  return subtitle_list 
开发者ID:cflannagan,项目名称:service.subtitles.addic7ed,代码行数:26,代码来源:service.py

示例13: get_soup

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import executebuiltin [as 别名]
def get_soup(content):
    # check if page content can be used
    pattern = "subtitles from the source! - Addic7ed.com"
    try:
        soup = BeautifulSoup(content)
        title = str(soup.findAll("title")[0])
        if title.find(pattern) > -1:
            return soup
        else:
            log("bad page, maybe index after 404")
            return False
    except:
        log("badly formatted content")
        if self_notify:
            xbmc.executebuiltin((u'Notification(%s,%s,%s,%s)' % (__addonname__, __language__(30009), 750, __icon__)).encode('utf-8', 'ignore'))
        return False 
开发者ID:skylex,项目名称:xbmc-betaseries,代码行数:18,代码来源:service.py

示例14: get_soup

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import executebuiltin [as 别名]
def get_soup(content):
    # check if page content can be used
    pattern = "TVsubtitles.net - "
    try:
        soup = BeautifulSoup(content)
        title = str(soup.findAll("title")[0])
        if title.find(pattern) > -1:
            return soup
        else:
            log("bad page, maybe index after 404")
            return False
    except:
        log("badly formatted content")
        if self_notify:
            xbmc.executebuiltin((u'Notification(%s,%s,%s,%s)' % (__addonname__, __language__(30009), 750, __icon__)).encode('utf-8', 'ignore'))
        return False 
开发者ID:skylex,项目名称:xbmc-betaseries,代码行数:18,代码来源:service.py

示例15: _get_settings

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import executebuiltin [as 别名]
def _get_settings( self ):
        log('reading settings')
        service    = []
        BetaActive = __addon__.getSetting('betaactive') == 'true'
        BetaFirst  = __addon__.getSetting('betafirst') == 'true'
        BetaUser   = __addon__.getSetting('betauser')
        BetaPass   = __addon__.getSetting('betapass')
        BetaBulk   = __addon__.getSetting('betabulk') == 'true'
        BetaMark   = __addon__.getSetting('betamark') == 'true'
        BetaUnMark = __addon__.getSetting('betaunmark') == 'true'
        BetaFollow = __addon__.getSetting('betafollow') == 'true'
        BetaNotify = __addon__.getSetting('betanotify') == 'true'
        if BetaActive and BetaUser and BetaPass:
            # [service, api-url, api-key, user, pass, first-only, token, auth-fail, failurecount, timercounter, timerexpiretime, bulk, mark, unmark, follow]
            service = ['betaseries', self.apiurl, self.apikey, BetaUser, BetaPass, BetaFirst, '', False, 0, 0, 0, BetaBulk, BetaMark, BetaUnMark, BetaFollow, BetaNotify]
            self.Player = MyPlayer(action = self._service_betaserie, service = service)
            if service[15]:
                xbmc.executebuiltin((u'Notification(%s,%s,%s,%s)' % (__addonname__, __language__(30003), 750, __icon__)).encode('utf-8', 'ignore')) 
开发者ID:skylex,项目名称:xbmc-betaseries,代码行数:20,代码来源:betaseries.py


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