Attachment 'xml-1.6.py'

Download

   1 # -*- coding: iso-8859-1 -*-
   2 """
   3     MoinMoin - XML Source Parser
   4 
   5     @copyright: 2005 by Davin Dubeau <davin.dubeau@gmail.com>
   6     @license: GNU GPL, see COPYING for details.
   7     
   8     @modified by Andrew Seigner <siggy@hotmail.com>
   9 
  10 """
  11 
  12 from MoinMoin.parser._ParserBase import ParserBase
  13 
  14 Dependencies = ['user']
  15 
  16 class Parser(ParserBase):
  17 
  18     parsername = "ColorizedXML"
  19     extensions = ['.xml']
  20     Dependencies = Dependencies
  21 
  22     def setupRules(self):
  23         ParserBase.setupRules(self)
  24 
  25         #self.addRulePair("Comment","<!--","-->")
  26         #self.addRule("Number",r"[0-9]+")
  27         #self.addRule("SPChar","[=<>/\"]")
  28         #self.addRule("ResWord","(?!<)[\w\s]*(?![\w=\"])?(?![\w\s\.<])+(?!>)*")
  29 
  30         # new rules
  31 
  32         # tags
  33         self.addRulePair("ConsWord","<","[\s>]")
  34         
  35         # end tags
  36         self.addRule("ConsWord",">")
  37         
  38         # attributes in quotes
  39         self.addRulePair("SPChar","[\"]","[\"]")
  40         
  41         # special characters
  42         self.addRule("ResWord","[=/\"]")
  43         
  44         # comments
  45         self.addRulePair("Comment","<!--","-->")

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] (2009-09-01 19:02:54, 1.1 KB) [[attachment:xml-1.6.py]]
  • [get | view] (2008-10-08 23:33:36, 1.1 KB) [[attachment:xml.py]]
 All files | Selected Files: delete move to page copy to page

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