本文整理汇总了Python中DPH_Singleton.Singleton.findall方法的典型用法代码示例。如果您正苦于以下问题:Python Singleton.findall方法的具体用法?Python Singleton.findall怎么用?Python Singleton.findall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DPH_Singleton.Singleton
的用法示例。
在下文中一共展示了Singleton.findall方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: registerPlexFonts
# 需要导入模块: from DPH_Singleton import Singleton [as 别名]
# 或者: from DPH_Singleton.Singleton import findall [as 别名]
def registerPlexFonts():
"""
registers fonts for skins
@param: none
@return none
"""
printl2("", "__common__::registerPlexFonts", "S")
printl2("adding fonts", "__common__::registerPlexFonts", "I")
tree = Singleton().getSkinParamsInstance()
#tree = getXmlContent("/usr/lib/enigma2/python/Plugins/Extensions/DreamPlex/skins/" + config.plugins.dreamplex.skins.value +"/params")
for font in tree.findall('font'):
path = str(font.get('path'))
printl2("path: " + str(font.get('path')), "__common__::registerPlexFonts", "D")
size = int(font.get('size'))
printl2("size: " + str(font.get('size')), "__common__::registerPlexFonts", "D")
name = str(font.get('name'))
printl2("name: " + str(font.get('name')), "__common__::registerPlexFonts", "D")
addFont(path, name, size, False)
printl2("added => " + name, "__common__::registerPlexFonts", "I")
printl2("", "__common__::registerPlexFonts", "C")
示例2: getGuiElements
# 需要导入模块: from DPH_Singleton import Singleton [as 别名]
# 或者: from DPH_Singleton.Singleton import findall [as 别名]
def getGuiElements():
printl("", "DP_ViewFactory::getGuiElements", "S")
tree = Singleton().getSkinParamsInstance()
guiElements = {}
for guiElement in tree.findall('guiElement'):
name = str(guiElement.get('name'))
path = str(guiElement.get('path'))
guiElements[name] = path
printl("guiElements: " + str(guiElements), "DP_ViewFactory::getGuiElements", "D")
printl("", "DP_ViewFactory::getGuiElements", "C")
return guiElements
示例3: loadSkinParams
# 需要导入模块: from DPH_Singleton import Singleton [as 别名]
# 或者: from DPH_Singleton.Singleton import findall [as 别名]
def loadSkinParams():
printl2("", "__common__::loadSkinParams", "S")
global skinAuthors
global skinCompatibility
global skinResolution
tree = Singleton().getSkinParamsInstance()
for skinParams in tree.findall('skinParams'):
skinCompatibility = str(skinParams.get('compatibility'))
skinAuthors = str(skinParams.get('skinner'))
skinResolution = str(skinParams.get('resolution'))
printl2("", "__common__::loadSkinParams", "C")
示例4: initMenu
# 需要导入模块: from DPH_Singleton import Singleton [as 别名]
# 或者: from DPH_Singleton.Singleton import findall [as 别名]
def initMenu(self):
printl("", self, "S")
tree = Singleton().getSkinParamsInstance()
for menuScreen in tree.findall('menuScreen'):
name = str(menuScreen.get('name'))
if name == self.screenName:
myType = str(menuScreen.get('type'))
if myType == "horizontal":
self.g_horizontal_menu = True
self.highlightedColor = str(menuScreen.get('highlighted'))
self.normalColor = str(menuScreen.get('normal'))
printl("", self, "C")
示例5: getMiniTvParams
# 需要导入模块: from DPH_Singleton import Singleton [as 别名]
# 或者: from DPH_Singleton.Singleton import findall [as 别名]
def getMiniTvParams(self):
printl("", self, "S")
tree = Singleton().getSkinParamsInstance()
width = 400
height = 225
printl("menuType: " + str(self.menuType), self, "D")
for miniTv in tree.findall('miniTv'):
name = str(miniTv.get('name'))
if name == self.menuType:
width = miniTv.get('width')
height = miniTv.get('height')
printl("width: " + str(width) + " - height: " + str(height), self, "D")
printl("", self, "C")
return int(width), int(height)
示例6: loadSkinParams
# 需要导入模块: from DPH_Singleton import Singleton [as 别名]
# 或者: from DPH_Singleton.Singleton import findall [as 别名]
def loadSkinParams():
printl2("", "__common__::loadSkinParams", "S")
global skinAuthors
global skinCompatibility
global skinResolution
global skinDebugMode
global skinHighlightedColor
global skinNormalColor
tree = Singleton().getSkinParamsInstance()
for skinParams in tree.findall('skinParams'):
skinCompatibility = str(skinParams.get('compatibility'))
skinAuthors = str(skinParams.get('skinner'))
skinResolution = str(skinParams.get('resolution'))
skinDebugMode = str(skinParams.get('debugMode'))
skinHighlightedColor = str(skinParams.get('highlighted'))
skinNormalColor = str(skinParams.get('normal'))
printl2("", "__common__::loadSkinParams", "C")
示例7: initScreen
# 需要导入模块: from DPH_Singleton import Singleton [as 别名]
# 或者: from DPH_Singleton.Singleton import findall [as 别名]
def initScreen(self, screenName):
printl("", self, "S")
tree = Singleton().getSkinParamsInstance()
self.screenName = screenName
for screen in tree.findall('screen'):
name = str(screen.get('name'))
if name == self.screenName:
self.miniTv = translateValues(str(screen.get('miniTv')))
if self.miniTv:
self.width = screen.get('width')
self.height = screen.get('height')
else:
self.Poster= translateValues(str(screen.get('usePoster')))
if self.Poster:
self.width = screen.get('width')
self.height = screen.get('height')
printl("", self, "C")
示例8: getViewsFromSkinParams
# 需要导入模块: from DPH_Singleton import Singleton [as 别名]
# 或者: from DPH_Singleton.Singleton import findall [as 别名]
def getViewsFromSkinParams(myType):
printl("", __name__, "S")
tree = Singleton().getSkinParamsInstance()
availableViewList = []
if myType == "movieView":
myFile = "DP_ViewMovies"
myClass = "DPS_ViewMovies"
defaultParams = getMovieViewDefaults()
elif myType == "showView":
myFile = "DP_ViewShows"
myClass = "DPS_ViewShows"
defaultParams = getShowViewDefaults()
elif myType == "episodeView":
myFile = "DP_ViewShows"
myClass = "DPS_ViewEpisodes"
defaultParams = getEpisodesViewDefaults()
elif myType == "musicView":
myFile = "DP_ViewMusic"
myClass = "DPS_ViewMusic"
defaultParams = getMusicViewDefaults()
else:
raise Exception()
for view in tree.findall(myType):
# lets copy params to new alterable variable
currentParams = copy.deepcopy(defaultParams)
printl("currentParams: " + str(currentParams), __name__, "D")
useMe, subViewDict = getSubViewParams(view)
if useMe:
currentParams["subViews"] = subViewDict
name = str(view.get("name"))
printl("viewMe:" + str(view), __name__, "D")
# settings
settings = defaultParams["settings"]
for setting in settings:
printl("setting:" + str(setting), __name__, "D")
#check if there are params that we have to override
value = view.get(setting, None)
printl("value: " + str(value), __name__, "D")
# check if this value is mandatory
# if we are mandatory we stop here
if defaultParams["settings"][setting] == "mandatory" and value is None:
raise Exception
else:
currentParams["settings"][setting] = translateValues(value)
# override params in the main first = main screen
for main in view.findall("main"):
name = main.get("name")
printl("name: " + str(name), __name__, "D")
params = main.attrib
printl("params: " + str(params), __name__, "D")
for key, value in params.items():
translatedValue = translateValues(value)
if key != "name":
currentParams["elements"][name][key] = translatedValue
view = (_(name), myFile, myClass, currentParams)
availableViewList.append(view)
printl("availableViewList: " + str(availableViewList), __name__, "D")
printl("", __name__, "C")
return availableViewList
示例9: getViewsFromSkinParams
# 需要导入模块: from DPH_Singleton import Singleton [as 别名]
# 或者: from DPH_Singleton.Singleton import findall [as 别名]
def getViewsFromSkinParams(myType):
printl("", "DP_ViewFactory::getViewsFromSkinParams", "S")
tree = Singleton().getSkinParamsInstance()
availableViewList = []
if myType == "movieView":
myFile = "DP_ViewMovies"
defaultParams = getMovieViewDefaults()
elif myType == "mixedView":
myFile = "DP_ViewMixed"
defaultParams = getMovieViewDefaults()
# todo maybe we extend for our own definition
# we rewrite to movieView because we use it for now as reference
myType = "movieView"
elif myType == "showView":
myFile = "DP_ViewShows"
defaultParams = getShowViewDefaults()
elif myType == "musicView":
myFile = "DP_ViewMusic"
defaultParams = getMusicViewDefaults()
else:
raise Exception()
for view in tree.findall(myType):
# lets copy params to new alterable variable
currentParams = copy.deepcopy(defaultParams)
#printl("currentParams: " + str(currentParams), __name__, "D")
useMe, subViewDict = getSubViewParams(view)
if useMe:
currentParams["subViews"] = subViewDict
name = str(view.get("name"))
printl("viewMe:" + str(view), "DP_ViewFactory::getViewsFromSkinParams", "D")
# settings
settings = defaultParams["settings"]
for setting in settings:
printl("setting:" + str(setting), "DP_ViewFactory::getViewsFromSkinParams", "D")
#check if there are params that we have to override
value = view.get(setting, None)
printl("value: " + str(value), "DP_ViewFactory::getViewsFromSkinParams", "D")
# check if this value is mandatory
# if we are mandatory we stop here
if defaultParams["settings"][setting] == "mandatory" and value is None:
raise Exception
else:
currentParams["settings"][setting] = translateValues(value)
view = (name, myFile, currentParams)
availableViewList.append(view)
#printl("availableViewList: " + str(availableViewList), __name__, "D")
printl("", "DP_ViewFactory::getViewsFromSkinParams", "C")
return availableViewList
示例10: getViewsFromSkinParams
# 需要导入模块: from DPH_Singleton import Singleton [as 别名]
# 或者: from DPH_Singleton.Singleton import findall [as 别名]
def getViewsFromSkinParams(myType):
printl("", "DP_ViewFactory::getViewsFromSkinParams", "S")
tree = Singleton().getSkinParamsInstance()
availableViewList = []
if myType == "movieView":
myFile = "DP_ViewMovies"
defaultParams = getMovieViewDefaults()
elif myType == "mixedView":
myFile = "DP_ViewMixed"
defaultParams = getMovieViewDefaults()
# todo maybe we extend for our own definition
# we rewrite to movieView because we use it for now as reference
myType = "movieView"
elif myType == "showView":
myFile = "DP_ViewShows"
defaultParams = getShowViewDefaults()
elif myType == "musicView":
myFile = "DP_ViewMusic"
defaultParams = getMusicViewDefaults()
else:
raise Exception
for view in tree.findall(myType):
# lets copy params to new alterable variable
currentParams = copy.deepcopy(defaultParams)
#printl("currentParams: " + str(currentParams), __name__, "D")
useMe, subViewDict = getSubViewParams(view)
if useMe:
currentParams["subViews"] = subViewDict
name = str(view.get("name"))
printl("viewMe:" + str(view), "DP_ViewFactory::getViewsFromSkinParams", "D")
# settings
settings = defaultParams["settings"]
for setting in settings:
printl("setting:" + str(setting), "DP_ViewFactory::getViewsFromSkinParams", "D")
#check if there are params that we have to override
value = view.get(setting, None)
printl("value: " + str(value), "DP_ViewFactory::getViewsFromSkinParams", "D")
# check if this value is mandatory
# if we are mandatory we stop here
if defaultParams["settings"][setting] == "mandatory" and value is None:
skinDebugMode = translateValues(getSkinDebugMode())
if config.plugins.dreamplex.skin.value != "default" and not skinDebugMode:
config.plugins.dreamplex.skin.value = "default"
config.plugins.dreamplex.skin.save()
configfile.save()
Notifications.AddNotification(MessageBox, "DreamPlex crashed due to a skin error!\nSwitching back to default in settings.\n", type=MessageBox.TYPE_INFO, timeout=10)
else:
printl("this value: " + str(value) + "is misssing ....", "DP_ViewFactory::getViewsFromSkinParams", "D")
raise Exception
else:
currentParams["settings"][setting] = translateValues(value)
view = (name, myFile, currentParams)
availableViewList.append(view)
#printl("availableViewList: " + str(availableViewList), __name__, "D")
printl("", "DP_ViewFactory::getViewsFromSkinParams", "C")
return availableViewList