changeset 2452:7aa863cbc47f

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.
author Goffi <goffi@goffi.org>
date Thu, 30 Nov 2017 20:58:34 +0100
parents d1153ce68ca0
children 84e84a46b014
files src/tools/common/template.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/tools/common/template.py	Thu Nov 30 20:53:47 2017 +0100
+++ b/src/tools/common/template.py	Thu Nov 30 20:58:34 2017 +0100
@@ -299,12 +299,12 @@
     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)