本文整理匯總了Python中DPH_Singleton.Singleton.getServerFromURL方法的典型用法代碼示例。如果您正苦於以下問題:Python Singleton.getServerFromURL方法的具體用法?Python Singleton.getServerFromURL怎麽用?Python Singleton.getServerFromURL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DPH_Singleton.Singleton
的用法示例。
在下文中一共展示了Singleton.getServerFromURL方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: DPS_MainMenu
# 需要導入模塊: from DPH_Singleton import Singleton [as 別名]
# 或者: from DPH_Singleton.Singleton import getServerFromURL [as 別名]
#.........這裏部分代碼省略.........
params['t_url'] = url + "?type=8"
mainMenuList.append((_("by Artists"), plugin, "artistsEntry", params))
printl("mainMenuList 1: " + str(mainMenuList), self, "D")
#ALBUMS
params = copy.deepcopy(selection[3])
params['t_url'] = url + "?type=9"
mainMenuList.append((_("by Albums"), plugin, "albumsEntry", params))
printl("mainMenuList 2: " + str(mainMenuList), self, "D")
self["menu"].setList(mainMenuList)
self.refreshMenu(0)
printl("mainMenuList: " + str(mainMenuList), self, "D")
printl("", self, "C")
#===========================================================================
#
#===========================================================================
def getSettingsMenuList(self):
printl("", self, "S")
self.nextExitIsQuit = False
self["menu"].setList(self.getSettingsMenu())
self.refreshMenu(0)
printl("", self, "C")
#===========================================================================
#
#===========================================================================
def addSearchString(self, searchString):
printl("", self, "S")
# sample: http://192.168.45.190:32400/search?type=1&query=fringe
serverUrl = self.plexInstance.getServerFromURL(self.s_url)
if searchString is not "" and searchString is not None:
self.s_url = serverUrl + "/search?type=1&query=" + searchString
self.executeSelectedEntry()
printl("", self, "C")
#===========================================================================
# this function starts DP_Lib...
#===========================================================================
def executeSelectedEntry(self):
printl("", self, "S")
printl("self.s_url: " + str(self.s_url), self, "D")
if self.selectedEntry.start is not None:
kwargs = {"url": self.s_url, "uuid": self.uuid, "source": self.source , "viewGroup": self.viewGroup}
if self.showEpisodesDirectly != "notSet":
kwargs["showEpisodesDirectly"] = self.showEpisodesDirectly
self.session.open(self.selectedEntry.start, **kwargs)
elif self.selectedEntry.fnc is not None:
self.selectedEntry.fnc(self.session)
if config.plugins.dreamplex.showFilter.value:
self.selectedEntry = Plugin.MENU_FILTER # we overwrite this now to handle correct menu jumps with exit/cancel button
printl("", self, "C")
#==========================================================================
#
#==========================================================================
def up(self):
printl("", self, "S")
self["menu"].selectPrevious()
printl("", self, "C")
#===========================================================================
#
#===========================================================================
def down(self):
printl("", self, "S")
self["menu"].selectNext()
printl("", self, "C")
#===============================================================================
#
#===============================================================================
def right(self):
printl("", self, "S")
try:
self["menu"].pageDown()
except Exception, ex:
printl("Exception(" + str(type(ex)) + "): " + str(ex), self, "W")
self["menu"].selectNext()
printl("", self, "C")