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.
  • [get | view] (2005-12-10 02:54:33, 2.1 KB) [[attachment:CSV.py]]
  • [get | view] (2006-10-10 10:42:36, 1.1 KB) [[attachment:box.py]]
  • [get | view] (2005-11-21 02:56:09, 0.5 KB) [[attachment:css-action.py]]
  • [get | view] (2005-11-21 02:56:33, 0.8 KB) [[attachment:css-macro.py]]
  • [get | view] (2005-11-13 12:21:38, 0.9 KB) [[attachment:patch-1.5b2-Form.py]]
  • [get | view] (2005-11-13 12:13:19, 0.8 KB) [[attachment:patch-1.5b2-wikiform.py]]
  • [get | view] (2006-05-12 12:59:21, 2.6 KB) [[attachment:todo.py]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.