0.6 version of Genshi really broke things. For example, <py:match
path="fieldset//p[1]"> still selects all paragraphs and not just the
first one in the fieldset. Are there any plans for 0.6.1 bugfix
version? Currently it is really hard to theme Trac. Am I the only one
doing that? ;-)
Mitar
Hello Mitar,
I have a themed Trac instance (0.12.2) [1]. Didn't have any major
problem with genshi 0.6, but perhaps I just didn't hit this bug. The
site.html used to build this custom Trac is on my github [2]
Thanks.
[1] http://dev.wsgid.com/
[2] https://github.com/daltonmatos/wsgid.com/tree/master/trac-custom
--
Dalton Barreto
http://daltonmatos.wordpress.com
http://wsgid.com
Could you post an actual test case? This appears to work for me on
both the 0.6.x branch and the 0.6.0 release in the simple case below:
>>> from genshi.input import XML
>>> doc = XML('''<doc><fieldset><p>Foo</p><p>Bar</p><p>Baz</p></fieldset></doc>''')
>>> list(doc.select("fieldset//p[1]"))
[('START', (QName('p'), Attrs()), (None, 1, 15)), ('TEXT', u'Foo',
(None, 1, 18)), ('END', QName('p'), (None, 1, 21))]
Schiavo
Simon
> Could you post an actual test case? This appears to work for me on
> both the 0.6.x branch and the 0.6.0 release in the simple case below:
I use it in Trac's site.html:
<py:if test="req.environ['PATH_INFO'] == '/register'">
<py:match path="fieldset//p[1]">
<p class="hint">
${select('*|text()')} This information is also used for email
notifications, for example.
</p>
</py:match>
</py:if>
And it is applied to this template:
http://trac-hacks.org/browser/accountmanagerplugin/trunk/acct_mgr/templates/register.html
More specific, it changes both paragraphs:
<p>The email address is required for Trac to send you a verification token.</p>
<p py:if="reset_password_enabled">Entering your email address will
also enable you to reset your password if you ever forget it.</p>
Hm. OK. Now I am not sure anymore if this particular instance worked
in 0.5 version. I am all the time having problems with this one:
http://genshi.edgewall.org/ticket/370
and then am not sure if somebody else is also broken. ;-)
Mitar