-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

just working on performance issues reported for the TagsPlugin [1][2].

IMHO one of the most important things would be a pager for ListTagged()
macro results. While I have it running nicely on the '/tags' page that
uses the macro to present TagsQuery results, I hit a problem when
executing same code on wiki pages for the wiki macro itself. And that's
why I'm seeking advice here.

Even the output of the wiki per-renderer (side-by-side mode) is fine.
Only displaying the wiki page itself returns following error:

  File
"/usr/local/lib/python2.6/dist-packages/Trac-0.13dev-py2.6.egg/trac/templates/layout.html",
line 42, in <Expression u"iter(chrome.late_links.get('stylesheet'))">
    <py:for each="link in chrome.late_links.get('stylesheet')">
TypeError: 'NoneType' object is not iterable

I re-use the pager implemented in Trac core i.e. for TicketQuery. To
reduce code-duplication I included 'ticket/page_index.html', a Trac
template used for top and bottom page navigation links of the pager into
my 'listtagged_results.html', a HTML fragment template similar to
'ticket/query_results.html'. Now it seems like exactly the 'next' and
'last' links added via add_link() are not expected by the tiny code
snippet in layout.html, from where the SystemError originates. It
expects, that there is always a stylesheet, if chrome['late_links'] is
not empty ...

Btw, earlier I made a set of Genshi instructions to build the equivalent
of 'ticket/page_index.html' directly in expand_macro() - same problem.

I've been checking other uses of trac.util.presentation.Paginator and
Chrome.render_template(), but while they exist I think this use case is
special, because no one else seems to use a Paginator instance for wiki
macro output. Did I miss something, or is this a real bug? Advise,
comments and suggestions welcome.

As a side-note: Did someone think about adding the pager to TicketQuery
macro before?

Sincerely,

Steffen Hoffmann
(hasienda)


[1] http://trac-hacks.org/wiki/TagsPlugin/
[2] http://trac-hacks.org/ticket/4503
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6KGlMACgkQ31DJeiZFuHdD+wCfXYSWlqVfboOkuxiTaY8C2Dv5
m7cAoNw3Mni/3LLotYOmn5TTCeZbpGdK
=Y2i/
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en.

Reply via email to