Where and why are you using genshi.XML()? You don't need it in normal TG
usage. If you want to include an already rendered HTML table in a
template, you use Markup().
-- Christoph
--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
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.
AFAIK the latter is a synonym for the former - isn't it?
Diez
-- Christoph
As I read this, I find myself wondering what you're actually testing. The reason I ask is because you're discussing the rendering speed without telling us how you're measuring it.
You could be measuring how long it takes for the HTML to be sent to the browser, *or* how long it takes before the page is viewable by the user. If you're measuring the latter, then I have to point out that the last time I tried to render a table with over a thousand rows, it pretty much choked the browsers entirely. Pagination was required.
If you're measuring how long it takes for the page to be received (for instance, via wget), then yes, there's a whole different question.
For that, double check how your templates are being @expose'd. Make sure that it looks like this:
@expose('chameleon_genshi:dotted.template.name')
and not this:
@expose('genshi:dotted.template.name')
For the Genshi part, I use a lot of <py:def function="myFunctionWithParameters(bla,bla2,bla3...)"></py:def> which are called in loops of loops (that's why, I believe, it's not efficient).
I'm thinking about migrating to Mako if :
* I can't improve genshi performance
* I can't succeed in setting up chameleon.genshi
(I'd like not to migrate to mako as I like the way genshi guarantee the XML strucutre)
On Wed, Jun 29, 2011 at 9:57 AM, Damien Accorsi <damien....@free.fr> wrote:
For the Genshi part, I use a lot of <py:def function="myFunctionWithParameters(bla,bla2,bla3...)"></py:def> which are called in loops of loops (that's why, I believe, it's not efficient).
I'm thinking about migrating to Mako if :
* I can't improve genshi performance
* I can't succeed in setting up chameleon.genshi
(I'd like not to migrate to mako as I like the way genshi guarantee the XML strucutre)
To be sure if ChameleonGenshi is enabled you can check if your app_globals have a chameleon_genshi_loader variable. If they do not have it then you didn't correctly install or enable Chameleon.
AttributeError: 'module' object has no
attribute 'chameleon_genshi_loader'
No, Markup() only marks a string as being for inclusion in the output
without being escaped, which is very quick (no parsing involved), while
XML() parses a string as XML into a markup stream which is much slower.
-- Christoph
You should consider using Genshi's py:def or ToscaWidgets for this.
-- Christoph
Whao. I didn't know that. And should be able to optimize quite a bit of our code in the future ;)
Diez
--
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/-/19cOqYtpiFgJ.
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.
Sorry for rehashing and old thread. When trying to improve the render_genshi function with Alessandro today, we noticed that render_chameleon_genshi was actually the same as render_genshi. On setup the Chameleon.Genshi template loader was in fact imported, but then render_chameleon_genshi used the normal Genshi template loader anyway. That would explain your experience.
Has anybody actually ever used Chameleon.Genshi with TurboGears and knows the state of the project? Seems it has been abandoned and not kept up with the chameleon core. It is also not fully compatible with Genshi, particularly concerning match templates.
As Michael said : "Chameleon.Genshi is old"... it's even not supported anymore. pyramid_chameleon_genshi may replace it, but Chameleon.Genshi itself is dead.
Same reasons why I'm using Genshi. Performance was never an issue for me
- maybe only because my projects are not performance critical anyway and
because database performance is much more important.
-- Christoph
pyramid_chameleon_genshi is actually only a wrapper for Pyramid, it uses
the chameleon.genshi module available in Chameleon < 2, which is a bit
more recent than the old separate chameleon.genshi 1.0b4 that TG2 is
using. Or rather pretends to use, in reality it always used the Genshi
engine. So since chameleon.genshi support never worked anyway, we could
just as well drop it immediately. But I'll try to fix it so that it
works at least with Chameleon < 2 as pyramid_chameleon_genshi is doing.
-- Christoph
--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to turbo...@googlegroups.com.
To unsubscribe from this group, send email to turbogears+unsubscribe@googlegroups.com.
I'm +1 for killing it.
Currently I don't see any reason to use Chameleon Genshi as Kajiki is
similar enough, fast enough and well maintained, so I don't see
reasons to keep it.
I would issue a warning and use genshi renderer even when Chameleon is
enabled for people that already used it (removing it in the successive
release), even thought as it was broken and none complained probably
there is no one out there using it.
I originally worked on this and I stumbled upon problem which was
never fixed in chameleon.genshi: it does not support filters. Which
means you cannot use i18n filters with chameleon.genshi
Apart from this as it was said earlier in this thread it adds the lxml
dependency to TG which is really a hard thing to setup on some
machines if you don't have the proper development tools installed.
Florent
> --
> You received this message because you are subscribed to the Google Groups "TurboGears" group.
> To post to this group, send email to turbo...@googlegroups.com.
> To unsubscribe from this group, send email to turbogears+...@googlegroups.com.
Just talked with Malthe and he said that it's planned to move
chameleon.genshi back into Chameleon 2. So it seems it has a future and
therefore I think we should continue to support Chameleon.Genshi. I have
already fixed the development branch so that it uses the
Chameleon.Genshi in Chameleon 1.3rc1 for the time being instead of the
older chameleon.genshi 1.0b4.
lxml dependency is not such a big problem because we don't require
chameleon.genshi anywhere, that is left to the developer who wants to
replace Genshi with Chameleon.Genshi. The bigger problems are lack of
filters and incompatibilites concerning XPath and MatchTemplate support,
but for people who don't need this it may be acceptable.
So I'm for leaving it in now, just as an option that does no harm, but
not advertizing it until it is ported to Chameleon 2 and improved.
-- Christoph
Just talked with Malthe and he said that it's planned to move chameleon.genshi back into Chameleon 2. So it seems it has a future and therefore I think we should continue to support Chameleon.Genshi. I have already fixed the development branch so that it uses the Chameleon.Genshi in Chameleon 1.3rc1 for the time being instead of the older chameleon.genshi 1.0b
lxml dependency is not such a big problem because we don't require chameleon.genshi anywhere, that is left to the developer who wants to replace Genshi with Chameleon.Genshi. The bigger problems are lack of filters and incompatibilites concerning XPath and MatchTemplate support, but for people who don't need this it may be acceptable.
Had a look into this. The dependency was actually dropped in
chameleon.core 1.0b32 and it now is only needed for MatchTemplates in
Chameleon.Genshi which are somewhat broken or incompatible anyway.
So I have removed lxml from our test_requirements. The test for
cahmeleon.genshi page templates still works, but I skip the test with
master templates when lxml is not installed, because it did not really
work anyway. We can revisit and improve this when Chameleon.Genshi has
been ported to Chameleon 2.
-- Christoph
-- Christoph
--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to turbo...@googlegroups.com.
To unsubscribe from this group, send email to turbogears+unsubscribe@googlegroups.com.
-- Christoph
--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to turbo...@googlegroups.com.
To unsubscribe from this group, send email to turbogears+unsubscribe@googlegroups.com.
I think think this is because Chameleon 1.3rc1 is only available on
PyPI, but PyPI has been blocked for Jenkins. I'll add it to our TG
download files, then it should work again.
-- Christoph
Yes, that was it, and I was also able to remove the lxml installation
from the Jenkins script without breaking it again.
-- Christoph