/
mako_inherits.mak.py
50 lines (44 loc) · 1.49 KB
/
mako_inherits.mak.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 5
_modified_time = 1239703766.6010649
_template_filename='tg/test_stack/rendering/templates/mako_inherits.mak'
_template_uri='mako_inherits.mak'
_template_cache=cache.Cache(__name__, _modified_time)
_source_encoding='utf-8'
from webhelpers.html import escape
_exports = ['head_tags']
def _mako_get_namespace(context, name):
try:
return context.namespaces[(__name__, name)]
except KeyError:
_mako_generate_namespaces(context)
return context.namespaces[(__name__, name)]
def _mako_generate_namespaces(context):
pass
def _mako_inherit(template, context):
_mako_generate_namespaces(context)
return runtime._inherit_from(context, '/mako_base.mak', _template_uri)
def render_body(context,**pageargs):
context.caller_stack._push_frame()
try:
__M_locals = __M_dict_builtin(pageargs=pageargs)
__M_writer = context.writer()
# SOURCE LINE 2
__M_writer(u'\n\n')
# SOURCE LINE 6
__M_writer(u'\n\n<h1>New Page</h1>\n\n<p>inherited mako page</p>')
return ''
finally:
context.caller_stack._pop_frame()
def render_head_tags(context):
context.caller_stack._push_frame()
try:
__M_writer = context.writer()
# SOURCE LINE 4
__M_writer(u'\n <!-- add some head tags here -->\n')
return ''
finally:
context.caller_stack._pop_frame()