• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python xbmc.getCondVisibility函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: get_spotty_binary

 def get_spotty_binary(self):
     '''find the correct spotty binary belonging to the platform'''
     sp_binary = None
     if xbmc.getCondVisibility("System.Platform.Windows"):
         sp_binary = os.path.join(os.path.dirname(__file__), "spotty", "windows", "spotty.exe")
     elif xbmc.getCondVisibility("System.Platform.OSX"):
         # macos binary is x86_64 intel
         sp_binary = os.path.join(os.path.dirname(__file__), "spotty", "darwin", "spotty")
     elif xbmc.getCondVisibility("System.Platform.Linux + !System.Platform.Android"):
         # try to find out the correct architecture by trial and error
         import platform
         architecture = platform.machine()
         log_msg("reported architecture: %s" % architecture)
         if architecture.startswith('AMD64') or architecture.startswith('x86_64'):
             # generic linux x86_64 binary
             sp_binary = os.path.join(os.path.dirname(__file__), "spotty", "x86-linux", "spotty-x86_64")
         else:
             # just try to get the correct binary path if we're unsure about the platform/cpu
             paths = []
             paths.append(os.path.join(os.path.dirname(__file__), "spotty", "arm-linux", "spotty-muslhf"))
             paths.append(os.path.join(os.path.dirname(__file__), "spotty", "arm-linux", "spotty-hf"))
             paths.append(os.path.join(os.path.dirname(__file__), "spotty", "arm-linux", "spotty"))
             paths.append(os.path.join(os.path.dirname(__file__), "spotty", "x86-linux", "spotty"))
             for binary_path in paths:
                 if self.test_spotty(binary_path):
                     sp_binary = binary_path
                     break
     if sp_binary:
         st = os.stat(sp_binary)
         os.chmod(sp_binary, st.st_mode | stat.S_IEXEC)
         log_msg("Architecture detected. Using spotty binary %s" % sp_binary)
     else:
         log_msg("Failed to detect architecture or platform not supported ! Local playback will not be available.")
     return sp_binary
开发者ID:marcelveldt,项目名称:plugin.audio.spotify,代码行数:34,代码来源:utils.py


示例2: onPlayBackStopped

  def onPlayBackStopped(self):
	log('player stops')
	type = 'unkown'
	if (self.isPlayingAudio()):
	  type = "music"
	else:
		if xbmc.getCondVisibility('VideoPlayer.Content(movies)'):
			filename = ''
			isMovie = True
		try:
			filename = self.getPlayingFile()
		except:
			pass
		if filename != '':
			for string in self.substrings:
				if string in filename:
					isMovie = False
					break
		if isMovie:
			type = "movie"
		elif xbmc.getCondVisibility('VideoPlayer.Content(episodes)'):
	  # Check for tv show title and season to make sure it's really an episode
			if xbmc.getInfoLabel('VideoPlayer.Season') != "" and xbmc.getInfoLabel('VideoPlayer.TVShowTitle') != "":
				type = "episode"
	typevar=type
	
	if typevar!="music":
		global script_playerV_stops
		log('Going to execute script = "' + script_playerV_stops + '"')
		xbmc.executebuiltin('XBMC.RunScript('+script_playerV_stops+ ", " + self.playing_type()+')')
	if typevar=="music":
		global script_playerA_stops
		log('Going to execute script = "' + script_playerA_stops + '"')
		xbmc.executebuiltin('XBMC.RunScript('+script_playerA_stops+ ", " + self.playing_type()+')')
开发者ID:Homidom,项目名称:HoMIDoM-Plugin-XBMC-KODI,代码行数:34,代码来源:default.py


示例3: myPlayerChanged

def myPlayerChanged(state):
  log('PlayerChanged(%s)' % state)
  xbmc.sleep(100)
  if state == 'stop':
    ret = "static"
  else:
    currentPlayingFile = xbmc.Player().getPlayingFile()
    if re.search(r'3D Movies', currentPlayingFile, re.I):
      if re.search(r'OU', currentPlayingFile, re.I):
        ret = "3dTAB"
      elif re.search(r'SBS', currentPlayingFile, re.I):
        ret = "3dSBS"
      else:
        ret = "movie"
    elif xbmc.getCondVisibility("VideoPlayer.Content(musicvideos)"):
      ret = "musicvideo"
    elif xbmc.getCondVisibility("Player.HasAudio()"):
      ret = "static"
    else:
      ret = "movie"

    if settings.overwrite_cat:                  # fix his out when other isn't
      if settings.overwrite_cat_val == 0 and ret != "3dTAB" and ret != "3dSBS":       # the static light anymore
        ret = "movie"
      elif ret != "3dTAB" and ret != "3dSBS":
        ret = "musicvideo"
  settings.handleCategory(ret)
开发者ID:jaaps,项目名称:script.xbmc.boblight3d,代码行数:27,代码来源:default.py


示例4: __init__

 def __init__(self):
     footprints()
     self.WINDOW = xbmcgui.Window(10000)
     self.date = date.today()
     self.datestr = str(self.date)
     self.weekday = date.today().weekday()
     self.days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
     self.ampm = xbmc.getCondVisibility("substring(System.Time,Am)") or xbmc.getCondVisibility(
         "substring(System.Time,Pm)"
     )
     self._parse_argv()
     # if __settings__.getSetting( "AddonVersion" ) != __version__:
     #    __settings__.setSetting ( id = "AddonVersion", value = "%s" % __version__ )
     #    self.FORCEUPDATE = True
     if self.BACKEND:
         self.run_backend()
     else:
         self.update_data()
         if self.SILENT == "":
             self.show_gui()
         else:
             oldweekday = date.today().weekday()
             while not xbmc.abortRequested:
                 xbmc.sleep(1000)
                 newweekday = date.today().weekday()
                 if newweekday != oldweekday:
                     oldweekday = newweekday
                     self.FORCEUPDATE = True
                     log("### it's midnight, force update")
                     self.update_data()
             self.close("xbmc is closing, stop script")
开发者ID:noba3,项目名称:KoTos,代码行数:31,代码来源:default.py


示例5: APP_LAUNCH

def APP_LAUNCH():
        if xbmc.getCondVisibility('system.platform.osx'):
            if xbmc.getCondVisibility('system.platform.atv2'):
                log_path = '/var/mobile/Library/Preferences'
                log = os.path.join(log_path, 'xbmc.log')
                logfile = open(log, 'r').read()
            else:
                log_path = os.path.join(os.path.expanduser('~'), 'Library/Logs')
                log = os.path.join(log_path, 'xbmc.log')
                logfile = open(log, 'r').read()
        elif xbmc.getCondVisibility('system.platform.ios'):
            log_path = '/var/mobile/Library/Preferences'
            log = os.path.join(log_path, 'xbmc.log')
            logfile = open(log, 'r').read()
        elif xbmc.getCondVisibility('system.platform.windows'):
            log_path = xbmc.translatePath('special://home')
            log = os.path.join(log_path, 'xbmc.log')
            logfile = open(log, 'r').read()
        elif xbmc.getCondVisibility('system.platform.linux'):
            log_path = xbmc.translatePath('special://home/temp')
            log = os.path.join(log_path, 'xbmc.log')
            logfile = open(log, 'r').read()
        else:
            logfile='Starting XBMC (Unknown Git:.+?Platform: Unknown. Built.+?'
        print '==========================   '+PATH+' '+VERSION+'   =========================='
        try:
            from hashlib import md5
        except:
            from md5 import md5
        from random import randint
        import time
        from urllib import unquote, quote
        from os import environ
        from hashlib import sha1
        import platform
        VISITOR = ADDON.getSetting('visitor_ga')
        match=re.compile('Starting XBMC \((.+?) Git:.+?Platform: (.+?)\. Built.+?').findall(logfile)
        for build, PLATFORM in match:
            if re.search('12.0',build,re.IGNORECASE): 
                build="Frodo" 
            if re.search('11.0',build,re.IGNORECASE): 
                build="Eden" 
            if re.search('13.0',build,re.IGNORECASE): 
                build="Gotham" 
            print build
            print PLATFORM
            utm_gif_location = "http://www.google-analytics.com/__utm.gif"
            utm_track = utm_gif_location + "?" + \
                    "utmwv=" + VERSION + \
                    "&utmn=" + str(randint(0, 0x7fffffff)) + \
                    "&utmt=" + "event" + \
                    "&utme="+ quote("5(APP LAUNCH*"+build+"*"+PLATFORM+")")+\
                    "&utmp=" + quote(PATH) + \
                    "&utmac=" + UATRACK + \
                    "&utmcc=__utma=%s" % ".".join(["1", VISITOR, VISITOR, VISITOR,VISITOR,"2"])
            try:
                print "============================ POSTING APP LAUNCH TRACK EVENT ============================"
                send_request_to_google_analytics(utm_track)
            except:
                print "============================  CANNOT POST APP LAUNCH TRACK EVENT ============================"
开发者ID:Ultraporing,项目名称:jas0npc,代码行数:60,代码来源:default.py


示例6: onPlayBackStarted

 def onPlayBackStarted(self):
     xbmc.sleep(1000)
     # Set values based on the file content
     if (self.isPlayingAudio()):
         self.type = "music"
     else:
         if xbmc.getCondVisibility('VideoPlayer.Content(movies)'):
             filename = ''
             isMovie = True
             try:
                 filename = self.getPlayingFile()
             except:
                 pass
             if filename != '':
                 for string in self.substrings:
                     if string in filename:
                         isMovie = False
                         break
             if isMovie:
                 self.type = "movie"
         elif xbmc.getCondVisibility('VideoPlayer.Content(episodes)'):
             # Check for tv show title and season
             # to make sure it's really an episode
             if xbmc.getInfoLabel('VideoPlayer.Season') != "" and xbmc.getInfoLabel('VideoPlayer.TVShowTitle') != "":
                 self.type = "episode"
         elif xbmc.getCondVisibility('VideoPlayer.Content(musicvideos)'):
             self.type = "musicvideo"
开发者ID:hitmixer,项目名称:service.library.data.provider,代码行数:27,代码来源:service.py


示例7: set_linux_engine_setting

def set_linux_engine_setting(url):
	if xbmc.getCondVisibility('system.platform.linux') and not xbmc.getCondVisibility('system.platform.Android'):
		acestream_settings_file = os.path.join(os.getenv("HOME"),'.ACEStream','playerconf.pickle')
	elif xbmc.getCondVisibility('system.platform.Android'):
		acestream_settings_file = os.path.join('/sdcard','.ACEStream','playerconf.pickle')
	elif xbmc.getCondVisibility('system.platform.windows'):
		acestream_settings_file = os.path.join(os.getenv("APPDATA"),".ACEStream","playerconf.pickle")
	settings_content = readfile(acestream_settings_file)
	keyb = xbmc.Keyboard('',translate(600024))
	keyb.doModal()
	if (keyb.isConfirmed()):
		search = keyb.getText()
		try:
			int(search)
			integer = True
		except: integer = False
		if integer == True:
			if len(url.split('|')) == 3:
				settings_content = settings_content.replace('p'+str(eval(url.split('|')[1])[0][0])+'\nI'+str(eval(url.split('|')[1])[0][1]),'p'+str(eval(url.split('|')[1])[0][0])+'\nI'+search)
				save(acestream_settings_file, settings_content)
				xbmc.executebuiltin("Notification(%s,%s,%i,%s)" % (translate(40000), translate(600026), 1,addonpath+"/icon.png"))
				xbmc.executebuiltin("Container.Refresh")
			else:
				settings_content = settings_content.replace('s.',"sS'"+url.split('|')[0]+"'\np"+url.split('|')[1]+"\nI"+search+"\ns.")
				save(acestream_settings_file, settings_content)
				xbmc.executebuiltin("Notification(%s,%s,%i,%s)" % (translate(40000), translate(600026), 1,addonpath+"/icon.png"))
				xbmc.executebuiltin("Container.Refresh")
			if 'total_max_download_rate' in url: settings.setSetting('total_max_download_rate',value=search)
			if 'total_max_upload_rate' in url:	settings.setSetting('total_max_upload_rate',value=search)	
		else:
			mensagemok(translate(40000),translate(600025))
			sys.exit(0)
开发者ID:Antimoni,项目名称:P2P-Streams-XBMC,代码行数:32,代码来源:advancedfunctions.py


示例8: run

 def run( self ):        
     try:             
         while not self._stop:           # le code                
             if not xbmc.getCondVisibility( "Window.IsVisible(10025)"): self.stop()      #destroy threading
                 
             if xbmc.getCondVisibility( "Container.Content(Seasons)" ) or xbmc.getCondVisibility( "Container.Content(Episodes)" ) and not xbmc.Player().isPlaying() and "plugin://" not in xbmc.getInfoLabel( "ListItem.Path" ) and not xbmc.getInfoLabel( "container.folderpath" ) == "videodb://5/":
                 self.newpath = xbmc.getInfoLabel( "ListItem.Path" )
                 if not self.newpath == self.oldpath and not self.newpath == "" and not self.newpath == "videodb://2/2/":
                     print "### old path: %s" % self.oldpath
                     print "### new path: %s" % self.newpath
                     self.oldpath = self.newpath
                     if not xbmc.Player().isPlaying() : self.start_playing()
                     else: print "### player already playing"
                     
             if xbmc.getInfoLabel( "Window(10025).Property(TvTunesIsAlive)" ) == "true" and not xbmc.Player().isPlaying():
                 print "### playing ends"
                 if self.loud: self.raise_volume()
                 xbmcgui.Window( 10025 ).clearProperty('TvTunesIsAlive')
                 
             if xbmc.getCondVisibility( "Container.Content(tvshows)" ) and self.playpath and not xbmc.getCondVisibility( "Window.IsVisible(12003)" ):
                 print "### reinit condition"
                 self.newpath = ""
                 self.oldpath = ""
                 self.playpath = ""
                 print "### stop playing"
                 xbmc.Player().stop()
                 if self.loud: self.raise_volume()
                 xbmcgui.Window( 10025 ).clearProperty('TvTunesIsAlive')
                 
             time.sleep( .5 )
     except:
         print_exc()
         self.stop()
开发者ID:chunk1982,项目名称:skin.moddedconfluence,代码行数:33,代码来源:tvtunes_backend.py


示例9: run

    def run(self):
        try:
            while not self._stop:  # the code
                if not xbmc.getCondVisibility("Window.IsVisible(10025)"):
                    self.stop()  # destroy threading

                if (
                    xbmc.getCondVisibility("Container.Content(Seasons)")
                    or xbmc.getCondVisibility("Container.Content(Episodes)")
                    and not xbmc.Player().isPlaying()
                    and "plugin://" not in xbmc.getInfoLabel("ListItem.Path")
                    and not xbmc.getInfoLabel("container.folderpath") == "videodb://5/"
                ):
                    if self.enable_custom_path == "true":
                        self.newpath = self.custom_path + xbmc.getInfoLabel("ListItem.TVShowTitle")
                    else:
                        self.newpath = xbmc.getInfoLabel("ListItem.Path")
                    if (
                        not self.newpath == self.oldpath
                        and not self.newpath == ""
                        and not self.newpath == "videodb://2/2/"
                    ):
                        log("### old path: %s" % self.oldpath)
                        log("### new path: %s" % self.newpath)
                        self.oldpath = self.newpath
                        if not xbmc.Player().isPlaying():
                            self.start_playing()
                        else:
                            log("### player already playing")

                if (
                    xbmc.getInfoLabel("Window(10025).Property(TvTunesIsAlive)") == "true"
                    and not xbmc.Player().isPlaying()
                ):
                    log("### playing ends")
                    if self.loud:
                        self.raise_volume()
                    xbmcgui.Window(10025).clearProperty("TvTunesIsAlive")

                if (
                    xbmc.getCondVisibility("Container.Content(tvshows)")
                    and self.playpath
                    and not xbmc.getCondVisibility("Window.IsVisible(12003)")
                ):
                    log("### reinit condition")
                    self.newpath = ""
                    self.oldpath = ""
                    self.playpath = ""
                    log("### stop playing")
                    if __addon__.getSetting("fade") == "true":
                        self.fade_out()
                    else:
                        xbmc.Player().stop()
                    if self.loud:
                        self.raise_volume()
                    xbmcgui.Window(10025).clearProperty("TvTunesIsAlive")
                time.sleep(0.5)
        except:
            print_exc()
            self.stop()
开发者ID:NaturalBornCamper,项目名称:xbmc_backgroundmusic,代码行数:60,代码来源:tvtunes_backend.py


示例10: main

def main():
    if xbmc.getCondVisibility('Container.Content(tvshows)'):
        mediatype = 'tvshow'
    elif xbmc.getCondVisibility('Container.Content(movies)'):
        mediatype = 'movie'
    elif xbmc.getCondVisibility('Container.Content(episodes)'):
        mediatype = 'episode'
    elif xbmc.getCondVisibility('Container.Content(musicvideos)'):
        mediatype = 'musicvideo'
    else:
        xbmc.executebuiltin('Notification(Select Artwork to Download cannot proceed, "Got an unexpected content type. Try again, it will probably work.", 6000, DefaultIconWarning.png)')
        return

    infolabel = xbmc.getInfoLabel('ListItem.Label')
    truelabel = sys.listitem.getLabel()
    mismatch = infolabel != truelabel
    if mismatch:
        log("InfoLabel does not match selected item: InfoLabel('ListItem.Label'): '%s', sys.listitem '%s'" % (infolabel, truelabel), xbmc.LOGWARNING)
        dbid = get_realdbid(sys.listitem)
    else:
        dbid = xbmc.getInfoLabel('ListItem.DBID')

    artworkaddon = xbmcaddon.Addon().getSetting('artwork_addon')
    if not xbmc.getCondVisibility('System.HasAddon({0})'.format(artworkaddon)):
        xbmcgui.Dialog().ok('Select Artwork to Download', "The add-on {0} is not installed. Please install it or configure this context item to use another add-on.".format(artworkaddon))
        return
    xbmc.executebuiltin('RunScript({0}, mode=gui, mediatype={1}, dbid={2})'.format(artworkaddon, mediatype, dbid))
开发者ID:rmrector,项目名称:context.artwork.downloader.gui,代码行数:27,代码来源:context.py


示例11: _set_languages

 def _set_languages( self, dbid, dbtype ):
     try:
         if xbmc.getCondVisibility('Container.Content(movies)') or self.type == "movie" or dbtype == "movie":
             json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovieDetails", "params": {"properties": ["streamdetails"], "movieid":%s }, "id": 1}' % dbid)
             json_query = unicode(json_query, 'utf-8', errors='ignore')
             log(json_query)
             json_response = simplejson.loads(json_query)
             if json_response['result'].has_key('moviedetails'):
                 self._set_properties(json_response['result']['moviedetails']['streamdetails']['audio'], json_response['result']['moviedetails']['streamdetails']['subtitle'])
         elif xbmc.getCondVisibility('Container.Content(episodes)') or self.type == "episode" or dbtype == "episode":
             json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodeDetails", "params": {"properties": ["streamdetails"], "episodeid":%s }, "id": 1}' % dbid)
             json_query = unicode(json_query, 'utf-8', errors='ignore')
             log(json_query)
             json_response = simplejson.loads(json_query)
             if json_response['result'].has_key('episodedetails'):
                 self._set_properties(json_response['result']['episodedetails']['streamdetails']['audio'], json_response['result']['episodedetails']['streamdetails']['subtitle'])
         elif xbmc.getCondVisibility('Container.Content(musicvideos)') or self.type == "musicvideo" or dbtype == "musicvideo":
             json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetMusicVideoDetails", "params": {"properties": ["streamdetails"], "musicvideoid":%s }, "id": 1}' % dbid)
             json_query = unicode(json_query, 'utf-8', errors='ignore')
             log(json_query)
             json_response = simplejson.loads(json_query)
             if json_response['result'].has_key('musicvideodetails'):
                 self._set_properties(json_response['result']['musicvideodetails']['streamdetails']['audio'], json_response['result']['musicvideodetails']['streamdetails']['subtitle'])
     except:
         pass
开发者ID:scott967,项目名称:script.videolanguage,代码行数:25,代码来源:default.py


示例12: stop_any_sop_traces

def stop_any_sop_traces(pid=None):
    if not xbmc.getCondVisibility('system.platform.windows'):
        try: os.kill(pid,9)
        except: pass
        xbmc.sleep(100)
        try:os.system("killall -9 "+SPSC_BINARY)
        except:pass
        xbmc.sleep(100)
        try:spsc.kill()
        except:pass
        xbmc.sleep(100)
        try:spsc.wait()
        except:pass
        if xbmc.getCondVisibility('system.platform.OSX'):
            try:xbmcvfs.delete(os.path.join(pastaperfil,'sopcast.avi'))
            except:pass
    else:
        cmd = ['sc','stop','sopcastp2p']
        import subprocess
        proc = subprocess.Popen(cmd,stdout=subprocess.PIPE,shell=True)
        servicecreator = False
        for line in proc.stdout:
            print("result line" + line.rstrip())
        #dirty hack to break sopcast.exe player codec - renaming the file now!
        break_sopcast()
    return
开发者ID:ahoanglong,项目名称:P2P-Streams-Kodi,代码行数:26,代码来源:sopcast.py


示例13: _get_query

def _get_query(dbtype, dbid):
    if not dbtype:
        if xbmc.getCondVisibility("VideoPlayer.Content(movies)"):
            dbtype = 'movie'
        elif xbmc.getCondVisibility("VideoPlayer.Content(episodes)"):
            dbtype = 'episode'
        elif xbmc.getCondVisibility("VideoPlayer.Content(musicvideos)"):
            dbtype = 'musicvideo'
    if dbtype == "movie":
        method = '"VideoLibrary.GetMovieDetails"'
        param = '"movieid"'
    elif dbtype == "tvshow":
        method = '"VideoLibrary.GetTVShowDetails"'
        param = '"tvshowid"'
    elif dbtype == "episode":
        method = '"VideoLibrary.GetEpisodeDetails"'
        param = '"episodeid"'
    elif dbtype == "musicvideo":
        method = '"VideoLibrary.GetMusicVideoDetails"'
        param = '"musicvideoid"'
    elif dbtype == "song":
        method = '"AudioLibrary.GetSongDetails"'
        param = '"songid"'
    json_query = xbmc.executeJSONRPC('''{ "jsonrpc": "2.0", "method": %s,
                                                            "params": {%s: %d,
                                                            "properties": ["title", "file", "cast"]},
                                                            "id": 1 }''' % (method, param, int(dbid)))
    return json_query
开发者ID:BigNoid,项目名称:service.library.data.provider,代码行数:28,代码来源:data.py


示例14: cacheAllExtras

 def cacheAllExtras(self):
     if not (xbmc.abortRequested or xbmc.getCondVisibility("Window.IsVisible(shutdownmenu)")):
         self.createExtrasCache('GetMovies', Settings.MOVIES, 'movieid')
     if not (xbmc.abortRequested or xbmc.getCondVisibility("Window.IsVisible(shutdownmenu)")):
         self.createExtrasCache('GetTVShows', Settings.TVSHOWS, 'tvshowid')
     if not (xbmc.abortRequested or xbmc.getCondVisibility("Window.IsVisible(shutdownmenu)")):
         self.createExtrasCache('GetMusicVideos', Settings.MUSICVIDEOS, 'musicvideoid')
开发者ID:croneter,项目名称:script.videoextras,代码行数:7,代码来源:service.py


示例15: main

def main():
    if xbmc.getCondVisibility("Container.Content(movies)"):
        xbmc.executebuiltin("RunScript(script.extendedinfo,info=ratemedia,type=movie,dbid=%s,id=%s)" % (xbmc.getInfoLabel("ListItem.DBID"), xbmc.getInfoLabel("ListItem.Property(id)")))
    elif xbmc.getCondVisibility("Container.Content(tvshows)"):
        xbmc.executebuiltin("RunScript(script.extendedinfo,info=ratemedia,type=tv,dbid=%s,id=%s)" % (xbmc.getInfoLabel("ListItem.DBID"), xbmc.getInfoLabel("ListItem.Property(id)")))
    elif xbmc.getCondVisibility("Container.Content(episodes)"):
        xbmc.executebuiltin("RunScript(script.extendedinfo,info=ratemedia,type=episode,tvshow=%s,season=%s)" % (xbmc.getInfoLabel("ListItem.TVShowTitle"), xbmc.getInfoLabel("ListItem.Season")))
开发者ID:phil65,项目名称:context.extendedinfo.ratemedia,代码行数:7,代码来源:addon.py


示例16: get_platform

def get_platform():
    ret = {"arch": sys.maxsize > 2 ** 32 and "x64" or "x86"}
    if xbmc.getCondVisibility("system.platform.android"):
        ret["os"] = "android"
        if "arm" in os.uname()[4]:
            ret["arch"] = "arm"
    elif xbmc.getCondVisibility("system.platform.linux"):
        ret["os"] = "linux"
        uname = platform.uname()[4].lower()
        if "arm" in uname:
            if "armv7" in uname or "aarch64" in uname:
                ret["arch"] = "armv7"
            elif "armv6" in uname:
                ret["arch"] = "armv6"
            else:
                ret["arch"] = "arm"
    elif xbmc.getCondVisibility("system.platform.windows"):
        ret["os"] = "windows"
    elif xbmc.getCondVisibility("system.platform.osx"):
        ret["os"] = "darwin"
    elif xbmc.getCondVisibility("system.platform.ios"):
        ret["os"] = "ios"
        ret["arch"] = "arm"
    ret = get_system(ret)
    return ret
开发者ID:Inter95,项目名称:tutvguia,代码行数:25,代码来源:platform_pulsar.py


示例17: __get_logs

 def __get_logs(self):
     versionNumber=int(xbmc.getInfoLabel("System.BuildVersion" )[0:2])
     if versionNumber < 12:
         if xbmc.getCondVisibility('system.platform.osx'):
             if xbmc.getCondVisibility('system.platform.atv2'): log_path='/var/mobile/Library/Preferences'
             else: log_path=os.path.join(os.path.expanduser('~'),'Library/Logs')
         elif xbmc.getCondVisibility('system.platform.ios'): log_path='/var/mobile/Library/Preferences'
         elif xbmc.getCondVisibility('system.platform.windows'): log_path=xbmc.translatePath('special://home'); log=os.path.join(log_path,'xbmc.log'); logfile=open(log,'r').read()
         elif xbmc.getCondVisibility('system.platform.linux'): log_path=xbmc.translatePath('special://home/temp')
     else: log_path=xbmc.translatePath('special://logpath')
     crashlog_path=None; crashfile_match=None
     if   condtition('system.platform.osx') or condtition('system.platform.ios'): crashlog_path=os.path.join(os.path.expanduser('~'),'Library/Logs/CrashReporter'); crashfile_match='XBMC'
     elif condtition('system.platform.windows'): crashlog_path=log_path; crashfile_match='.dmp'
     elif condtition('system.platform.linux'): crashlog_path=os.path.expanduser('~'); crashfile_match='xbmc_crashlog'
     log=os.path.join(log_path,'xbmc.log'); log_old=os.path.join(log_path,'xbmc.old.log') # get fullpath for xbmc.log and xbmc.old.log
     log_crash=None # check for XBMC crashlogs
     if crashlog_path and crashfile_match:
         crashlog_files=[s for s in os.listdir(crashlog_path)
                           if os.path.isfile(os.path.join(crashlog_path,s))
                           and crashfile_match in s]
         if crashlog_files: crashlog_files=self.__sort_files_by_date(crashlog_path,crashlog_files); log_crash=os.path.join(crashlog_path,crashlog_files[-1]) # we have crashlogs, get fullpath from the last one by time
     found_logs=[]
     if os.path.isfile(log): found_logs.append({'title':'xbmc.log','path':log})
     if not self.skip_oldlog and os.path.isfile(log_old): found_logs.append({'title':'xbmc.old.log','path':log_old})
     if log_crash and os.path.isfile(log_crash): found_logs.append({'title':'crash.log','path':log_crash})
     return found_logs
开发者ID:Alsocogi,项目名称:repository.catoal,代码行数:26,代码来源:upload.py


示例18: installSkin

def installSkin(skin, version):
    if HELIX:
        sourceSkin = skin + '-Helix'
    elif JARVIS:
        sourceSkin = skin + '-Jarvis'
    else:
        return

    src = os.path.join(HOME, 'resources', sourceSkin)
    dst = os.path.join('special://home', 'addons', skin)

    if validateSkin(skin, version):
        return True

    busy = showBusy()

    sfile.copytree(src, dst)

    count = 15 * 10 #15 seconds
    xbmc.executebuiltin('UpdateLocalAddons')

    xbmc.sleep(1000)
    installed = xbmc.getCondVisibility('System.HasAddon(%s)' % skin) == 1 and compareVersions(xbmcaddon.Addon(skin).getAddonInfo('version'), version) >= 0

    while not installed and count > 0:
        count -= 1
        xbmc.sleep(100)
        installed = xbmc.getCondVisibility('System.HasAddon(%s)' % skin) == 1 and compareVersions(xbmcaddon.Addon(skin).getAddonInfo('version'), version) >= 0

    busy.close()

    return installed
开发者ID:TheLivebox,项目名称:TheLiveBox,代码行数:32,代码来源:utils.py


示例19: menu

def menu(handle):
    list = GetHistoryItems()
    total_items = len(list)
    for show_name, name, tvdbid, season, episode in list:
        episode_status_args = ", "+tvdbid+", "+str(season)+", "+str(episode)

        context_items = []
        context_items.append(('Episode List', 'XBMC.Container.Update(plugin://{0}?mode={1}&tvdb_id={2}&show_name={3})'.format(settings.pluginID, 4, tvdbid, urllib.quote_plus(show_name.encode("utf-8")))))
        context_items.append(('Show Info', 'XBMC.Action(Info)'))
        context_items.append(('Open Show Folder', 'XBMC.RunPlugin(plugin://{0}?mode={1}&tvdb_id={2}&show_name={3})'.format(settings.pluginID, 15, tvdbid, urllib.quote_plus(show_name.encode("utf-8")))))
        if xbmc.getCondVisibility('System.HasAddon(script.extendedinfo)'):
            context_items.append(('ExtendedInfo', 'XBMC.RunScript(script.extendedinfo, info=extendedtvinfo, tvdb_id={0})'.format(tvdbid)))
        context_items.append(('Set Episode Status', 'XBMC.RunScript(special://home/addons/{0}/resources/lib/setstatus.py, {1}, {2}, {3})'.format(settings.pluginID, tvdbid, season, episode)))
        context_items.append(('Add New Show', 'XBMC.RunScript(special://home/addons/{0}/resources/lib/addshow.py)'.format(settings.pluginID)))
        if xbmc.getCondVisibility('System.HasAddon(plugin.program.qbittorrent)'):
            context_items.append(('Search qBittorrent', 'XBMC.Container.Update(plugin://plugin.program.qbittorrent?mode=1&keywords={}+S{:02d}E{:02d})'.format(urllib.quote_plus(show_name.encode('utf-8')), int(season), int(episode))))
        context_items.append(('Delete Show', 'XBMC.RunScript(special://home/addons/{0}/resources/lib/deleteshow.py, {1}, {2})'.format(settings.pluginID, tvdbid, show_name)))
        context_items.append(('Force Server Update', 'XBMC.RunScript(special://home/addons/{0}/resources/lib/forcesearch.py, {1})'.format(settings.pluginID, tvdbid)))
        context_items.append(('Update Cache from TVdb', 'XBMC.RunScript(special://home/addons/{0}/resources/lib/cache.py, {1}, {2}, {3})'.format(settings.pluginID, tvdbid, season, episode)))
        context_items.append(('Refresh List', 'XBMC.Container.Refresh'))
        context_items.append(('Go Back', 'XBMC.Action(back)'))
        
        thumbnail_path = Sickbeard.GetShowPoster(tvdbid)
        fanart_path = Sickbeard.GetShowFanArt(tvdbid)
        banner_path = Sickbeard.GetShowBanner(tvdbid)
        addDirectory(handle, show_name, name, tvdbid, season, episode, thumbnail_path, fanart_path, banner_path, total_items, context_items)

    xbmcplugin.addSortMethod(handle=int(handle), sortMethod=xbmcplugin.SORT_METHOD_DATE)
    xbmcplugin.addSortMethod(handle=int(handle), sortMethod=xbmcplugin.SORT_METHOD_VIDEO_SORT_TITLE_IGNORE_THE)
    xbmcplugin.setContent(handle=int(handle), content='tvshows')
    xbmcplugin.endOfDirectory(int(handle))
    common.CreateNotification(header='Show List', message=str(total_items)+' Shows in list', icon=xbmcgui.NOTIFICATION_INFO, time=3000, sound=False)
开发者ID:Hiltronix,项目名称:plugin.video.sickrage,代码行数:32,代码来源:history.py


示例20: _manage_shortcuts

    def _manage_shortcuts( self, group, defaultGroup, nolabels, groupname ):
        homeWindow = xbmcgui.Window( 10000 )
        if homeWindow.getProperty( "skinshortcuts-loading" ) and int( calendar.timegm( gmtime() ) ) - int( homeWindow.getProperty( "skinshortcuts-loading" ) ) <= 5:
            return

        # Get current Super Favourites context menu status
        sfMenu = None
        if xbmc.getCondVisibility( "System.HasAddon(plugin.program.super.favourites)" ):
            sfMenu = xbmcaddon.Addon( "plugin.program.super.favourites" ).getSetting( "CONTEXT" )
            # Set it to disabled
            xbmcaddon.Addon( "plugin.program.super.favourites" ).setSetting( "CONTEXT", "false" )

        homeWindow.setProperty( "skinshortcuts-loading", str( calendar.timegm( gmtime() ) ) )
        import gui
        ui= gui.GUI( "script-skinshortcuts.xml", CWD, "default", group=group, defaultGroup=defaultGroup, nolabels=nolabels, groupname=groupname )
        ui.doModal()
        del ui

        # Reset Super Favourites context menu
        if xbmc.getCondVisibility( "System.HasAddon(plugin.program.super.favourites)" ):
            xbmcaddon.Addon( "plugin.program.super.favourites" ).setSetting( "CONTEXT", sfMenu )        
        
        # Update home window property (used to automatically refresh type=settings)
        homeWindow.setProperty( "skinshortcuts",strftime( "%Y%m%d%H%M%S",gmtime() ) )
        
        # Clear window properties for this group, and for backgrounds, widgets, properties
        homeWindow.clearProperty( "skinshortcuts-" + group )        
        homeWindow.clearProperty( "skinshortcutsWidgets" )        
        homeWindow.clearProperty( "skinshortcutsCustomProperties" )        
        homeWindow.clearProperty( "skinshortcutsBackgrounds" )        
开发者ID:yugimaster,项目名称:script.skinshortcuts,代码行数:30,代码来源:default.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python xbmc.getGlobalIdleTime函数代码示例发布时间:2022-05-26
下一篇:
Python xbmc.getCleanMovieTitle函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap