Release Banners - (Display ad-banners over full screen video)
#76
So I updated the code to something like this:
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.
Reply


Messages In This Thread
RE: Banners - by misa - 2016-11-28, 12:18
RE: Banners - by docwra - 2016-11-28, 12:27
RE: Banners - by DjBeNI - 2016-11-28, 14:02
RE: Banners - by User 325245 - 2016-11-28, 15:09
RE: Banners - by DjBeNI - 2016-11-28, 18:27
RE: Banners - by User 325245 - 2016-11-28, 20:13
RE: Banners - by DjBeNI - 2016-11-28, 22:07
RE: Banners - by User 325245 - 2016-11-28, 22:47
RE: Banners - by DjBeNI - 2016-11-28, 23:30
RE: Banners - by User 325245 - 2016-11-29, 00:04
RE: Banners - by User 325245 - 2016-11-29, 11:50
RE: Banners - by User 325245 - 2016-11-30, 11:08
RE: Banners - by misa - 2016-12-06, 17:16
RE: Banners - by User 325245 - 2016-12-06, 19:24
RE: Banners - by misa - 2016-12-06, 20:46
RE: Banners - by User 325245 - 2016-12-06, 22:20
RE: Banners - by User 325245 - 2016-12-07, 09:43
RE: Banners - by misa - 2016-12-07, 10:14
RE: Banners - by User 325245 - 2016-12-09, 15:10
RE: Banners - by User 325245 - 2016-12-11, 01:59
RE: Banners - (Display ad-banners over full screen video) - by twilight0 - 2018-01-09, 19:37
Logout Mark Read Team Forum Stats Members Help
Banners - (Display ad-banners over full screen video)1