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


Python Singleton.setAccessTokenHeader方法代码示例

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


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

示例1: DPS_ServerMenu

# 需要导入模块: from DPH_Singleton import Singleton [as 别名]
# 或者: from DPH_Singleton.Singleton import setAccessTokenHeader [as 别名]
class DPS_ServerMenu(DPH_Screen, DPH_HorizontalMenu, DPH_ScreenHelper, DPH_Filter, DPH_PlexScreen):

    g_horizontal_menu = False

    selectedEntry = None
    g_serverConfig = None

    g_serverDataMenu = None
    currentService = None
    plexInstance = None
    selectionOverride = None
    secondRun = False
    menuStep = 0  # vaule how many steps we made to restore navigation data
    currentMenuDataDict = {}
    currentIndexDict = {}
    isHomeUser = False

    # ===========================================================================
    #
    # ===========================================================================
    def __init__(self, session, g_serverConfig):
        printl("", self, "S")
        DPH_Screen.__init__(self, session)
        DPH_ScreenHelper.__init__(self)
        DPH_Filter.__init__(self)
        DPH_PlexScreen.__init__(self)

        self.selectionOverride = None
        printl("selectionOverride:" + str(self.selectionOverride), self, "D")
        self.session = session

        self.g_serverConfig = g_serverConfig
        self.plexInstance = Singleton().getPlexInstance()
        self.guiElements = getGuiElements()

        self.initScreen("server_menu")
        self.initMenu()

        if self.g_horizontal_menu:
            self.setHorMenuElements(depth=2)
            self.translateNames()

        self["title"] = StaticText()

        self["menu"] = List(enableWrapAround=True)

        self["actions"] = HelpableActionMap(
            self,
            "DP_MainMenuActions",
            {
                "ok": (self.okbuttonClick, ""),
                "left": (self.left, ""),
                "right": (self.right, ""),
                "up": (self.up, ""),
                "down": (self.down, ""),
                "cancel": (self.cancel, ""),
                "red": (self.onKeyRed, ""),
                "green": (self.onKeyGreen, ""),
            },
            -2,
        )

        self["btn_green"] = Pixmap()
        self["btn_green"].hide()
        self["btn_greenText"] = Label()

        self["text_HomeUserLabel"] = Label()
        self["text_HomeUser"] = Label()

        self.onLayoutFinish.append(self.finishLayout)
        self.onLayoutFinish.append(self.getInitialData)
        self.onLayoutFinish.append(self.checkSelectionOverride)

        printl("", self, "C")

        # ===============================================================================
        #
        # ===============================================================================

    def finishLayout(self):
        printl("", self, "S")

        self.setTitle(_("Server Menu"))

        # first we set the pics for buttons
        self.setColorFunctionIcons()

        if self.miniTv:
            self.initMiniTv()

        if self.g_serverConfig.myplexHomeUsers.value:
            self["btn_green"].show()
            self["btn_greenText"].setText(_("Switch User"))
            self["text_HomeUserLabel"].setText(_("Current User:"))
            currentHomeUser = self.g_serverConfig.myplexCurrentHomeUser.value
            if currentHomeUser != "":
                self["text_HomeUser"].setText(self.g_serverConfig.myplexCurrentHomeUser.value)
                self.plexInstance.setAccessTokenHeader(
                    self.plexInstance.g_currentServer, self.g_serverConfig.myplexCurrentHomeUserAccessToken.value
                )
#.........这里部分代码省略.........
开发者ID:acidangel,项目名称:DreamPlex,代码行数:103,代码来源:DP_ServerMenu.py


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