template: remove extension from elements while looking for a path:

this way, extension doesn't need to be provided for a CSS file for a single page.
This commit is contained in:
Goffi 2017-11-30 20:58:34 +01:00
commit 6020cae869

View file

@ -299,12 +299,12 @@ class Renderer(object):
def getThemeData(self, template_path):
"""return template data got from template_path
@return tuple(unicde, unicode, bool):
@return tuple(unicode, unicode, bool):
path_elems: elements of the path
theme: theme of the page
is_default: True if the theme is the default theme
"""
path_elems = template_path.split(u'/')
path_elems = [os.path.splitext(p)[0] for p in template_path.split(u'/')]
theme = path_elems.pop(0)
is_default = theme == C.TEMPLATE_THEME_DEFAULT
return (path_elems, theme, is_default)