Changeset 10607 for main/waeup.cas/trunk/waeup/cas/server.py
- Timestamp:
- 10 Sep 2013, 14:59:40 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.cas/trunk/waeup/cas/server.py
r10605 r10607 176 176 177 177 def get_template(name): 178 """Read template named `name`. 179 180 Templates are looked up in the local `templates` dir. 181 182 In the result any 'PART_HEADER' and 'PART_FOOTER' parts are 183 replaced by the respective templates. 184 185 Returns the HTML template. 186 """ 178 187 path = os.path.join(template_dir, name) 179 188 if os.path.isfile(path): 180 return open(path, 'r').read() 189 html = open(path, 'r').read() 190 html = html.replace( 191 'PART_HEADER', 192 open(os.path.join(template_dir, 'part_header.tpl'), 'r').read()) 193 html = html.replace( 194 'PART_FOOTER', 195 open(os.path.join(template_dir, 'part_footer.tpl'), 'r').read()) 196 return html 181 197 return None 182 198 … … 293 309 294 310 def _get_template(self, name): 295 path = os.path.join(template_dir, name) 296 if os.path.isfile(path): 297 return open(path, 'r').read() 298 return None 311 return get_template(name) 299 312 300 313 def login(self, req):
Note: See TracChangeset for help on using the changeset viewer.