I tried a separate compile step yesterday, but chameleon uses marshal for
recreating the code objects from the .cache files. It also uses compiler and
ast to generate the compiled templates that are stored in a registry once
the app is running. Compiler is OK until it tries to use parser, which is
not included because it can generate code objects. In fact, like Chris says,
any attempt to produce code objects by other means (like new.code()) will
fail with a restricted error.
If Malthe or anyone else has a good idea about how to do this and will give
me some pointers, I'm willing to use my limited abilities to make this work.
Otherwise, I might try to bring in old zpt.
Carlos de la Guardia
On Sun, May 3, 2009 at 8:21 PM, Chris McDonough <chr...@plope.com> wrote:
> On 5/3/09 8:51 PM, Sidnei da Silva wrote:
>> On Sat, May 2, 2009 at 1:53 PM, Carlos de la Guardia
>> <carlos.delaguar...@gmail.com> wrote:
>>> Chameleon.* will not work because it needs to generate code objects and
>>> that's forbidden in GAE (no marshal.py, parser.py or direct calls to
>>> new.code() or similar).
>> I would like to bring up an idea that Paul Everitt had:
>> - What if chameleon supported separate 'compile' and 'execute' steps?
>> 1. Chameleon basically compile templates to Python source code.
>> 2. It is possible to save the generated source code to .py files
>> (CHAMELEON_SOURCE or something in the environment)
>> 3. Therefore, it should be possible to copy the .py files to GAE and
>> have them be executed without recompiling from the .pt file (of course
>> with some changes to chameleon)
> IIRC, the "cache" files in Chameleon aren't just .py files, they hold a
> marshalled code object plus other info in the pickle that Chameleon uses to
> resolve macros (I think). I suspect it's not falling-off-a-log easy as a
> - C
Repoze-dev mailing list