2018-01-09, 19:37
So I updated the code to something like this:
Its using parsedom instead of minidom and regex pattern. It has been tested.
Code:
def _get_skin_resolution(self):
aspect_ratio = xbmc.getInfoLabel('Skin.AspectRatio')
xml = os.path.join(xbmc.translatePath("special://skin/"), "addon.xml")
with open(xml) 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()
skin_resolution = [res for res in res_lines if aspect_ratio in res][0]
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
Its using parsedom instead of minidom and regex pattern. It has been tested.