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
fail.

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)::

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

Chameleon 1.0.8 (codegen.Suite) generates::

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

while Chameleon 1.1.2 generates for the same input::

    'options/test'
    result = econtext['econtext']['_path'](
               econtext['econtext']['options'], 
               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,

-- 
Uli

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

_______________________________________________
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Reply via email to