當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。