[ANN] Genshi 0.6 released

21 views
Skip to first unread message

Christopher Lenz

unread,
Apr 22, 2010, 1:24:06 PM4/22/10
to gen...@googlegroups.com, trac...@googlegroups.com
Genshi 0.6 - Apr 22, 2010
=========================

At long last, the latest release of Genshi is here: 0.6

Genshi is a Python library that provides an integrated set of
components for parsing, generating, and processing HTML, XML or
other textual content for output generation on the web. The major
feature is a template language.

This release contains a large number of improvements and bugfixes
over the 0.5.1 release.


You can download the new release here:

<http://genshi.edgewall.org/wiki/Download>

Please don't hesitate to report any issues you may find with this
release:

<http://genshi.edgewall.org/newticket>

For questions, comments and user discussions, please use the Genshi
mailing list:

<http://genshi.edgewall.org/wiki/MailingList>


What's New:
-----------
* Support for Python 2.3 has been dropped.
* Rewrite of the XPath evaluation engine for better performance and
improved correctness. This is the result of integrating work done by
Marcin Kurczych during GSoC 2008.
* Updated the Python AST processing for template code evaluation to use
the `_ast` module instead of the deprecated `compiler` package,
including an adapter layer for Python 2.4. This, too, is the result of
integrating work done by Marcin Kurczych during GSoC 2008.
* Added caching in the serialization stage for improved performance in
some cases.
* Various improvements to the HTML sanitization filter.
* Fix problem with I18n filter that would get confused by expressions
in attribute values when inside an `i18n:msg` block (ticket #250).
* Fix problem with the transformation filter dropping events after the
selection (ticket #290).
* `for` loops in template code blocks no longer establish their own
locals scope, meaning you can now access variables assigned in the loop
outside of the loop, just as you can in regular Python code
(ticket #259).
* Import statements inside function definitions in template code blocks
no longer result in an UndefinedError when the imported name is
accessed (ticket #276).
* Fixed handling of relative URLs with fragment identifiers containing
colons in the `HTMLSanitizer` (ticket #274).
* Added an option to the `HTMLFiller` to also populate password fields.
* Match template processing no longer produces unwanted duplicate
output in some cases (ticket #254).
* Templates instantiated without a loader now get an implicit loader
based on their file path, or the current directory as a fallback
(ticket #320).
* Added documentation for the `TemplateLoader`.
* Enhanced documentation for internationalization.


Acknowledgments
---------------
A big thank you to everyone who tried Genshi and provided feedback,
reported bugs, and/or contributed patches!


Apologies
---------

I'm sorry that this has taken so long, and that I've been so very
unresponsive for such a long time. To be honest, this release is the
result of the Trac team putting sufficient "pressure" on me to get
finally it out of the door.

But I do want to make it clear that I still believe Genshi is a great
project that I do look forward to continue working on after this
release. There's still lots to do, and still big and interesting
challenges ahead. Right now, I'm more motivated than ever to push
things forward for Genshi.


Cheers,
--
Christopher Lenz
cml...@gmail.com
http://www.cmlenz.net/

--
You received this message because you are subscribed to the Google Groups "Genshi" group.
To post to this group, send email to gen...@googlegroups.com.
To unsubscribe from this group, send email to genshi+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/genshi?hl=en.

Christoph Zwerschke

unread,
Apr 22, 2010, 2:26:04 PM4/22/10
to gen...@googlegroups.com
Am 22.04.2010 19:24 schrieb Christopher Lenz:
> But I do want to make it clear that I still believe Genshi is a great
> project that I do look forward to continue working on after this
> release. There's still lots to do, and still big and interesting
> challenges ahead. Right now, I'm more motivated than ever to push
> things forward for Genshi.

That's good to hear. Genshi is indeed a great project, and used not only
by Trac, but also by TurboGears and a couple of other projects.

Thanks a lot for all your work so far!

-- Christoph

Elver Loho

unread,
Apr 22, 2010, 4:00:13 PM4/22/10
to gen...@googlegroups.com
This is the best news I've heard all day.
Thank you, everyone involved in making this possible, for continuing
to develop the best templating engine Python has to offer!

Best,
Elver

Nicholas Dudfield

unread,
Apr 22, 2010, 8:24:11 PM4/22/10
to gen...@googlegroups.com
Congrats :)

I dig Genshi. Nice work.

Arc Riley

unread,
Apr 22, 2010, 8:31:35 PM4/22/10
to gen...@googlegroups.com

Did the Python 3 bits get into this release?

On Apr 22, 2010 8:24 PM, "Nicholas Dudfield" <ndud...@gmail.com> wrote:

Congrats :)

I dig Genshi. Nice work.



--
You received this message because you are subscribed to the Google Groups "Genshi" group.

To p...

Jeroen Ruigrok van der Werven

unread,
Apr 23, 2010, 1:33:33 AM4/23/10
to gen...@googlegroups.com
-On [20100423 03:22], Arc Riley (arcr...@gmail.com) wrote:
>Did the Python 3 bits get into this release?

For all I am aware of, no.

--
Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org> / asmodai
イェルーン ラウフロック ヴァン デル ウェルヴェン
http://www.in-nomine.org/ | http://www.rangaku.org/ | GPG: 2EAC625B
A wise man that walks in the dark with a blindfold on, is not much of a
wise man...

jerry

unread,
Apr 23, 2010, 5:14:03 AM4/23/10
to Genshi
Thank you for the great work.

It's really encouraging to know that Genshi is being actively
maintained and developed.

Jerry

Christopher Lenz

unread,
Apr 23, 2010, 1:26:25 PM4/23/10
to gen...@googlegroups.com
On 23.04.2010, at 02:31, Arc Riley wrote:
> Did the Python 3 bits get into this release?

No. What I did a while back was to eliminate a few -3 warnings, generally get the code base ready to be translated via 2to3, and reduce the amount of changes produced by the conversion. However, there remains a bit of work to do until there's a release that runs on Py3k. The main thing will be finding a sane process to maintain the divergent code bases (if necessary), and distribute the future releases.

I'll need to look into what e.g. Distribute offers in this regard, and whether it could be used here.

Cheers,
--
Christopher Lenz
cml...@gmail.com
http://www.cmlenz.net/

Arc Riley

unread,
Apr 23, 2010, 1:49:33 PM4/23/10
to gen...@googlegroups.com
I've been using Genshi on Py3.

Distutils has support for running 2to3 during install

Nicholas Dudfield

unread,
Apr 25, 2010, 3:45:44 AM4/25/10
to gen...@googlegroups.com
This is why I love Genshi in particular and xml based templating libs in
general:

http://blogdata.akalias.net/genshi-templating-ftw/genshi-templating-ftw.html

Jon Nelson

unread,
Apr 25, 2010, 3:06:36 PM4/25/10
to gen...@googlegroups.com
On Sun, Apr 25, 2010 at 2:45 AM, Nicholas Dudfield <ndud...@gmail.com> wrote:
> This is why I love Genshi in particular and xml based templating libs in
> general:
>
> http://blogdata.akalias.net/genshi-templating-ftw/genshi-templating-ftw.html

Can you explain more about how that worked?

--
Jon

Yuen Ho Wong

unread,
Apr 25, 2010, 3:37:30 PM4/25/10
to Genshi
I noticed the latest release has set the --without-speedups flag by
default instead of the old behavior of always building with speedups.
Is there a reason for this? If I really want the c-extension speedups,
how do I turn it on when I'm installing via easy_install?

Thanks

Nicholas Dudfield

unread,
Apr 26, 2010, 1:03:10 AM4/26/10
to gen...@googlegroups.com
On 26/04/2010 5:06 AM, Jon Nelson wrote:
> On Sun, Apr 25, 2010 at 2:45 AM, Nicholas Dudfield<ndud...@gmail.com> wrote:
>
>> This is why I love Genshi in particular and xml based templating libs in
>> general:
>>
>> http://blogdata.akalias.net/genshi-templating-ftw/genshi-templating-ftw.html
>>
> Can you explain more about how that worked?
>

Sure thing :)

It uses Genshi's TemplateLoader feature where you can pass a callable to
the searchpath argument.

Instead of just reading the template from disk it first does some
pre-processing.

Via a combination of a regular expression and the lxml feed/target
parser API it builds a character (not byte)
accurate mapping of elements to corresponding buffer regions. This is
very easy because of Genshi's
perfectly valid and consistent xml buddha nature.

It then re-serializes the xml but with embedded "edrowcol" attributes.

It uses some heuristics to determine the "root" nodes in light of
py:strip, xi:include etc. These generally
work well enough that the code doesn't have to be littered with
"sourcefile" attributes in every single
node.

As for how the ctrl+click works, it's a small bit of JQuery code which
walks up from the clicked on
node until it finds a parent with rowcolumn and/or sourcefile attributes.

It creates an invisible iframe with a src attribute referring to
editor://$sourcefile:$row:$col and I have
a small C program that decodes the url and calls the editor.

I'm going to add a feature where the "searchpath" callable will first
open a socket to $editor_of_choice
for a "live" buffer and if the file is both open in your editor and the
"active view" it will embed an attribute
like "edselected" for the node corresponding to the cursor[s]

Upon load (or whatever similar AJAXy type event) it will use javascript
to scroll to the current node
and possibly add a red border around it.

I can post the code to BitBucket at some point if you want. It requires
lxml.

Jeroen Ruigrok van der Werven

unread,
Apr 26, 2010, 4:07:30 AM4/26/10
to gen...@googlegroups.com
-On [20100423 19:26], Christopher Lenz (cml...@gmail.com) wrote:
>I'll need to look into what e.g. Distribute offers in this regard, and
>whether it could be used here.

http://packages.python.org/distribute/python3.html

In essence, add use_2to3 = True to setup.py's setup().

--
Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org> / asmodai
イェルーン ラウフロック ヴァン デル ウェルヴェン
http://www.in-nomine.org/ | http://www.rangaku.org/ | GPG: 2EAC625B
A wise man that walks in the dark with a blindfold on, is not much of a
wise man...

Jeroen Ruigrok van der Werven

unread,
Apr 26, 2010, 4:56:54 AM4/26/10
to gen...@googlegroups.com
-On [20100425 21:37], Yuen Ho Wong (wyu...@gmail.com) wrote:
>I noticed the latest release has set the --without-speedups flag by
>default instead of the old behavior of always building with speedups.
>Is there a reason for this?

When I asked Chris about it, when I was rolling the Windows sdist and
wininst he mentioned something like 5% performance increase not being worth
the bother for the majority of people.

>If I really want the c-extension speedups, how do I turn it on when I'm
>installing via easy_install?

I don't think it's possible at this point. At least not from what I
understood when I asked Tarek Ziade about it.

Pip, however, has an --install-options=, but I am as of yet unable to make
it work how I want it.

--
Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org> / asmodai
イェルーン ラウフロック ヴァン デル ウェルヴェン
http://www.in-nomine.org/ | http://www.rangaku.org/ | GPG: 2EAC625B
A wise man that walks in the dark with a blindfold on, is not much of a
wise man...

Reply all
Reply to author
Forward
Message has been deleted
0 new messages