changeset 999:97ce857bdebf

whitespace-only cleanup and minor style changes
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 22 Jul 2006 12:39:18 +0200
parents 8e1f7ba815b5
children 6f6fcbe200b5
files MoinMoin/converter/text_html_text_moin_wiki.py MoinMoin/filter/__init__.py MoinMoin/filter/application_octet_stream.py MoinMoin/filter/text.py MoinMoin/formatter/__init__.py MoinMoin/formatter/dom_xml.py MoinMoin/formatter/pagelinks.py MoinMoin/formatter/text_docbook.py MoinMoin/formatter/text_gedit.py MoinMoin/formatter/text_html.py MoinMoin/formatter/text_plain.py MoinMoin/formatter/text_python.py MoinMoin/formatter/text_xml.py
diffstat 13 files changed, 149 insertions(+), 150 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/text_html_text_moin_wiki.py	Thu Jul 20 18:03:07 2006 +0200
+++ b/MoinMoin/converter/text_html_text_moin_wiki.py	Sat Jul 22 12:39:18 2006 +0200
@@ -407,7 +407,7 @@
 class ConvertError(error.FatalError):
     """ Raise when html to wiki conversion fails """
     name = "MoinMoin Convert Error"
-    
+
 
 class visitor(object):
     def do(self, tree):
@@ -434,7 +434,7 @@
 
     def visit_attribute(self, node):
         pass
-	
+
     def visit_text(self, node):
         pass
 
@@ -469,7 +469,7 @@
     def __init__(self, request, pagename):
         self.request = request
         self.pagename = pagename
-    
+
     def do(self, tree):
         self.depth = 0
         self.text = []
@@ -520,7 +520,7 @@
         name = node.localName
         if name is None: # not sure this can happen here (DOM comment node), but just for the case
             return
-        func = getattr(self, "process_%s" % name,  None)
+        func = getattr(self, "process_%s" % name, None)
         if func:
             func(node)
         else:
@@ -565,7 +565,7 @@
             self.text.append(self.new_line)
             self.text.append("%s %s %s" % (hstr, text.replace("\n", " "), hstr))
             self.text.append(self.new_line)
-    
+
     process_h1 = process_heading
     process_h2 = process_heading
     process_h3 = process_heading
@@ -666,7 +666,7 @@
             if name in ('p', 'pre', 'ol', 'ul', 'dl', 'table',) and pending:
                 self.empty_paragraph_queue(pending, indent, need_indent)
                 need_indent = True
-                
+
             if name == 'p':
                 if need_indent:
                     self.text.append(indent)
@@ -737,7 +737,7 @@
 
     def process_inline(self, node):
         if node.nodeType == Node.TEXT_NODE:
-            self.text.append(node.data.strip('\n').replace('\n',' '))
+            self.text.append(node.data.strip('\n').replace('\n', ' '))
             return
 
         name = node.localName # can be None for DOM Comment nodes
@@ -748,8 +748,8 @@
             text = self.node_list_text_only(node.childNodes).strip() # but can be inserted via the editor
             self.text.append(text)                          # so we just drop the header markup and keep the text
             return
-        
-        func = getattr(self, "process_%s" % name,  None)
+
+        func = getattr(self, "process_%s" % name, None)
         if func:
             func(node)
             return
@@ -778,13 +778,13 @@
             command = "" # just throw away font settings
         else:
             raise ConvertError("process_inline: Don't support %s element" % name)
-        
+
         self.text.append(command)
         for i in node.childNodes:
             if i.nodeType == Node.ELEMENT_NODE:
                 self.process_inline(i)
             elif i.nodeType == Node.TEXT_NODE:
-                self.text.append(i.data.strip('\n').replace('\n',' '))
+                self.text.append(i.data.strip('\n').replace('\n', ' '))
         if command_close:
             command = command_close
         self.text.append(command)
@@ -865,11 +865,11 @@
                     #print i.localName
             self.text.extend(["}}}", self.new_line])
 
-    _alignment = {"left" : "(",
-                  "center" : ":",
-                  "right" : ")",
-                  "top" : "^",
-                  "bottom" : "v"}
+    _alignment = {"left": "(",
+                  "center": ":",
+                  "right": ")",
+                  "top": "^",
+                  "bottom": "v"}
 
     def _check_length(self, value):
         try:
@@ -933,7 +933,7 @@
             colspan = 1
 
         spanning = rowspan or colspan > 1
-        
+
         align = ""
         result = []
         if  node.hasAttribute("bgcolor"):
@@ -970,7 +970,7 @@
             result.append('id="%s"' % node.getAttribute("id"))
         if node.hasAttribute("style"):
             result.append('style="%s"' % node.getAttribute("style"))
-                
+
         if align:
             result.insert(0, "%s" % align)
         result.append(rowspan)
@@ -1049,7 +1049,7 @@
                     self.process_inline(i)
                     found = True
                 elif i.nodeType == Node.TEXT_NODE:
-                    data = i.data.strip('\n').replace('\n',' ')
+                    data = i.data.strip('\n').replace('\n', ' ')
                     if data:
                         found = True
                         self.text.append(data)
@@ -1083,7 +1083,7 @@
         id = node.attributes.get("id", None)
         if id:
             id = id.nodeValue
-        
+
         if href:
             title = class_ = interwikiname = None
 
@@ -1102,14 +1102,14 @@
                 if not err and href.startswith(wikiurl):
                     pagename, qpagename = pagename_from_url(href[len(wikiurl):].lstrip('/'))
                     interwikiname = "%s:%s" % (wikitag, qpagename)
-                else: 
+                else:
                     raise ConvertError("Invalid InterWiki link: '%s'" % href)
             elif class_ == "badinterwiki" and title:
                 if href == "/": # we used this as replacement for empty href
                     href = ""
                 pagename, qpagename = pagename_from_url(href)
                 interwikiname = "%s:%s" % (title, qpagename)
-            if interwikiname and pagename == text: 
+            if interwikiname and pagename == text:
                 self.text.append("%s" % interwikiname)
                 return
             elif title == 'Self':
@@ -1118,7 +1118,7 @@
             elif interwikiname:
                 self.text.append("[wiki:%s %s]" % (interwikiname, text))
                 return
-            
+
             # fix links generated by a broken copy & paste of gecko based browsers
             brokenness = '../../../..'
             if href.startswith(brokenness):
--- a/MoinMoin/filter/__init__.py	Thu Jul 20 18:03:07 2006 +0200
+++ b/MoinMoin/filter/__init__.py	Sat Jul 22 12:39:18 2006 +0200
@@ -12,7 +12,7 @@
 filters = pysupport.getPackageModules(__file__)
 modules = filters
 
-standard_codings = ['utf-8', 'iso-8859-15', 'iso-8859-1',]
+standard_codings = ['utf-8', 'iso-8859-15', 'iso-8859-1', ]
 
 def execfilter(cmd, filename, codings=standard_codings):
     """ use cmd to get plaintext content of filename
--- a/MoinMoin/filter/application_octet_stream.py	Thu Jul 20 18:03:07 2006 +0200
+++ b/MoinMoin/filter/application_octet_stream.py	Sat Jul 22 12:39:18 2006 +0200
@@ -36,7 +36,7 @@
 norm = string.maketrans('', '')
 
 # builds a list of all non-alphanumeric characters:
-non_alnum = string.translate(norm, norm, string.letters+string.digits) 
+non_alnum = string.translate(norm, norm, string.letters+string.digits)
 
 # translate table that replaces all non-alphanumeric by blanks:
 trans_nontext = string.maketrans(non_alnum, ' '*len(non_alnum))
--- a/MoinMoin/filter/text.py	Thu Jul 20 18:03:07 2006 +0200
+++ b/MoinMoin/filter/text.py	Sat Jul 22 12:39:18 2006 +0200
@@ -24,5 +24,4 @@
     f.close()
     data = data.decode('ascii', 'replace')
     return data
-    
 
--- a/MoinMoin/formatter/__init__.py	Thu Jul 20 18:03:07 2006 +0200
+++ b/MoinMoin/formatter/__init__.py	Sat Jul 22 12:39:18 2006 +0200
@@ -60,7 +60,7 @@
         return ""
 
     # Document Level #####################################################
-    
+
     def startDocument(self, pagename):
         return ""
 
@@ -74,13 +74,13 @@
         return ""
 
     # Links ##############################################################
-    
+
     def pagelink(self, on, pagename='', page=None, **kw):
         """ make a link to page <pagename>. Instead of supplying a pagename,
             it is also possible to give a live Page object, then page.page_name
             will be used.
         """
-        if not self._store_pagelinks or not on or kw.get('generated'): 
+        if not self._store_pagelinks or not on or kw.get('generated'):
             return ''
         if not pagename and page:
             pagename = page.page_name
@@ -101,7 +101,7 @@
                 wikitail = wikiutil.url_unquote(wikitail)
             return self.pagelink(on, wikitail, **kw)
         return ''
-            
+
     def url(self, on, url=None, css=None, **kw):
         raise NotImplementedError
 
@@ -171,11 +171,11 @@
         return self.text(text)
 
     # Text and Text Attributes ########################################### 
-    
+
     def text(self, text, **kw):
         if not self._highlight_re:
             return self._text(text)
-            
+
         result = []
         lastpos = 0
         match = self._highlight_re.search(text)
@@ -278,7 +278,7 @@
         raise NotImplementedError
 
     # Tables #############################################################
-    
+
     def table(self, on, attrs={}, **kw):
         raise NotImplementedError
 
@@ -289,10 +289,10 @@
         raise NotImplementedError
 
     # Dynamic stuff / Plugins ############################################
-    
+
     def macro(self, macro_obj, name, args):
         # call the macro
-        return macro_obj.execute(name, args)    
+        return macro_obj.execute(name, args)
 
     def _get_bang_args(self, line):
         if line[:2] == '#!':
@@ -326,15 +326,15 @@
         return ''
 
     # Other ##############################################################
-    
+
     def div(self, on, **kw):
         """ open/close a blocklevel division """
         return ""
-    
+
     def span(self, on, **kw):
         """ open/close a inline span """
         return ""
-    
+
     def rawHTML(self, markup):
         """ This allows emitting pre-formatted HTML markup, and should be
             used wisely (i.e. very seldom).
--- a/MoinMoin/formatter/dom_xml.py	Thu Jul 20 18:03:07 2006 +0200
+++ b/MoinMoin/formatter/dom_xml.py	Sat Jul 22 12:39:18 2006 +0200
@@ -57,7 +57,7 @@
         'ol': ['li'],
         'ul': ['li'],
         }
-    
+
     # FIXME - this overrides the values defined above - FIXME XXX
     close_on_open = {}
     close_on_close = {}
@@ -69,7 +69,7 @@
         self.document.documentElement = self.document.createElement('xml')
         self.position = self.document.documentElement
         self.tag_stack = [('xml', {})]
-        
+
     def setPage(self, page):
         self.page = page
 
@@ -110,7 +110,7 @@
         for name, value in attrs.items():
             if value:
                 node.setAttribute(name, str(value))
-        self.position.appendChild(node)                        
+        self.position.appendChild(node)
         return ''
 
     def _text(self, text):
@@ -195,13 +195,13 @@
         if not pagename and page is not None:
             pagename = page.page_name
         kw['pagename'] = pagename
-        return self._set_tag('pagelink', on,  **kw)
+        return self._set_tag('pagelink', on, **kw)
 
     def interwikilink(self, on, interwiki='', pagename='', **kw):
         kw['wiki'] = interwiki
         kw['pagename'] = pagename
         return self._set_tag('interwiki', on, **kw)
-    
+
     def macro(self, macro_obj, name, args):
         # call the macro
         return self._add_tag('macro', name=name, args=(args or ''))
@@ -227,17 +227,17 @@
         kw['href'] = url
         kw['type'] = 'link'
         return self._set_tag('attachment', 1, **kw) + self.text(text) + self._set_tag('attachment', 0, **kw)
-    
+
     def attachment_image(self, url, **kw):
         kw['href'] = url
         kw['type'] = 'image'
         return self._add_tag('attachment', **kw)
-    
+
     def attachment_drawing(self, url, **kw):
         kw['href'] = url
         kw['type'] = 'drawing'
         return self._add_tag('attachment', **kw)
-    
+
     def attachment_inlined(self, url, **kw):
         kw['href'] = url
         kw['type'] = 'inline'
@@ -295,7 +295,7 @@
             return self.text('\n')
         else:
             return self._add_tag('br')
-                                  
+
     def heading(self, on, depth, **kw):
         return self._set_tag('h%d' %depth, on, **kw)
 
@@ -307,7 +307,7 @@
 
     def table(self, on, attrs={}, **kw):
         return self._set_tag('table', on, **self._check_attrs(attrs))
-        
+
     def table_row(self, on, attrs={}, **kw):
         return self._set_tag('tr', on, **self._check_attrs(attrs))
 
@@ -338,7 +338,7 @@
         if compact and on:
             return self._set_tag('dt compact', on)
         else:
-            return self._set_tag('dt', on)            
+            return self._set_tag('dt', on)
 
     def definition_desc(self, on, **kw):
         # self._langAttr() missing
--- a/MoinMoin/formatter/pagelinks.py	Thu Jul 20 18:03:07 2006 +0200
+++ b/MoinMoin/formatter/pagelinks.py	Sat Jul 22 12:39:18 2006 +0200
@@ -9,19 +9,19 @@
 from MoinMoin.formatter import FormatterBase
 
 class Formatter(FormatterBase):
-    """ Collect pagelinks and format nothing :-) """        
-    
+    """ Collect pagelinks and format nothing :-) """
+
     def pagelink(self, on, pagename='', page=None, **kw):
         FormatterBase.pagelink(self, on, pagename, page, **kw)
         return self.null()
- 
+
     def null(self, *args, **kw):
         return ''
-    
+
     # All these must be overriden here because they raise
     # NotImplementedError!@#! or return html?! in the base class.
     set_highlight_re = rawHTML = url = image = smiley = text = null
-    strong = emphasis = underline =  highlight = sup = sub = strike = null
+    strong = emphasis = underline = highlight = sup = sub = strike = null
     code = preformatted = small = big = code_area = code_line = null
     code_token = linebreak = paragraph = rule = icon = null
     number_list = bullet_list = listitem = definition_list = null
--- a/MoinMoin/formatter/text_docbook.py	Thu Jul 20 18:03:07 2006 +0200
+++ b/MoinMoin/formatter/text_docbook.py	Sat Jul 22 12:39:18 2006 +0200
@@ -30,15 +30,15 @@
     """
        Format docbook output
     """
-    
+
     def __init__(self, dommDoc):
         self.doc = dommDoc
         self.curNode = dommDoc.documentElement
-        
+
     def setHeading(self, headNode):
         self.domHeadNode = headNode
         return u""
-    
+
     def _printNode(self, node):
         """
             Function print a node
@@ -46,15 +46,15 @@
         from xml.dom.ext import Print
         import StringIO
         from xml.dom.ext import Printer
-        
+
         stream = StringIO.StringIO()
-        
+
         visitor = Printer.PrintVisitor(stream, 'UTF-8')
         Printer.PrintWalker(visitor, node).run()
         # get value from stream
         ret = stream.getvalue()
         stream.close()
-        
+
         return unicode(ret, 'utf-8')
 
     def getHeading(self):
@@ -63,7 +63,7 @@
         # print article info
         return '<?xml version="1.0"?><%s>%s' % (rootNode.nodeName,
                                                 self._printNode(self.domHeadNode))
-        
+
     def getBody(self):
         body = []
         # print all nodes inside dom behind heading
@@ -81,7 +81,7 @@
             ret.append("</%s>" % (self.curNode.nodeName, ))
             self.curNode = self.curNode.parentNode
         return ''.join(ret)
-        
+
     def getFooter(self):
         return "</%s>" % self.doc.documentElement.nodeName
 
@@ -93,7 +93,7 @@
     section_should_break = ['abstract', 'para', 'emphasis']
 
     def __init__(self, request, **kw):
-        '''We should use this for creating the doc'''
+        """We should use this for creating the doc"""
         FormatterBase.__init__(self, request, **kw)
 
         self.doc = dom.createDocument(None, "article", dom.createDocumentType(
@@ -113,7 +113,7 @@
         self.root.appendChild(info)
         # set heading node
         self.outputFormatter.setHeading(info)
-        
+
         return self.outputFormatter.getHeading()
 
     def startContent(self, content_id="content", **kw):
@@ -138,7 +138,7 @@
         else:
             srcText = text
         if self.cur.nodeName == "screen":
-            if self.cur.lastChild != None:
+            if self.cur.lastChild is not None:
                 from xml.dom.ext import Node
                 if self.cur.lastChild.nodeType == Node.CDATA_SECTION_NODE:
                     self.cur.lastChild.nodeValue = self.cur.lastChild.nodeValue + srcText
@@ -151,7 +151,7 @@
     def heading(self, on, depth, **kw):
         while self.cur.nodeName in self.section_should_break:
             self.cur = self.cur.parentNode
-               
+
         if on:
             # try to go to higher level if needed
             if depth <= self.curdepth:
@@ -165,7 +165,7 @@
 # I don't understand this code - looks like unnecessary -- maybe it is used to gain some vertical space for large headings?
 #                    if len(self.cur.childNodes) < 3:
 #                       self._addEmptyNode("para")
-                    
+
                     # check if not top-level
                     if self.cur.nodeName != "article":
                         self.cur = self.cur.parentNode
@@ -225,7 +225,7 @@
         cols = 1
         if attrs and attrs.has_key('colspan'):
             s1 = attrs['colspan']
-            s1 = str(s1).replace('"','')
+            s1 = str(s1).replace('"', '')
             cols = int(s1)
         return cols
 
@@ -270,16 +270,16 @@
         return self._handleNode(name, on, attributes)
 
     def strong(self, on, **kw):
-        return self._handleFormatting("emphasis", on, (('role','strong'), ))
+        return self._handleFormatting("emphasis", on, (('role', 'strong'), ))
 
     def emphasis(self, on, **kw):
         return self._handleFormatting("emphasis", on)
 
     def underline(self, on, **kw):
-        return self._handleFormatting("emphasis", on, (('role','underline'), ))
+        return self._handleFormatting("emphasis", on, (('role', 'underline'), ))
 
     def highlight(self, on, **kw):
-        return self._handleFormatting("emphasis", on, (('role','highlight'), ))
+        return self._handleFormatting("emphasis", on, (('role', 'highlight'), ))
 
     def sup(self, on, **kw):
         return self._handleFormatting("superscript", on)
@@ -291,7 +291,7 @@
         # does not yield <strike> using the HTML XSLT files here ...
         # but seems to be correct
         return self._handleFormatting("emphasis", on,
-                                      (('role','strikethrough'), ))
+                                      (('role', 'strikethrough'), ))
 
     def code(self, on, **kw):
         return self._handleFormatting("code", on)
@@ -303,8 +303,8 @@
 ### Lists ###########################################################
 
     def number_list(self, on, type=None, start=None, **kw):
-        docbook_ol_types = {'1': "arabic", 
-                            'a': "loweralpha", 
+        docbook_ol_types = {'1': "arabic",
+                            'a': "loweralpha",
                             'A': "upperalpha",
                             'i': "lowerroman",
                             'I': "upperroman"}
@@ -320,22 +320,22 @@
         return self._handleNode("itemizedlist", on)
 
     def definition_list(self, on, **kw):
-        return self._handleNode("glosslist", on)        
+        return self._handleNode("glosslist", on)
 
     def definition_term(self, on, compact=0, **kw):
        # When on is false, we back out just on level. This is
        # ok because we know definition_desc gets called, and we
        # back out two levels there.
         if on:
-            entry=self.doc.createElement('glossentry')
-            term=self.doc.createElement('glossterm')
+            entry = self.doc.createElement('glossentry')
+            term = self.doc.createElement('glossterm')
             entry.appendChild(term)
             self.cur.appendChild(entry)
             self.cur = term
         else:
             self.cur = self.cur.parentNode
         return ""
-   
+
     def definition_desc(self, on, **kw):
         # We backout two levels when 'on' is false, to leave the glossentry stuff
         if on:
@@ -365,14 +365,14 @@
     # FIXME: This is even more crappy
     def interwikilink(self, on, interwiki='', pagename='', **kw):
         if not on:
-            return self.url(on,kw)
+            return self.url(on, kw)
 
         wikitag, wikiurl, wikitail, wikitag_bad = wikiutil.resolve_wiki(self.request, '%s:"%s"' % (interwiki, pagename))
         wikiurl = wikiutil.mapURL(self.request, wikiurl)
         href = wikiutil.join_wiki(wikiurl, wikitail)
 
         return self.url(on, href)
-            
+
     def url(self, on, url=None, css=None, **kw):
         return self._handleNode("ulink", on, (('url', url), ))
 
@@ -382,11 +382,11 @@
         return ""
 
     def anchorlink(self, on, name='', **kw):
-        id = kw.get('id',None)
+        id = kw.get('id', None)
         attrs = []
         if name != '':
             attrs.append(('endterm', name))
-        if id != None:
+        if id is not None:
             attrs.append(('linkend', id))
         elif name != '':
             attrs.append(('linkend', name))
@@ -463,14 +463,14 @@
                 break
         if title:
             txtcontainer = self.doc.createElement('textobject')
-            media.appendChild(txtcontainer)        
+            media.appendChild(txtcontainer)
             txtphrase = self.doc.createElement('phrase')
             txtphrase.appendChild(self.doc.createTextNode(title))
-            txtcontainer.appendChild(txtphrase)        
-        
+            txtcontainer.appendChild(txtphrase)
+
         self.cur.appendChild(media)
-        return ""        
- 
+        return ""
+
     def smiley(self, text):
         return self.request.theme.make_icon(text)
 
@@ -492,7 +492,7 @@
         self._handleNode("tgroup", on)
         self._handleNode("tbody", on)
         return ""
-    
+
     def table_row(self, on, attrs=None, **kw):
         self.table_current_row_cells = 0
         sanitized_attrs = []
@@ -526,12 +526,12 @@
         show = show and 'numbered' or 'unnumbered'
         if start < 1:
             start = 1
-        
+
         attrs = (('id', code_id),
                 ('linenumbering', show),
                 ('startinglinenumber', str(start)),
                 ('language', code_type),
-                ('format','linespecific'),
+                ('format', 'linespecific'),
                 )
         return self._handleFormatting("screen", on, attrs)
 
@@ -578,7 +578,7 @@
 
 ### Not supported ###################################################
 
-    def rule(self, size = 0, **kw):
+    def rule(self, size=0, **kw):
         return ""
 
     def small(self, on, **kw):
--- a/MoinMoin/formatter/text_gedit.py	Thu Jul 20 18:03:07 2006 +0200
+++ b/MoinMoin/formatter/text_gedit.py	Sat Jul 22 12:39:18 2006 +0200
@@ -42,7 +42,7 @@
         """
         apply(FormatterBase.pagelink, (self, on, pagename, page), kw)
         if page is None:
-            page = Page(self.request, pagename, formatter=self);
+            page = Page(self.request, pagename, formatter=self)
         return page.link_to(self.request, on=on, **kw)
 
     def interwikilink(self, on, interwiki='', pagename='', **kw):
@@ -69,7 +69,7 @@
         return (self.url(1, target, title="attachment:%s" % wikiutil.quoteWikinameURL(url)) +
                 self.text(text) +
                 self.url(0))
-    
+
     def attachment_image(self, url, **kw):
         _ = self.request.getText
         pagename = self.page.page_name
@@ -91,10 +91,10 @@
         return '<span style="background-color:#ffff11">!</span>' + self.text(text)
 
     # Dynamic stuff / Plugins ############################################
-    
+
     def macro(self, macro_obj, name, args):
         if args is not None:
-            result =  "[[%s(%s)]]" % (name, args)    
+            result = "[[%s(%s)]]" % (name, args)
         else:
             result = "[[%s]]" % name
         return '<span style="background-color:#ffff11">%s</span>' % result
@@ -182,7 +182,7 @@
             # Close table then div
             result.append(self._close('table'))
 
-        return ''.join(result)    
+        return ''.join(result)
 
     def comment(self, text, **kw):
         text = text.rstrip() # workaround for growing amount of blanks at EOL
@@ -205,10 +205,10 @@
         if on:
             return self._open(tag, allowed_attrs=[], **kw)
         return self._close(tag)
-                    
+
     def line_anchordef(self, lineno):
         return '' # not needed for gui editor feeding
-        
+
     def line_anchorlink(self, on, lineno=0):
         return '' # not needed for gui editor feeding
 
--- a/MoinMoin/formatter/text_html.py	Thu Jul 20 18:03:07 2006 +0200
+++ b/MoinMoin/formatter/text_html.py	Sat Jul 22 12:39:18 2006 +0200
@@ -119,9 +119,9 @@
     if ns == 'html':
         # We have an HTML attribute, fix according to DTD
         if name == 'content_type': # MIME type such as in <a> and <link> elements
-            name =  'type'
+            name = 'type'
         elif name == 'content_id': # moin historical convention
-            name =  'id'
+            name = 'id'
         elif name in ('css_class', 'css'): # to avoid python word 'class'
             name = 'class'
         elif name.startswith('on'): # event handler hook
@@ -226,7 +226,7 @@
                 return {}
 
         #attr = {'xml:lang': lang, 'lang': lang, 'dir': i18n.getDirection(lang),}
-        attr = {'lang': lang, 'dir': i18n.getDirection(lang),}
+        attr = {'lang': lang, 'dir': i18n.getDirection(lang), }
         return attr
 
     def _formatAttributes(self, attr=None, allowed_attrs=None, **kw):
@@ -335,12 +335,12 @@
         if tag in _blocks:
             # Block elements
             result = []
-            
+
             # Add language attributes, but let caller overide the default
             attributes = self._langAttr()
             if attr:
                 attributes.update(attr)
-            
+
             # Format
             attributes = self._formatAttributes(attributes, allowed_attrs=allowed_attrs, **kw)
             result.append('<%s%s%s>' % (tag, attributes, is_self_closing))
@@ -388,7 +388,7 @@
             if newline:
                 result.append(self._newline())
             result.append('</%s>' % (tag))
-            tagstr = ''.join(result)            
+            tagstr = ''.join(result)
         else:
             # Inline elements 
             # Pull from stack, ignore order, that is not our problem.
@@ -433,7 +433,7 @@
         if newline:
             result.append('\n')
         return ''.join(result)
-        
+
     def endContent(self, newline=True):
         """ Close page content div.
 
@@ -455,7 +455,7 @@
         result = []
         result.append(self.anchordef(aid))
         result.append(self._close('div', newline=newline))
-        return ''.join(result) 
+        return ''.join(result)
 
     def lang(self, on, lang_name):
         """ Insert text with specific lang and direction.
@@ -472,10 +472,10 @@
             return self._close(tag)
 
         # Direction did not change, no need for span
-        return ''            
-                
+        return ''
+
     # Links ##############################################################
-    
+
     def pagelink(self, on, pagename='', page=None, **kw):
         """ Link to a page.
 
@@ -486,7 +486,7 @@
         """
         apply(FormatterBase.pagelink, (self, on, pagename, page), kw)
         if page is None:
-            page = Page(self.request, pagename, formatter=self);
+            page = Page(self.request, pagename, formatter=self)
         if self.request.user.show_nonexist_qm and on and not page.exists():
             self.pagelink_preclosed = True
             return (page.link_to(self.request, on=1, **kw) +
@@ -565,7 +565,7 @@
 
             if css:
                 attrs['class'] = css
-            
+
             markup = self._open('a', attr=attrs, **kw)
         else:
             markup = self._close('a')
@@ -641,7 +641,7 @@
         return (self.url(1, target, css='attachment', title="attachment:%s" % url) +
                 self.text(text) +
                 self.url(0))
-    
+
     def attachment_image(self, url, **kw):
         _ = self.request.getText
         pagename, filename = AttachFile.absoluteName(url, self.page.page_name)
@@ -659,7 +659,7 @@
             title="attachment:%s" % url,
             src=AttachFile.getAttachUrl(pagename, filename, self.request, addts=1),
             css="attachment")
-    
+
     def attachment_drawing(self, url, text, **kw):
         _ = self.request.getText
         pagename, filename = AttachFile.absoluteName(url, self.page.page_name)
@@ -724,10 +724,10 @@
                                      self.image(alt=url,
                                                 src=AttachFile.getAttachUrl(pagename, filename, self.request, addts=1), css="drawing"),
                                      title="%s" % (_('Edit drawing %(filename)s') % {'filename': self.text(fname)}))
-        
-    
+
+
     # Text ##############################################################
-    
+
     def _text(self, text):
         text = wikiutil.escape(text)
         if self._in_code:
@@ -735,7 +735,7 @@
         return text
 
     # Inline ###########################################################
-        
+
     def strong(self, on, **kw):
         """Creates an HTML <strong> element.
 
@@ -826,11 +826,11 @@
         """
         tag = 'tt'
         # Maybe we don't need this, because we have tt will be in inlineStack.
-        self._in_code = on        
+        self._in_code = on
         if on:
             return self._open(tag, allowed_attrs=[], **kw)
         return self._close(tag)
-        
+
     def small(self, on, **kw):
         """Creates a <small> element for smaller font.
 
@@ -867,7 +867,7 @@
         if on:
             return self._open(tag, newline=1, **kw)
         return self._close(tag)
-                
+
     # Use by code area
     _toggleLineNumbersScript = """
 <script type="text/javascript">
@@ -920,7 +920,7 @@
 }
 </script>
 """
-    
+
     def code_area(self, on, code_id, code_type='code', show=0, start=-1, step=-1):
         """Creates a formatted code region, with line numbering.
 
@@ -997,7 +997,7 @@
         return ['<span class="%s">' % tok_type, '</span>'][not on]
 
     # Paragraphs, Lines, Rules ###########################################
-    
+
     def _indent_spaces(self):
         """Returns space(s) for indenting the html source so list nesting is easy to read.
 
@@ -1023,7 +1023,7 @@
         if self._in_code_area:
             preformatted = 1
         return ['\n', '<br />\n'][not preformatted] + self._indent_spaces()
-        
+
     def paragraph(self, on, **kw):
         """Creates a paragraph with a <p> element.
         
@@ -1051,7 +1051,7 @@
             # Add hr class: hr1 - hr6
             return self._open('hr', newline=1, attr={'class': 'hr%d' % size}, **kw)
         return self._open('hr', newline=1, **kw)
-                
+
     def icon(self, type):
         return self.request.theme.make_icon(type)
 
@@ -1091,7 +1091,7 @@
         else:
             tagstr = self._close(tag, newline=1)
         return tagstr
-    
+
     def bullet_list(self, on, **kw):
         """Creates an HTML ordered list, <ul> element.
 
@@ -1117,7 +1117,7 @@
         """
         tag = 'li'
         if on:
-            tagstr =  self._open(tag, newline=1, **kw)
+            tagstr = self._open(tag, newline=1, **kw)
         else:
             tagstr = self._close(tag, newline=1)
         return tagstr
@@ -1185,7 +1185,7 @@
         # closing tag, with empty line after, to make source more readable
         if not on:
             return self._close('h%d' % heading_depth) + '\n'
-            
+
         # create section number
         number = ''
         if self._show_section_numbers:
@@ -1214,7 +1214,7 @@
                        self.url(0)))
         return "%s%s%s" % (result, kw.get('icons', ''), number)
 
-    
+
     # Tables #############################################################
 
     _allowed_table_attrs = {
@@ -1303,8 +1303,8 @@
             result.append(self._close('table'))
             result.append(self._close('div'))
 
-        return ''.join(result)    
-    
+        return ''.join(result)
+
     def table_row(self, on, attrs=None, **kw):
         tag = 'tr'
         if on:
@@ -1316,7 +1316,7 @@
                              allowed_attrs=self._allowed_table_attrs['row'],
                              **kw)
         return self._close(tag) + '\n'
-    
+
     def table_cell(self, on, attrs=None, **kw):
         tag = 'td'
         if on:
@@ -1349,7 +1349,7 @@
         if on:
             return self._open(tag, attr={'class': 'message'}, **kw)
         return self._close(tag)
-    
+
     def div(self, on, **kw):
         tag = 'div'
         if on:
@@ -1361,5 +1361,5 @@
         if on:
             return self._open(tag, **kw)
         return self._close(tag)
-    
 
+
--- a/MoinMoin/formatter/text_plain.py	Thu Jul 20 18:03:07 2006 +0200
+++ b/MoinMoin/formatter/text_plain.py	Sat Jul 22 12:39:18 2006 +0200
@@ -53,7 +53,7 @@
                 self._url = None
                 self._text = None
                 return u' [%s]' % (self._url)
-            
+
     def url(self, on, url='', css=None, **kw):
         if on:
             self._url = url
@@ -81,7 +81,7 @@
 
     def attachment_drawing(self, url, text, **kw):
         return "[drawing:%s]" % text
-    
+
     def text(self, text, **kw):
         self._did_para = 0
         if self._text is not None:
@@ -138,7 +138,7 @@
         else:
             self._did_para = 1
             return u'\n'
-        
+
     def sup(self, on, **kw):
         return u'^'
 
@@ -211,7 +211,7 @@
             self._text = []
             return '\n\n'
         else:
-            result =  u'\n%s\n\n' % (u'=' * len("".join(self._text)))
+            result = u'\n%s\n\n' % (u'=' * len("".join(self._text)))
             self._text = None
             return result
 
--- a/MoinMoin/formatter/text_python.py	Thu Jul 20 18:03:07 2006 +0200
+++ b/MoinMoin/formatter/text_python.py	Sat Jul 22 12:39:18 2006 +0200
@@ -21,7 +21,7 @@
     """
 
     defaultDependencies = ["time"]
-    
+
     def __init__(self, request, static=[], formatter=None, **kw):
         if formatter:
             self.formatter = formatter
@@ -70,7 +70,7 @@
             i += 1
         source.append(self.text_cmd_end)
         source.append(self.__adjust_formatter_state())
-        
+
         self.code_fragments = [] # clear code fragments to make
                                  # this object reusable
         return "".join(source)
@@ -98,7 +98,7 @@
             self.__lang = self.request.current_lang
             return 'request.current_lang = %r\n' % self.__lang
         return ''
-        
+
     def __adjust_formatter_state(self):
         result = self.__adjust_language_state()
         if self.__in_p != self.formatter.in_p:
@@ -108,11 +108,11 @@
         if self.__in_pre != self.formatter.in_pre:
             result = "%s%s.in_pre = %r\n" % (result, self.__formatter,
                                            self.formatter.in_pre)
-            self.__in_pre = self.formatter.in_pre        
+            self.__in_pre = self.formatter.in_pre
         return result
-    
+
     # Public methods ---------------------------------------------------
-        
+
     def pagelink(self, on, pagename='', page=None, **kw):
         if on:
             return self.__insert_code('page=Page(request, %r, formatter=%s);'
@@ -132,24 +132,24 @@
         return self.__insert_code(
             'request.write(%s.attachment_image(%r, **%r))' %
             (self.__formatter, url, kw))
-    
+
     def attachment_drawing(self, url, text, **kw):
         return self.__insert_code(
             'request.write(%s.attachment_drawing(%r, %r, **%r))' %
             (self.__formatter, url, text, kw))
-    
+
     def attachment_inlined(self, url, text, **kw):
         return self.__insert_code(
             'request.write(%s.attachment_inlined(%r, %r, **%r))' %
             (self.__formatter, url, text, kw))
 
-    def heading(self, on, depth, **kw):        
+    def heading(self, on, depth, **kw):
         if on:
             code = [
                 self.__adjust_language_state(),
                 'request.write(%s.heading(%r, %r, **%r))' % (self.__formatter,
                                                              on, depth, kw),
-                ]     
+                ]
             return self.__insert_code(''.join(code))
         else:
             return self.formatter.heading(on, depth, **kw)
@@ -171,7 +171,7 @@
                 '%srequest.write(%s.macro(macro_obj, %r, %r))' %
                 (self.__adjust_formatter_state(),
                  self.__formatter, name, args))
-            
+
     def parser(self, parser_name, lines):
         """ parser_name MUST be valid!
             prints out the result instead of returning it!
--- a/MoinMoin/formatter/text_xml.py	Thu Jul 20 18:03:07 2006 +0200
+++ b/MoinMoin/formatter/text_xml.py	Sat Jul 22 12:39:18 2006 +0200
@@ -175,11 +175,11 @@
         return '<anchor id="%s"/>' % id
 
     def anchorlink(self, on, name='', **kw):
-        id = kw.get('id',None)
+        id = kw.get('id', None)
         extra = ''
         if id:
             extra = ' id="%s"' % id
-        return ('<link anchor="%s"%s>' % (name, extra) ,'</link>') [not on]
+        return ('<link anchor="%s"%s>' % (name, extra), '</link>') [not on]
 
     def underline(self, on, **kw):
         return self.strong(on) # no underline in StyleBook