comparison MoinMoin/parser/plain.py @ 0:77665d8e2254

tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0 (automatically generated log message) imported from: moin--main--1.5--base-0
author Thomas Waldmann <tw-public@gmx.de>
date Thu, 22 Sep 2005 15:09:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:77665d8e2254
1 # -*- coding: iso-8859-1 -*-
2 """
3 MoinMoin - Plain Text Parser
4
5 @copyright: 2000, 2001, 2002 by Jürgen Hermann <jh@web.de>
6 @license: GNU GPL, see COPYING for details.
7 """
8
9 Dependencies = []
10
11 class Parser:
12 """
13 Send plain text in a HTML <pre> element.
14 """
15
16 ## specify extensions willing to handle (for inline:)
17 ## should be a list of extensions including the leading dot
18 ## TODO: remove the leading dot from the extension. This is stupid.
19 #extensions = ['.txt']
20 ## use '*' instead of the list(!) to specify a default parser
21 ## which is used as fallback
22 extensions = '*'
23 Dependencies = []
24
25 def __init__(self, raw, request, **kw):
26 self.raw = raw
27 self.request = request
28 self.form = request.form
29 self._ = request.getText
30
31 def format(self, formatter):
32 """ Send the text. """
33 self.request.write(formatter.preformatted(1))
34 self.request.write(formatter.text(self.raw.expandtabs()))
35 self.request.write(formatter.preformatted(0))