# # # patch "ChangeLog" # from [f34b17ee11bc3e45697bedd83d8c65c7a76bd42c] # to [1bf6da6b5a52e7da85c177513fb13da90c0fdce3] # # patch "web/cheetah.py" # from [264c19ddc664f70dd676c87f7c0987e2aec3d037] # to [ab65745d18b89fb4df5699b0a0034a215f4ead79] # ============================================================ --- ChangeLog f34b17ee11bc3e45697bedd83d8c65c7a76bd42c +++ ChangeLog 1bf6da6b5a52e7da85c177513fb13da90c0fdce3 @@ -1,5 +1,11 @@ 2008-01-13 Grahame Bowland + * merge Roland's patch back into the new web.py + and add a fall-back in case it can't find + templates_directory in the config file. + +2008-01-13 Grahame Bowland + * get ViewMTN's tar export mode working with Python 2.5's tarfile module, which requires the "name" argument ============================================================ --- web/cheetah.py 264c19ddc664f70dd676c87f7c0987e2aec3d037 +++ web/cheetah.py ab65745d18b89fb4df5699b0a0034a215f4ead79 @@ -11,6 +11,10 @@ from webapi import ctx, header, output, from utils import re_compile, memoize, dictadd from net import htmlquote, websafe from webapi import ctx, header, output, input, cookies, loadhooks +try: + from viewmtn.config import templates_directory +except: + templates_directory='./templates/' def upvars(level=2): """Guido van Rossum sez: don't use this function.""" @@ -23,10 +27,10 @@ def __compiletemplate(template, base=Non if isString: text = template else: - text = open('templates/'+template).read() + text = open(templates_directory+template).read() # implement #include at compile-time def do_include(match): - text = open('templates/'+match.groups()[0]).read() + text = open(templates_directory+match.groups()[0]).read() return text while r_include.findall(text): text = r_include.sub(do_include, text)