comparison MoinMoin/parser/text.py @ 657:016a8a3ef354

wikiutil.MimeType class, renamed parsers to mimetype like module names
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 16 May 2006 20:12:29 +0200
parents MoinMoin/parser/plain.py@77665d8e2254
children bb2e053067fb
comparison
equal deleted inserted replaced
656:ad2ac49d17fe 657:016a8a3ef354
1 # -*- coding: iso-8859-1 -*-
2 """
3 MoinMoin - Plain Text Parser, fallback for text/*
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))