Re: Problem with embedded Python code blocks
"Will Guaraldi" <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.user |
|---|---|
| Message-ID | <[email protected]> |
The embedded python blocks are a feature of my plugins--they're not something that works in the PyBlosxom core template system. So this would only work for pages being served by wbgwiki, pystaticfile, and pyinclude. Do the examples in the wbgwiki documentation work? /will On 9/6/07, Chris G <[email protected]> wrote: > I can't get embedded python code blocks to work, either in .txt files > or my favourite .rst files. > > When I put something like:- > > ---------start---------- > <% > data = request.getData() > print "This directory is - %s\n" + data["dir"] > %> > ---------end------------ > > in a .rst file what comes out in my browser via pyblosxom is:- > > ---------start---------- > <% > data = request.getData() print "This directory is - %sn" + data["dir"] > > System Message: WARNING/2 (<string>, line 10) > > Definition list ends without a blank line; unexpected unindent. > > %> > ---------end------------ > > (obviously without the start/end bits!) > > > I.e. the parsing is losing the newline and, not surprisingly python > then objects. The same happens whether I put the file in my blog > directory or into my wgbwiki.py wiki directory. > > > If I put the above embedded code into a .txt file in my blog directory > it's simply ignored and comes out exactly as is. > > If I put it as a .txt file in my wgbwiki.py wiki directory I get an > error saying "ERROR in processing: unexpected indent (, line 2)". > > > I think I may be reporting a known error (I've only just come back to > playing with this after a while away), if so - sorry! But I might at > least have provided some more diagnostic information. > > -- > Chris Green ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/