2018-01-09, 21:42
OK, came up with something like this, just in case
Code:
def _get_skin_resolution(self):
aspect_ratio = xbmc.getInfoLabel('Skin.AspectRatio')
xmlFile = os.path.join(xbmc.translatePath("special://skin/"), "addon.xml")
with open(xmlFile) as f:
xml_file = f.read()
res_extension_point = common.parseDOM(xml_file, 'extension', attrs={'point': 'xbmc.gui.skin'})[0]
res_lines = res_extension_point.splitlines()
try:
skin_resolution = [res for res in res_lines if aspect_ratio in res][0]
except IndexError:
xmldoc = minidom.parse(xmlFile)
res = xmldoc.getElementsByTagName("res")
xval = int(res[0].attributes["width"].value)
yval = int(res[0].attributes["height"].value)
else:
xval = int(re.findall('width="(\d{3,4})"', skin_resolution)[0])
yval = int(re.findall('height="(\d{3,4})"', skin_resolution)[0])
return xval, yval