genshi loader in TG 2.1.3

35 views
Skip to first unread message

NiL

unread,
Oct 4, 2011, 11:07:33 AM10/4/11
to turbo...@googlegroups.com
Hi all,

In many of my controllers I have the following use case. I need to send xml to other webservices in order to complete my request. So I have implemented something like :
            loader = pylons.config['pylons.app_globals'].genshi_loader
            template = loader.load('ask_prices.html')

in many places. It works fine up to TG2.1b2

but in TG 2.1.3 this breaks

the differences lies in tg.configurations (Line 385)
in setup_genshi_renderer

the new version has been rewritten (mostly a simplification) but it lacks the

config['pylons.app_globals'].genshi_loader = loader

near the end of the method.

for now I subclass AppConfig in app_cfg in order to insert this command

my question is : bug or feature ?

regards

NiL

Alessandro Molina

unread,
Oct 4, 2011, 12:40:47 PM10/4/11
to turbo...@googlegroups.com
Something between a bug and a feature :)
The loaders were there only because the render functions accesses them
through app_globals, now that the genshi renderer doesn't use
app_globals anymore it got removed.

To render templates by hand the render function is exposed and can be used:
tg.render.render({}, 'genshi', 'template_name')

> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/turbogears/-/nA4cnHrJlocJ.
> To post to this group, send email to turbo...@googlegroups.com.
> To unsubscribe from this group, send email to
> turbogears+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/turbogears?hl=en.
>

Julien Tayon

unread,
Oct 4, 2011, 1:08:56 PM10/4/11
to turbo...@googlegroups.com
Removing references to a global is neat. not documenting it would be a
bug if enough resources knew jow to document it.
Is there a note in the changelog regardin this feature ? Else it would
be pretty urban to add it :)

Le 4 oct. 2011 à 18:40, Alessandro Molina
<alessand...@gmail.com> a écrit :

Reply all
Reply to author
Forward
0 new messages