Hi there,

As I am new to this list, I hope you can forbear with me if my subject
is off-topic.

I am currently maintaining the megrok.chameleon package hosted on
zope.org. It makes, of course, heavy use of Chameleon and also uses
z3c.pt as intermediate layer for the more Zope-related bindings.

While trying to make megrok.chameleon compatible with zopetoolkit and
groktoolkit package versions, I noticed that latest z3c.pt (1.1.0) and
trunk are not completely compatible with Chameleon >= 1.1.0. The tests

I tried to fix it and it turned out, that compatibility problems result
from different code generated by chameleon.core.codegen.Suite (while
evaluating expressions in templates).

For instance for the following input code (source)::

    result = _path(options, request, True, 'test')

Chameleon 1.0.8 (codegen.Suite) generates::

    result = _path(options, request, True, 'test')

while Chameleon 1.1.2 generates for the same input::

    result = econtext['econtext']['_path'](
               econtext['econtext']['request'], True, 'test')

I could deliver more samples like this, but I think here are enough
people that know what I am talking about. Apparently the used AST
parsers, transformers and generators deliver different code for the same
input compared with former versions of Chameleon.

This means that when executing the generated code, one has to make sure
that the used locals are setup differently: econtext['econtext'] must
exist to make the generated code work.

That's fine with me, but I'd like to know whether this is really wanted
(I mean ``econtext['econtext']`` looks a bit redundant) and if so, where
code generated by chameleon.core.codegen.Suite expects to find the local
symbols. Is it always ``econtext['econtext']``? Could there possibly be
something expected in ``econtext`` beside the other ``econtext`` dict?
The complete AST parser/transformer/generator code was a bit too much
for me right now, so I kindly ask for advice/hints from people that are
much more into it :-)

Also hints, where I could look for docs would be highly appreciated.

Kind regards,


Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

Repoze-dev mailing list

Reply via email to