/usr/lib/python2.7/dist-packages/chameleon/tests/inputs/034-use-template-as-macro.pt.py is in python-chameleon 2.24-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | # -*- coding: utf-8 -*-
pass
import sys as _sys
pass
import re
import functools
_marker = object()
g_re_amp = re.compile('&(?!([A-Za-z]+|#[0-9]+);)')
g_re_needs_escape = re.compile('[&<>\\"\\\']').search
re_whitespace = functools.partial(re.compile('\\s+').sub, ' ')
def render(stream, econtext, rcontext):
append = stream.append
getitem = econtext.__getitem__
get = econtext.get
_i18n_domain = None
re_amp = g_re_amp
re_needs_escape = g_re_needs_escape
decode = getitem('decode')
convert = getitem('convert')
translate = getitem('translate')
# <Expression u"load('032-master-template.pt')" (1:23)> -> _macro
try:
_macro = getitem('load')('032-master-template.pt')
except:
rcontext.setdefault('__error__', []).append((u"load('032-master-template.pt')", 1, 23, '<string>', _sys.exc_info()[1], ))
raise
_macro.include(stream, econtext.copy(), rcontext)
econtext.update(rcontext)
pass
|