comparison MoinMoin/wikiutil.py @ 1748:dc0db3897437

StringIO operation moved from FootNote to wikiutil.executeText
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sat, 20 Jan 2007 22:29:31 +0100
parents fdf01f9f3143
children 3567062fc66f
comparison
equal deleted inserted replaced
1747:b7e0a36a1219 1748:dc0db3897437
1 # -*- coding: iso-8859-1 -*- 1 # -*- coding: iso-8859-1 -*-
2 """ 2 """
3 MoinMoin - Wiki Utility Functions 3 MoinMoin - Wiki Utility Functions
4 4
5 @copyright: 2000 - 2004 by Jürgen Hermann <jh@web.de> 5 @copyright: 2000 - 2004 by Jürgen Hermann <jh@web.de>
6 @copyright: 2007 Reimar Bauer
6 @license: GNU GPL, see COPYING for details. 7 @license: GNU GPL, see COPYING for details.
7 """ 8 """
8 9
9 import cgi 10 import cgi
10 import codecs 11 import codecs
1641 # we don't accept tickets older than 10h 1642 # we don't accept tickets older than 10h
1642 return False 1643 return False
1643 ourticket = createTicket(request, timestamp_str) 1644 ourticket = createTicket(request, timestamp_str)
1644 return ticket == ourticket 1645 return ticket == ourticket
1645 1646
1647 def executeText(request, Parser, text, line_anchors=False):
1648 '''render text with Parser execute each page element'''
1649 import StringIO
1650 out = StringIO.StringIO()
1651 request.redirect(out)
1652 wikiizer = Parser(text, request, line_anchors=line_anchors)
1653 wikiizer.format(request.formatter)
1654 result = out.getvalue()
1655 request.redirect()
1656 del out
1657 return result
1658