本文整理汇总了Python中DPH_Singleton.Singleton.getXmlTreeFromUrl方法的典型用法代码示例。如果您正苦于以下问题:Python Singleton.getXmlTreeFromUrl方法的具体用法?Python Singleton.getXmlTreeFromUrl怎么用?Python Singleton.getXmlTreeFromUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DPH_Singleton.Singleton
的用法示例。
在下文中一共展示了Singleton.getXmlTreeFromUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DPS_ServerConfig
# 需要导入模块: from DPH_Singleton import Singleton [as 别名]
# 或者: from DPH_Singleton.Singleton import getXmlTreeFromUrl [as 别名]
#.........这里部分代码省略.........
self.createSetup()
printl("", self, "C")
#===========================================================================
#
#===========================================================================
def keySave(self, stayOpen = False):
printl("", self, "S")
if self.newmode == 1:
config.plugins.dreamplex.entriescount.value += 1
config.plugins.dreamplex.entriescount.save()
#if self.current.machineIdentifier.value == "":
from DP_PlexLibrary import PlexLibrary
self.plexInstance = Singleton().getPlexInstance(PlexLibrary(self.session, self.current))
machineIdentifiers = ""
if self.current.connectionType.value == "2":
xmlResponse = self.plexInstance.getSharedServerForPlexUser()
machineIdentifier = xmlResponse.get("machineIdentifier")
if machineIdentifier is not None:
machineIdentifiers += machineIdentifier
servers = xmlResponse.findall("Server")
for server in servers:
machineIdentifier = server.get("machineIdentifier")
if machineIdentifier is not None:
machineIdentifiers += ", " + machineIdentifier
else:
xmlResponse = self.plexInstance.getXmlTreeFromUrl("http://" + self.plexInstance.g_currentServer)
machineIdentifier = xmlResponse.get("machineIdentifier")
if machineIdentifier is not None:
machineIdentifiers += xmlResponse.get("machineIdentifier")
self.current.machineIdentifier.value = machineIdentifiers
printl("machineIdentifier: " + str(self.current.machineIdentifier.value), self, "D")
config.plugins.dreamplex.entriescount.save()
config.plugins.dreamplex.Entries.save()
config.plugins.dreamplex.save()
configfile.save()
if not stayOpen:
self.close()
printl("", self, "C")
#===========================================================================
#
#===========================================================================
def keyCancel(self):
printl("", self, "S")
if self.newmode == 1:
config.plugins.dreamplex.Entries.remove(self.current)
ConfigListScreen.cancelConfirm(self, True)
printl("", self, "C")
#===========================================================================
#
#===========================================================================
示例2: DPS_ServerConfig
# 需要导入模块: from DPH_Singleton import Singleton [as 别名]
# 或者: from DPH_Singleton.Singleton import getXmlTreeFromUrl [as 别名]
#.........这里部分代码省略.........
self.createSetup()
printl("", self, "C")
#===========================================================================
#
#===========================================================================
def keySave(self):
printl("", self, "S")
if self.newmode == 1:
config.plugins.dreamplex.entriescount.value += 1
config.plugins.dreamplex.entriescount.save()
#if self.current.machineIdentifier.value == "":
from DP_PlexLibrary import PlexLibrary
self.plexInstance = Singleton().getPlexInstance(PlexLibrary(self.session, self.current))
machineIdentifiers = ""
if self.current.connectionType.value == "2":
xmlResponse = self.plexInstance.getSharedServerForPlexUser()
machineIdentifier = xmlResponse.get("machineIdentifier")
if machineIdentifier is not None:
machineIdentifiers += machineIdentifier
servers = xmlResponse.findall("Server")
for server in servers:
machineIdentifier = server.get("machineIdentifier")
if machineIdentifier is not None:
machineIdentifiers += ", " + machineIdentifier
else:
xmlResponse = self.plexInstance.getXmlTreeFromUrl("http://" + str(self.plexInstance.g_host) + ":" + str(self.plexInstance.serverConfig_port))
machineIdentifier = xmlResponse.get("machineIdentifier")
if machineIdentifier is not None:
machineIdentifiers += xmlResponse.get("machineIdentifier")
self.current.machineIdentifier.value = machineIdentifiers
printl("machineIdentifier: " + str(self.current.machineIdentifier.value), self, "D")
if self.current.connectionType.value == "2" or self.current.localAuth.value:
self.keyBlue()
else:
self.saveNow()
printl("", self, "C")
#===========================================================================
#
#===========================================================================
def saveNow(self, retval=None):
printl("", self, "S")
config.plugins.dreamplex.entriescount.save()
config.plugins.dreamplex.Entries.save()
config.plugins.dreamplex.save()
configfile.save()
self.close()
printl("", self, "C")
#===========================================================================
#