當前位置: 首頁>>代碼示例>>Python>>正文


Python xbmc.getSkinDir方法代碼示例

本文整理匯總了Python中xbmc.getSkinDir方法的典型用法代碼示例。如果您正苦於以下問題:Python xbmc.getSkinDir方法的具體用法?Python xbmc.getSkinDir怎麽用?Python xbmc.getSkinDir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在xbmc的用法示例。


在下文中一共展示了xbmc.getSkinDir方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: shutdown_hooks

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import getSkinDir [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

示例2: main_menu

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import getSkinDir [as 別名]
def main_menu():
      addDir('[B]'+translate(30001)+'[/B]',MainURL,10,os.path.join(addonpath,art,'mystreams.png'),2,True)
      if settings.getSetting('addon_history') == "true":
      	addDir('[B]'+translate(30002)+'[/B]',MainURL,8,os.path.join(addonpath,art,'history.png'),2,True)
      	if "confluence" in xbmc.getSkinDir(): addLink('','','plexus')

      addDir('[B][COLOR maroon]'+translate(30003)+'[/COLOR][/B]' + translate(30005),MainURL,4,os.path.join(addonpath,art,'acestream-menu-item.png'),1,False)
      addDir('[B][COLOR maroon]'+translate(30003)+'[/COLOR][/B]' + translate(30006),MainURL,6,os.path.join(addonpath,art,'acestream-menu-item.png'),1,False)

      addDir('[B][COLOR maroon]'+translate(30004)+'[/COLOR][/B]' + translate(30007),MainURL,3,os.path.join(addonpath,art,'sopcast-menu-item.png'),1,False)
      addDir('[B][COLOR maroon]'+translate(30004)+'[/COLOR][/B]' + translate(30008),MainURL,5,os.path.join(addonpath,art,'sopcast-menu-item.png'),1,False)

      #if "confluence" in xbmc.getSkinDir(): addLink('','','plexus')
      #addDir('[B][COLOR maroon]' + translate(40057) + '[/COLOR][/B]',MainURL,300,os.path.join(addonpath,art,'settings.png'),2,True)       
      #break_sopcast is a function used in windows to intentionally break the sopcast.exe setup by renaming one of its codec files. It's ran here to rename the file again in case it failed when played before
      sop.break_sopcast() 
開發者ID:tvaddonsco,項目名稱:program.plexus,代碼行數:18,代碼來源:default.py

示例3: add_list_items

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import getSkinDir [as 別名]
def add_list_items(self, items, content=None, end=True, withNextPage=False):
        TidalSession.add_list_items(self, items, content=content, end=end, withNextPage=withNextPage)
        if end:
            try:
                self.save_album_cache()
                kodiVersion = xbmc.getInfoLabel('System.BuildVersion').split()[0]
                kodiVersion = kodiVersion.split('.')[0]
                skinTheme = xbmc.getSkinDir().lower()
                if 'onfluence' in skinTheme:
                    if kodiVersion <= '16':
                        xbmc.executebuiltin('Container.SetViewMode(506)')
                    elif content == 'musicvideos':
                        xbmc.executebuiltin('Container.SetViewMode(511)')
                    elif content == 'artists':
                        xbmc.executebuiltin('Container.SetViewMode(512)')
                    else:
                        xbmc.executebuiltin('Container.SetViewMode(506)')
                elif 'estuary' in skinTheme:
                    xbmc.executebuiltin('Container.SetViewMode(55)')
            except:
                pass 
開發者ID:arnesongit,項目名稱:plugin.audio.tidal2,代碼行數:23,代碼來源:koditidal2.py

示例4: check_skin_version

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import getSkinDir [as 別名]
def check_skin_version(self):
        '''check if skin changed'''
        try:
            skin = xbmc.getSkinDir()
            skin_addon = xbmcaddon.Addon(id=skin)
            skin_label = skin_addon.getAddonInfo('name').decode("utf-8")
            skin_version = skin_addon.getAddonInfo('version').decode("utf-8")
            this_skin = "%s-%s" % (skin_label, skin_version)
            del skin_addon
            if self.last_skin != this_skin:
                # auto correct skin settings if needed
                self.last_skin = this_skin
                self.win.setProperty("SkinHelper.skinTitle", "%s - %s: %s"
                                     % (skin_label, xbmc.getLocalizedString(19114), skin_version))
                self.win.setProperty("SkinHelper.skin_version", "%s: %s"
                                     % (xbmc.getLocalizedString(19114), skin_version))
                self.win.setProperty("SkinHelper.Version", self.addonversion.replace(".", ""))
                SkinSettings().correct_skin_settings()
        except Exception as exc:
            log_exception(__name__, exc) 
開發者ID:kodi-community-addons,項目名稱:script.skin.helper.service,代碼行數:22,代碼來源:main_service.py

示例5: set_property

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import getSkinDir [as 別名]
def set_property(self):
        # Kodi does not yet allow scripts to ship font definitions
        skin = xbmc.getSkinDir()
        if "estuary" in skin:
            self.setProperty("clockfont", "fontclock")
        elif "zephyr" in skin:
            self.setProperty("clockfont", "fontzephyr")
        elif "eminence" in skin:
            self.setProperty("clockfont", "fonteminence")
        elif "aura" in skin:
            self.setProperty("clockfont", "fontaura")
        elif "box" in skin:
            self.setProperty("clockfont", "box")
        else:
            self.setProperty("clockfont", "fontmainmenu")
        # Set skin properties as settings
        for setting in ["hide-clock-info", "hide-kodi-logo", "hide-weather-info", "hide-pic-info", "hide-overlay", "show-blackbackground"]:
            self.setProperty(setting, kodiutils.get_setting(setting))
        # Set animations
        if kodiutils.get_setting_as_int("animation") == 1:
            self.setProperty("animation","panzoom")
        return 
開發者ID:enen92,項目名稱:screensaver.kaster,代碼行數:24,代碼來源:screensaver.py

示例6: import_skinsettings

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import getSkinDir [as 別名]
def import_skinsettings():
    data = read_from_file()
    if not data:
        log("backup not found")
    progressDialog = xbmcgui.DialogProgress(ADDON_LANGUAGE(32010))
    progressDialog.create(ADDON_LANGUAGE(32010))
    xbmc.sleep(200)
    for count, skinsetting in enumerate(data):
        if progressDialog.iscanceled():
            return
        if skinsetting[1].startswith(xbmc.getSkinDir()):
            progressDialog.update((count * 100) / len(data), ADDON_LANGUAGE(32011) + ' %s' % skinsetting[1])
            setting = skinsetting[1].replace(xbmc.getSkinDir() + ".", "")
            if skinsetting[0] == "string":
                if skinsetting[2] is not "":
                    xbmc.executebuiltin("Skin.SetString(%s,%s)" % (setting, skinsetting[2]))
                else:
                    xbmc.executebuiltin("Skin.Reset(%s)" % setting)
            elif skinsetting[0] == "bool":
                if skinsetting[2]:
                    xbmc.executebuiltin("Skin.SetBool(%s)" % setting)
                else:
                    xbmc.executebuiltin("Skin.Reset(%s)" % setting)
        xbmc.sleep(30)
    xbmcgui.Dialog().ok(ADDON_LANGUAGE(32005), ADDON_LANGUAGE(32009)) 
開發者ID:phil65,項目名稱:script.toolbox,代碼行數:27,代碼來源:Utils.py

示例7: export_skinsettings

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import getSkinDir [as 別名]
def export_skinsettings(filter_label=False):
    s_path = xbmc.translatePath('special://profile/addon_data/%s/settings.xml' % xbmc.getSkinDir()).decode("utf-8")
    if not xbmcvfs.exists(s_path):
        xbmcgui.Dialog().ok(ADDON_LANGUAGE(32007), ADDON_LANGUAGE(32008))
        log("settings.xml not found")
        return None
    log("settings.xml found")
    ls = []
    for count, skinsetting in enumerate(parse(s_path).documentElement.getElementsByTagName('setting')):
        s_id = skinsetting.attributes['id'].nodeValue
        s_type = skinsetting.attributes['type'].nodeValue
        if s_type == "string":
            s_value = xbmc.getInfoLabel("Skin.String(%s)" % s_id)
        else:
            s_value = bool(xbmc.getCondVisibility("Skin.HasSetting(%s)" % s_id))
        if not filter_label or filter_label in s_id:
            ls.append((s_type, s_id, s_value))
    if save_to_file(ls, xbmc.getSkinDir() + ".backup"):
        xbmcgui.Dialog().ok(ADDON_LANGUAGE(32005), ADDON_LANGUAGE(32006)) 
開發者ID:phil65,項目名稱:script.toolbox,代碼行數:21,代碼來源:Utils.py

示例8: set_view

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import getSkinDir [as 別名]
def set_view(view_mode, view_code=0):
    _log("set_view view_mode='"+view_mode+"', view_code="+str(view_code))

    # Set the content for extended library views if needed
    if view_mode==MOVIES:
        _log("set_view content is movies")
        xbmcplugin.setContent( int(sys.argv[1]) ,"movies" )
    elif view_mode==TV_SHOWS:
        _log("set_view content is tvshows")
        xbmcplugin.setContent( int(sys.argv[1]) ,"tvshows" )
    elif view_mode==SEASONS:
        _log("set_view content is seasons")
        xbmcplugin.setContent( int(sys.argv[1]) ,"seasons" )
    elif view_mode==EPISODES:
        _log("set_view content is episodes")
        xbmcplugin.setContent( int(sys.argv[1]) ,"episodes" )

    # Reads skin name
    skin_name = xbmc.getSkinDir()
    _log("set_view skin_name='"+skin_name+"'")

    try:
        if view_code==0:
            _log("set_view view mode is "+view_mode)
            view_codes = ALL_VIEW_CODES.get(view_mode)
            view_code = view_codes.get(skin_name)
            _log("set_view view code for "+view_mode+" in "+skin_name+" is "+str(view_code))
            xbmc.executebuiltin("Container.SetViewMode("+str(view_code)+")")
        else:
            _log("set_view view code forced to "+str(view_code))
            xbmc.executebuiltin("Container.SetViewMode("+str(view_code)+")")
    except:
        _log("Unable to find view code for view mode "+str(view_mode)+" and skin "+skin_name) 
開發者ID:tvalacarta,項目名稱:tvalacarta,代碼行數:35,代碼來源:plugintools.py

示例9: render_items

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import getSkinDir [as 別名]
def render_items(self, type='movies'):
        self.render(content=type)
        skin = xbmc.getSkinDir()
        if(skin == 'skin.confluence' or skin == 'skin.confluence-ploop'):
            xbmc.executebuiltin("Container.SetViewMode(503)")
            #print skin 
開發者ID:evgen-dev,項目名稱:repository.evgen_dev.xbmc-addons,代碼行數:8,代碼來源:common.py

示例10: get_viewmode_id

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import getSkinDir [as 別名]
def get_viewmode_id(parent_item):
    # viewmode_json habria q guardarlo en un archivo y crear un metodo para q el user fije sus preferencias en:
    # user_files, user_movies, user_tvshows, user_season y user_episodes.
    viewmode_json = {'skin.confluence': {'default_files': 50,
                                         'default_movies': 515,
                                         'default_tvshows': 508,
                                         'default_seasons': 503,
                                         'default_episodes': 504,
                                         'view_list': 50,
                                         'view_thumbnails': 500,
                                         'view_movie_with_plot': 503},
                     'skin.estuary': {'default_files': 50,
                                      'default_movies': 54,
                                      'default_tvshows': 502,
                                      'default_seasons': 500,
                                      'default_episodes': 53,
                                      'view_list': 50,
                                      'view_thumbnails': 500,
                                      'view_movie_with_plot': 54}}

    # Si el parent_item tenia fijado un viewmode usamos esa vista...
    if parent_item.viewmode == 'movie':
        # Remplazamos el antiguo viewmode 'movie' por 'thumbnails'
        parent_item.viewmode = 'thumbnails'

    if parent_item.viewmode in ["list", "movie_with_plot", "thumbnails"]:
        view_name = "view_" + parent_item.viewmode

        '''elif isinstance(parent_item.viewmode, int):
            # only for debug
            viewName = parent_item.viewmode'''

    # ...sino ponemos la vista por defecto en funcion del viewcontent
    else:
        view_name = "default_" + parent_item.viewcontent

    skin_name = xbmc.getSkinDir()
    if skin_name not in viewmode_json:
        skin_name = 'skin.confluence'
    view_skin = viewmode_json[skin_name]
    return view_skin.get(view_name, 50) 
開發者ID:alfa-addon,項目名稱:addon,代碼行數:43,代碼來源:platformtools.py

示例11: get_skin_id

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import getSkinDir [as 別名]
def get_skin_id(self):
        return xbmc.getSkinDir() 
開發者ID:Kolifanes,項目名稱:plugin.video.youtube,代碼行數:4,代碼來源:xbmc_context_ui.py

示例12: get_view_mode_id

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import getSkinDir [as 別名]
def get_view_mode_id(self, view_mode):
		view_mode_ids = VIEW_MODES.get(view_mode.lower())
		if view_mode_ids:
			return view_mode_ids.get(xbmc.getSkinDir())
		return None 
開發者ID:a4k-openproject,項目名稱:plugin.video.openmeta,代碼行數:7,代碼來源:xswift2.py

示例13: endDir

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import getSkinDir [as 別名]
def endDir(self, sort=False, content=None, viewMode=None, ps=None):
        '''
        ToDo:
        Check is Confluence, not? other View Mode
        Confluence View Modes:
        http://www.xbmchub.com/forums/general-python-development/717-how-set-default-view-type-xbmc-lists.html#post4683
        https://github.com/xbmc/xbmc/blob/master/addons/skin.confluence/720p/MyVideoNav.xml
        '''
        if ps == None:
            ps = int(sys.argv[1])
        if sort == True:
            xbmcplugin.addSortMethod(ps, xbmcplugin.SORT_METHOD_LABEL)
        canBeContent = ["files", "songs", "artists", "albums", "movies", "tvshows", "episodes", "musicvideos"]
        if content in canBeContent:
            xbmcplugin.setContent(ps, content)
        if viewMode != None:
            viewList = {}
            if 'confluence' in xbmc.getSkinDir():
                viewList = {
                    'List': '50',
                    'Big List': '51',
                    'ThumbnailView': '500',
                    'PosterWrapView': '501',
                    'PosterWrapView2_Fanart': '508',
                    'MediaInfo': '504',
                    'MediaInfo2': '503',
                    'MediaInfo3': '515',
                    'WideIconView': '505',
                    'MusicVideoInfoListView': '511',
                    'AddonInfoListView1': '550',
                    'AddonInfoThumbView1': '551',
                    'LiveTVView1': '560'
                }
            if viewMode in viewList:
                view = viewList[viewMode]
            else:
                view = 'None'
            xbmc.executebuiltin("Container.SetViewMode(%s)" % (view))
        xbmcplugin.endOfDirectory(ps) 
開發者ID:mrknow,項目名稱:filmkodi,代碼行數:41,代碼來源:tvnplayer.py

示例14: set_view

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import getSkinDir [as 別名]
def set_view(view_mode, view_code=0):
    if get_setting('auto-view') == 'true':
        try:
            # Set the content for extended library views if needed
            xbmcplugin.setContent(int(sys.argv[1]), view_mode)
            if view_mode == MOVIES:
                xbmcplugin.setContent(int(sys.argv[1]), "movies")
            elif view_mode == TV_SHOWS:
                xbmcplugin.setContent(int(sys.argv[1]), "tvshows")
            elif view_mode == SEASONS:
                xbmcplugin.setContent(int(sys.argv[1]), "seasons")
            elif view_mode == EPISODES:
                xbmcplugin.setContent(int(sys.argv[1]), "episodes")
            elif view_mode == THUMBNAIL:
                xbmcplugin.setContent(int(sys.argv[1]), "thumbnail")
            elif view_mode == LIST:
                xbmcplugin.setContent(int(sys.argv[1]), "list")
            elif view_mode == SETS:
                xbmcplugin.setContent(int(sys.argv[1]), "sets")
        except:
            pass
        skin_name = xbmc.getSkinDir()  # Reads skin name
        try:
            if view_code == 0:
                view_codes = ALL_VIEW_CODES.get(view_mode)
                # kodi.log(view_codes)
                view_code = view_codes.get(skin_name)
                # kodi.log(view_code)
                xbmc.executebuiltin("Container.SetViewMode(" + str(view_code) + ")")
            # kodi.log("Setting First view code "+str(view_code)+" for view mode "+str(view_mode)+" and skin "+skin_name)
            else:
                xbmc.executebuiltin("Container.SetViewMode(" + str(view_code) + ")")
            # kodi.log("Setting Second view code for view mode "+str(view_mode)+" and skin "+skin_name)
        except:
            # kodi.log("Unable to find view code "+str(view_code)+" for view mode "+str(view_mode)+" and skin "+skin_name)
            pass
        # else:
        # 	xbmc.executebuiltin("Container.SetViewMode(sets)") 
開發者ID:tvaddonsco,項目名稱:plugin.program.indigo,代碼行數:40,代碼來源:viewsetter.py

示例15: save_skin_image

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import getSkinDir [as 別名]
def save_skin_image(self, skinstring="", multi_image=False, header=""):
        '''let the user select an image and save it to addon_data for easy backup'''
        cur_value = xbmc.getInfoLabel("Skin.String(%s)" % skinstring).decode("utf-8")
        cur_value_org = xbmc.getInfoLabel("Skin.String(%s.org)" % skinstring).decode("utf-8")

        if not multi_image:
            # single image (allow copy to addon_data)
            value = xbmcgui.Dialog().browse(2, header, 'files', '', True, True, cur_value_org).decode("utf-8")
            if value:
                ext = value.split(".")[-1]
                newfile = (u"special://profile/addon_data/%s/custom_images/%s.%s"
                           % (xbmc.getSkinDir(), skinstring + time.strftime("%Y%m%d%H%M%S", time.gmtime()), ext))
                if "special://profile/addon_data/%s/custom_images/" % xbmc.getSkinDir() in cur_value:
                    xbmcvfs.delete(cur_value)
                xbmcvfs.copy(value, newfile)
                xbmc.executebuiltin("Skin.SetString(%s.org,%s)" % (skinstring.encode("utf-8"), value.encode("utf-8")))
                value = newfile
        else:
            # multi image
            if not cur_value_org.startswith("$"):
                delim = "\\" if "\\" in cur_value_org else "/"
                curdir = cur_value_org.rsplit(delim, 1)[0] + delim
            else:
                curdir = ""
            value = xbmcgui.Dialog().browse(0, self.addon.getLocalizedString(32005),
                                            'files', '', True, True, curdir).decode("utf-8")
        return value 
開發者ID:kodi-community-addons,項目名稱:script.skin.helper.service,代碼行數:29,代碼來源:skinsettings.py


注:本文中的xbmc.getSkinDir方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。