~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to turbosimpletal/zptsupport.py

mostly more unicode fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
        self.template = template
25
25
        self.filename = filename
26
26
 
27
 
    def __call__(self, **kw):
 
27
    def expand(self, **info):
28
28
        context = simpleTALES.Context(allowPythonPath=1)
29
 
        for k, v in kw.iteritems():
 
29
        for k, v in info.iteritems():
30
30
            context.addGlobal(k, v)
31
31
        s = StringIO.StringIO()
32
 
        self.template.expand(context, s, 'utf-8')
 
32
        self.template.expandInline(context, s)
33
33
        return s.getvalue()
34
34
 
35
35
    @property
84
84
        if self.get_extra_vars:
85
85
            data.update(self.get_extra_vars())
86
86
        data.update(info)
87
 
        return tinstance(**data)
 
87
        return tinstance.expand(**data).encode('utf-8')