Edgewall Software

Changes between Version 44 and Version 45 of GenshiFaq


Ignore:
Timestamp:
Sep 3, 2010, 6:37:39 PM (14 years ago)
Author:
anatoly techtonik <techtonik@…>
Comment:

ugly hack how to duplicate stream

Legend:

Unmodified
Added
Removed
Modified
  • GenshiFaq

    v44 v45  
    207207If you get an error message like the following {{{TemplateSyntaxError: unbound prefix: line .., column .. (template.html, line ..)}}} with an XML document, you most likely forgot to add the proper namespace to the document. Simply adding {{{xmlns:py="http://genshi.edgewall.org/"}}} should resolve this issue.
    208208
     209=== How can I duplicate a Stream without depleting it (e.g. for debug)? ===
     210
     211When you query stream it depletes. This is highly annoying during development. Here is how you can duplicate it:
     212{{{
     213#!python
     214stream = Stream(list(stream))
     215}}}
     216Note that if you rename left `stream` to `streamdbg` or something - this won't work anymore.
     217
    209218----
    210219See also: [wiki:Documentation], GenshiRecipes