Attachment 'box.py'
Download 1 # -*- coding: iso-8859-1 -*-
2 """
3 MoinMoin - Parser for css boxes
4
5 @copyright: 2005 by Julián Romero <julian.romero@gmail.com>
6 @license: GNU GPL
7 """
8
9 from MoinMoin.parser import wiki
10 import StringIO
11
12
13 Dependencies = []
14
15 class Parser:
16 """ Format css BOXes
17 """
18
19 Dependencies = []
20
21 def __init__(self, raw, request, **kw):
22 """ Store the source text.
23 """
24 self.raw = raw
25 self.request = request
26 self.form = request.form
27 self._ = request.getText
28 args = (kw.get('format_args','').strip()+("|")).split("|")
29 self.css_class, self.css_inline = args[0:2]
30 if self.css_inline != '':
31 self.css_inline= 'style="%s"' % (self.css_inline,)
32
33 def format(self, formatter):
34 """ Parse and send the output
35 """
36
37 self.request.write(formatter.rawHTML('<div id="%s-box" class="%s" %s>' % (self.css_class, self.css_class, self.css_inline)))
38 wikifier=wiki.Parser(self.raw, self.request)
39 wikifier.format(formatter)
40 self.request.write(formatter.rawHTML('</div>'))
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.