32
29
self.options = options
34
31
def __getitem__(self, name):
35
tpl = zpt(os.path.join(self.base, name))
36
return tpl(**self.options)
32
return zpt(os.path.join(self.base, name))(**self.options)
38
34
class PageTemplate(pagetemplatefile.PageTemplateFile):
39
35
def __init__(self, name):
40
base = os.path.dirname(sys._getframe(1).f_globals["__file__"])
42
self.fullpath = os.path.join(base, self.name)
43
self.base = os.path.dirname(self.fullpath)
44
pagetemplatefile.PageTemplateFile.__init__(self, self.fullpath)
36
self.base = os.path.dirname(name)
37
pagetemplatefile.PageTemplateFile.__init__(self, name)
46
39
def pt_getContext(self, args=(), options={}, **ignored):
47
rval = pagetemplatefile.PageTemplateFile.pt_getContext(self, args, options, **ignored)
49
rval.update({'here':Here(self.base, options), 'template':self})
40
rval = pagetemplatefile.PageTemplateFile.pt_getContext(
41
self, args, options, **ignored)
43
rval.update({'here':Here(self.base, options)})