changeset 1198:277b97ba0700

merge with main
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Sat, 22 Jul 2006 17:56:50 +0200
parents fc2d00e2bb6b (current diff) 2e7a3dd04833 (diff)
children 5ce3bea2e66c ccfe3e70f4f2
files MoinMoin/formatter/text_html.py MoinMoin/macro/__init__.py
diffstat 46 files changed, 559 insertions(+), 556 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/action/AttachFile.py	Sat Jul 22 17:56:50 2006 +0200
@@ -620,11 +620,12 @@
         # delete map file if it is empty
         os.unlink(savepath)
     else:
-        file = open(savepath, 'wb')
+        stream = open(savepath, 'wb')
         try:
-            file.write(filecontent)
+            stream.write(filecontent)
         finally:
-            file.close()
+            stream.close()
+        os.chmod(savepath, 0666 & config.umask)
 
     # touch attachment directory to invalidate cache if new map is saved
     if ext == '.map':
--- a/MoinMoin/converter/text_html_text_moin_wiki.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/converter/text_html_text_moin_wiki.py	Sat Jul 22 17:56:50 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
@@ -593,7 +593,7 @@
             if class_ == "gap":
                 before = "\n"
             style = listitem.getAttribute("style")
-            if re.match(u"list-style-type:\s*none", style, re.I):
+            if re.match(ur"list-style-type:\s*none", style, re.I):
                 markup = ". "
             else:
                 markup = "* "
@@ -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	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/filter/__init__.py	Sat Jul 22 17:56:50 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	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/filter/application_octet_stream.py	Sat Jul 22 17:56:50 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	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/filter/text.py	Sat Jul 22 17:56:50 2006 +0200
@@ -24,5 +24,4 @@
     f.close()
     data = data.decode('ascii', 'replace')
     return data
-    
 
--- a/MoinMoin/formatter/__init__.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/formatter/__init__.py	Sat Jul 22 17:56:50 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	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/formatter/dom_xml.py	Sat Jul 22 17:56:50 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	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/formatter/pagelinks.py	Sat Jul 22 17:56:50 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	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/formatter/text_docbook.py	Sat Jul 22 17:56:50 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	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/formatter/text_gedit.py	Sat Jul 22 17:56:50 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	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/formatter/text_html.py	Sat Jul 22 17:56:50 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))
@@ -433,7 +433,7 @@
         if newline:
             result.append('\n')
         return ''.join(result)
-        
+
     def endContent(self, newline=True):
         """ Close page content div.
 
@@ -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.
 
@@ -830,7 +830,7 @@
         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 = {
@@ -1304,7 +1304,7 @@
             result.append(self._close('div'))
 
         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	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/formatter/text_plain.py	Sat Jul 22 17:56:50 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	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/formatter/text_python.py	Sat Jul 22 17:56:50 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	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/formatter/text_xml.py	Sat Jul 22 17:56:50 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
--- a/MoinMoin/logfile/__init__.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/logfile/__init__.py	Sat Jul 22 17:56:50 2006 +0200
@@ -67,7 +67,7 @@
         while i < length:
             result = self.offsets[i-1] + tmp
             tmp = self.offsets[i]
-            self.offsets[i] =  result
+            self.offsets[i] = result
             i = i + 1
         self.offsets[0] = offset
 
@@ -79,7 +79,7 @@
     Overwrite .parser() and .add() to customize this class to
     special log files
     """
-    
+
     def __init__(self, filename, buffer_size=65536):
         """
         @param filename: name of the log file
@@ -106,7 +106,7 @@
             except StopIteration:
                 return
             yield result
-            
+
     def sanityCheck(self):
         """ Check for log file write access.
         
@@ -122,7 +122,7 @@
         """
         generate some attributes when needed
         """
-        if name=="_LogFile__rel_index":
+        if name == "_LogFile__rel_index":
             # starting iteration from begin
             self.__buffer1 = LineBuffer(self._input, 0, self.buffer_size)
             self.__buffer2 = LineBuffer(self._input,
@@ -164,7 +164,7 @@
             return os.path.getsize(self.__filename)
         except OSError, err:
             if err.errno == errno.ENOENT:
-                return 0            
+                return 0
             raise
 
     def lines(self):
@@ -194,7 +194,7 @@
     def date(self):
         """ Return timestamp of log file in usecs """
         try:
-            mtime = os.path.getmtime(self.__filename)            
+            mtime = os.path.getmtime(self.__filename)
         except OSError, err:
             if err.errno == errno.ENOENT:
                 # This can happen on fresh wiki when building the index
@@ -237,7 +237,7 @@
                     self.__rel_index = (self.__rel_index +
                                         self.__buffer1.len)
                     self.__buffer = self.__buffer1
-                
+
         while self.__rel_index >= self.__buffer.len:
             if self.__buffer == self.__buffer1:
                 # change to buffer 2
@@ -248,7 +248,7 @@
                 tmpbuff = LineBuffer(self._input,
                                      self.__buffer1.offsets[-1],
                                      self.buffer_size)
-                if tmpbuff.len==0:
+                if tmpbuff.len == 0:
                     # end of file
                     if self.__lineno:
                         self.__lineno = (self.__lineno + lines -
@@ -258,7 +258,7 @@
                     return True
                 # shift buffers
                 self.__buffer1 = self.__buffer2
-                self.__buffer2 = tmpbuff                
+                self.__buffer2 = tmpbuff
                 self.__rel_index = self.__rel_index - self.__buffer1.len
         if self.__lineno: self.__lineno += lines
         return False
@@ -278,15 +278,16 @@
         XXX It does not raise anything!
         """
         result = None
-        while result == None:
-            while result == None:
+        while result is None:
+            while result is None:
                 result = self.__next()
             if self.filter and not self.filter(result):
                 result = None
         return result
-    
+
     def __previous(self):
-        if self.peek(-1): raise StopIteration
+        if self.peek(-1):
+            raise StopIteration
         return self.parser(self.__buffer.lines[self.__rel_index])
 
     def previous(self):
@@ -295,8 +296,8 @@
         raises StopIteration at file begin
         """
         result = None
-        while result == None:
-            while result == None:
+        while result is None:
+            while result is None:
                 result = self.__previous()
             if self.filter and not self.filter(result):
                 result = None
@@ -319,16 +320,16 @@
         """moves file position to the end"""
         self._input.seek(0, 2) # to end of file
         size = self._input.tell()
-        if (not self.__buffer2) or (size>self.__buffer2.offsets[-1]):
+        if (not self.__buffer2) or (size > self.__buffer2.offsets[-1]):
             self.__buffer2 = LineBuffer(self._input,
                                         size,
                                         self.buffer_size,
-                                        forward = False)
-            
+                                        forward=False)
+
             self.__buffer1 = LineBuffer(self._input,
                                         self.__buffer2.offsets[0],
                                         self.buffer_size,
-                                        forward = False)
+                                        forward=False)
         self.__buffer = self.__buffer2
         self.__rel_index = self.__buffer2.len
         self.__lineno = None
@@ -341,7 +342,7 @@
         For this plain file implementation position is an Integer.
         """
         return self.__buffer.offsets[self.__rel_index]
-        
+
     def seek(self, position, line_no=None):
         """ moves file position to an value formerly gotten from .position().
         To enable line counting line_no must be provided.
@@ -362,7 +363,7 @@
             self.__buffer1 = LineBuffer(self._input,
                                         position,
                                         self.buffer_size,
-                                        forward = False)
+                                        forward=False)
             self.__buffer2 = LineBuffer(self._input,
                                         position,
                                         self.buffer_size)
@@ -374,7 +375,7 @@
     def line_no(self):
         """@return: the current line number or None if line number is unknown"""
         return self.__lineno
-    
+
     def calculate_line_no(self):
         """ Calculate the current line number from buffer offsets
         
@@ -404,14 +405,14 @@
         """
         line = "\t".join(data)
         self._add(line)
-        
+
     def _add(self, line):
         """
         @param line: flat line
         @type line: String
         write on entry in the log file
         """
-        if line != None:
+        if line is not None:
             if line[-1] != '\n':
                 line += '\n'
             self._output.write(line)
--- a/MoinMoin/logfile/editlog.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/logfile/editlog.py	Sat Jul 22 17:56:50 2006 +0200
@@ -34,8 +34,9 @@
 
     def is_from_current_user(self, request):
         user = request.user
-        if user.id: return user.id==self.userid
-        return request.remote_addr==self.addr        
+        if user.id:
+            return user.id == self.userid
+        return request.remote_addr == self.addr
 
     def getEditorData(self, request):
         """ Return a tuple of type id and string or Page object
@@ -112,7 +113,7 @@
                     request.formatter.url(0))
         elif kind == 'ip':
             idx = info.find('.')
-            if idx==-1:
+            if idx == -1:
                 idx = len(info)
             title = wikiutil.escape('???' + title)
             text = wikiutil.escape(info[:idx])
@@ -124,7 +125,7 @@
 class EditLog(LogFile):
 
     def __init__(self, request, filename=None, buffer_size=65536, **kw):
-        if filename == None:
+        if filename is None:
             rootpagename = kw.get('rootpagename', None)
             if rootpagename:
                 filename = Page(request, rootpagename).getPagePath('edit-log', isfile=1)
@@ -133,7 +134,7 @@
         LogFile.__init__(self, filename, buffer_size)
         self._NUM_FIELDS = 9
         self._usercache = {}
-        
+
         # Used by antispam in order to show an internal name instead
         # of a confusing userid
         self.uid_override = kw.get('uid_override', None)
@@ -155,16 +156,16 @@
                     hostname = host
             else:
                 hostname = host
-            
-            remap_chars = {u'\t': u' ', u'\r': u' ', u'\n': u' ',}
+
+            remap_chars = {u'\t': u' ', u'\r': u' ', u'\n': u' ', }
             comment = comment.translate(remap_chars)
             user_id = request.user.valid and request.user.id or ''
 
-            if self.uid_override != None:
+            if self.uid_override is not None:
                 user_id = ''
                 hostname = self.uid_override
                 host = ''
-            
+
             line = u"\t".join((str(long(mtime)), # has to be long for py 2.2.x
                                "%08d" % rev,
                                action,
@@ -193,16 +194,16 @@
         result.pagename = wikiutil.unquoteWikiname(result.pagename.encode('ascii'))
         result.ed_time_usecs = long(result.ed_time_usecs or '0') # has to be long for py 2.2.x
         return result
-    
+
     def set_filter(self, **kw):
         expr = "1"
         for field in ['pagename', 'addr', 'hostname', 'userid']:
             if kw.has_key(field):
                 expr = "%s and x.%s == %s" % (expr, field, `kw[field]`)
-                
+
         if kw.has_key('ed_time_usecs'):
             expr = "%s and long(x.ed_time_usecs) == %s" % (expr, long(kw['ed_time_usecs'])) # must be long for py 2.2.x
 
         self.filter = eval("lambda x: " + expr)
-    
 
+
--- a/MoinMoin/logfile/eventlog.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/logfile/eventlog.py	Sat Jul 22 17:56:50 2006 +0200
@@ -10,9 +10,9 @@
 from MoinMoin.util import web
 
 class EventLog(LogFile):
-    
+
     def __init__(self, request, filename=None, buffer_size=65536, **kw):
-        if filename == None:
+        if filename is None:
             rootpagename = kw.get('rootpagename', None)
             if rootpagename:
                 from MoinMoin.Page import Page
@@ -28,7 +28,7 @@
         """
         if request.isSpiderAgent:
             return
-        
+
         if mtime_usecs is None:
             mtime_usecs = wikiutil.timestamp2version(time.time())
 
@@ -52,9 +52,9 @@
             # badly formatted line in file, skip it
             return None
         return long(time_usecs), eventtype, wikiutil.parseQueryString(kvpairs)
-                                                                        
-    def set_filter(self, event_types = None):
-        if event_types == None:
+
+    def set_filter(self, event_types=None):
+        if event_types is None:
             self.filter = None
         else:
             self.filter = lambda line: (line[1] in event_types)
--- a/MoinMoin/macro/EditedSystemPages.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/macro/EditedSystemPages.py	Sat Jul 22 17:56:50 2006 +0200
@@ -44,7 +44,7 @@
             result.append(f.pagelink(0, name))
             result.append(f.listitem(0))
         result.append(f.number_list(0))
- 
+
         return ''.join(result)
 
 
--- a/MoinMoin/macro/Include.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/macro/Include.py	Sat Jul 22 17:56:50 2006 +0200
@@ -45,7 +45,7 @@
         h = title.strip()
         level = 1
         while h[level:level+1] == '=': level = level+1
-        depth = min(5,level)
+        depth = min(5, level)
         title_text = h[level:-level].strip()
         titles.append((title_text, level))
     return titles
@@ -65,7 +65,7 @@
 
     # prepare including page
     result = []
-    print_mode = macro.form.has_key('action') and macro.form['action'][0] in ("print", "format")
+    print_mode = request.action in ("print", "format")
     this_page = macro.formatter.page
     if not hasattr(this_page, '_macroInclude_pagelist'):
         this_page._macroInclude_pagelist = {}
@@ -177,7 +177,7 @@
 
         if not hasattr(request, "_Include_backto"):
             request._Include_backto = this_page.page_name
-        
+
         # do headings
         level = None
         if args.group('heading') and args.group('hquote'):
--- a/MoinMoin/macro/MonthCalendar.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/macro/MonthCalendar.py	Sat Jul 22 17:56:50 2006 +0200
@@ -240,7 +240,7 @@
 _arg_anniversary = r',\s*(?P<anniversary>[+-]?\d+)?\s*'
 _arg_template = r',\s*(?P<template>[^, ]+)?\s*' # XXX see basepage comment
 _args_re_pattern = r'^(%s)?(%s)?(%s)?(%s)?(%s)?(%s)?(%s)?(%s)?$' % \
-                     (_arg_basepage, _arg_year, _arg_month, \
+                     (_arg_basepage, _arg_year, _arg_month,
                       _arg_offset, _arg_offset2, _arg_height6, _arg_anniversary, _arg_template)
 
 
--- a/MoinMoin/macro/Navigation.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/macro/Navigation.py	Sat Jul 22 17:56:50 2006 +0200
@@ -74,8 +74,7 @@
         self._ = self.macro.request.getText
 
         self.pagename = self.macro.formatter.page.page_name
-        self.print_mode = self.macro.request.form.has_key('action') \
-            and self.macro.request.form['action'][0] == 'print'
+        self.print_mode = self.macro.request.action == 'print'
         self.media = self.macro.request.form.get('media', [None])[0]
         self.querystr = self.print_mode and self.PROJECTION or ''
 
--- a/MoinMoin/macro/__init__.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/macro/__init__.py	Sat Jul 22 17:56:50 2006 +0200
@@ -66,20 +66,20 @@
     defaultDependency = ["time"]
 
     Dependencies = {
-        "TitleSearch" : ["namespace"],
-        "Goto"        : [],
-        "WordIndex"   : ["namespace"],
-        "TitleIndex"  : ["namespace"],
-        "InterWiki"   : ["pages"],  # if interwikimap is editable
-        "PageCount"   : ["namespace"],
-        "Icon"        : ["user"], # users have different themes and user prefs
-        "PageList"    : ["namespace"],
-        "Date"        : ["time"],
-        "DateTime"    : ["time"],
-        "UserPreferences" :["time"],
-        "Anchor"      : [],
-        "Mailto"      : ["user"],
-        "GetVal"      : ["pages"],
+        "TitleSearch": ["namespace"],
+        "Goto": [],
+        "WordIndex": ["namespace"],
+        "TitleIndex": ["namespace"],
+        "InterWiki": ["pages"],  # if interwikimap is editable
+        "PageCount": ["namespace"],
+        "Icon": ["user"], # users have different themes and user prefs
+        "PageList": ["namespace"],
+        "Date": ["time"],
+        "DateTime": ["time"],
+        "UserPreferences": ["time"],
+        "Anchor": [],
+        "Mailto": ["user"],
+        "GetVal": ["pages"],
         "TemplateList": ["namespace"],
         }
 
--- a/MoinMoin/request/__init__.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/request/__init__.py	Sat Jul 22 17:56:50 2006 +0200
@@ -141,11 +141,13 @@
             #    # no extra path after script name
             #    rootname = u""
 
-            self.args = {}
-            self.form = {}
-
-            if not self.query_string.startswith('action=xmlrpc'):
+            if self.query_string.startswith('action=xmlrpc'):
+                self.args = {}
+                self.form = {}
+                self.action = 'xmlrpc'
+            else:
                 self.args = self.form = self.setup_args()
+                self.action = self.form.get('action', ['show'])[0]
 
             rootname = u''
             self.rootpage = Page(self, rootname, is_rootpage=1)
@@ -156,7 +158,7 @@
 
             self.user = self.get_user_from_form()
 
-            if not self.query_string.startswith('action=xmlrpc'):
+            if self.action != 'xmlrpc':
                 if not self.forbidden and self.isForbidden():
                     self.makeForbidden403()
                 if not self.forbidden and self.surge_protect():
@@ -181,7 +183,7 @@
         current_id = validuser and self.user.name or self.remote_addr
         if not validuser and current_id.startswith('127.'): # localnet
             return False
-        current_action = self.form.get('action', ['show'])[0]
+        current_action = self.action
 
         limits = self.cfg.surge_action_limits
         default_limit = self.cfg.surge_action_limits.get('default', (30, 60))
@@ -863,11 +865,12 @@
         forbidden = 0
         # we do not have a parsed query string here, so we can just do simple matching
         qs = self.query_string
+        action = self.action
         if ((qs != '' or self.request_method != 'GET') and
-            not 'action=rss_rc' in qs and
+            action != 'rss_rc' and
             # allow spiders to get attachments and do 'show'
-            not ('action=AttachFile' in qs and 'do=get' in qs) and
-            not 'action=show' in qs
+            not (action == 'AttachFile' and 'do=get' in qs) and
+            action != 'show'
             ):
             forbidden = self.isSpiderAgent
 
@@ -1028,22 +1031,19 @@
         self.html_formatter = Formatter(self)
         self.formatter = self.html_formatter
 
-        if self.query_string == 'action=xmlrpc':
+        action_name = self.action
+        if action_name == 'xmlrpc':
             from MoinMoin import xmlrpc
-            xmlrpc.xmlrpc(self)
-            return self.finish()
-
-        if self.query_string == 'action=xmlrpc2':
-            from MoinMoin import xmlrpc
-            xmlrpc.xmlrpc2(self)
+            if self.query_string == 'action=xmlrpc':
+                xmlrpc.xmlrpc(self)
+            elif self.query_string == 'action=xmlrpc2':
+                xmlrpc.xmlrpc2(self)
             return self.finish()
 
         # parse request data
         try:
             self.initTheme()
 
-            action_name = self.form.get('action', ['show'])[0]
-
             # The last component in path_info is the page name, if any
             path = self.getPathinfo()
             if path.startswith('/'):
--- a/MoinMoin/script/cli/__init__.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/script/cli/__init__.py	Sat Jul 22 17:56:50 2006 +0200
@@ -1,6 +1,6 @@
 # -*- coding: iso-8859-1 -*-
 """
-    MoinMoin - Migration Script Package
+    MoinMoin - CLI usage Script Package
 
     @copyright: 2006 by Thomas Waldmann
     @license: GNU GPL, see COPYING for details.
@@ -9,6 +9,6 @@
 from MoinMoin.util import pysupport
 
 # create a list of extension scripts from the subpackage directory
-migration_scripts = pysupport.getPackageModules(__file__)
-modules = migration_scripts
+cli_scripts = pysupport.getPackageModules(__file__)
+modules = cli_scripts
 
--- a/MoinMoin/theme/__init__.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/theme/__init__.py	Sat Jul 22 17:56:50 2006 +0200
@@ -20,9 +20,9 @@
     use without rewriting the same code. If you want to change certain 
     elements, override them. 
     """
-    
+
     name = 'base'
-    
+
     # fake _ function to get gettext recognize those texts:
     _ = lambda x: x
 
@@ -64,7 +64,7 @@
         # search forms
         'searchbutton': ("[?]",                  "moin-search.png", 12, 12),
         'interwiki':  ("[%(wikitag)s]",          "moin-inter.png",  16, 16),
-    
+
         # smileys (this is CONTENT, but good looking smileys depend on looking
         # adapted to the theme background color and theme style in general)
         #vvv    ==      vvv  this must be the same for GUI editor converter
@@ -86,7 +86,7 @@
         ':\\':        (":\\",                    'ohwell.png',      15, 15),
         '>:>':        (">:>",                    'devil.png',       15, 15),
         '|)':         ("|)",                     'tired.png',       15, 15),
-        
+
         # some folks use noses in their emoticons
         ':-(':        (":-(",                    'sad.png',         15, 15),
         ':-)':        (":-)",                    'smile.png',       15, 15),
@@ -94,7 +94,7 @@
         ':-))':       (":-))",                   'smile3.png',      15, 15),
         ';-)':        (";-)",                    'smile4.png',      15, 15),
         '|-)':        ("|-)",                    'tired.png',       15, 15),
-        
+
         # version 1.0
         '(./)':       ("(./)",                   'checkmark.png',   20, 15),
         '{OK}':       ("{OK}",                   'thumbs-up.png',   14, 12),
@@ -135,7 +135,7 @@
         # media         basename
         ('all',         'common'),
         ('all',         'projection'),
-       )   
+       )
 
     stylesheetsCharset = 'utf-8'
 
@@ -157,7 +157,7 @@
         @return: the image href
         """
         return "%s/%s/img/%s" % (self.cfg.url_prefix, self.name, img)
-        
+
     def emit_custom_html(self, html):
         """
         generate custom HTML code in `html`
@@ -204,7 +204,7 @@
             link = wikiutil.link_tag(self.request, pagename, self.request.cfg.interwikiname or 'Self')
             html = u'<div id="interwiki"><span>%s</span></div>' % link
         return html
-        
+
     def title(self, d):
         """ Assemble the title (now using breadcrumbs)
         
@@ -246,7 +246,7 @@
         """
         request = self.request
         _ = request.getText
-        
+
         userlinks = []
         # Add username/homepage link for registered users. We don't care
         # if it exists, the user can create it.
@@ -261,11 +261,11 @@
             homelink = (request.formatter.interwikilink(1, title=title, id="userhome", *interwiki) +
                         request.formatter.text(name) +
                         request.formatter.interwikilink(0, title=title, id="userhome", *interwiki))
-            userlinks.append(homelink)        
+            userlinks.append(homelink)
             # link to userprefs action
             userlinks.append(d['page'].link_to(request, text=_('Preferences'),
                                                querystr={'action': 'userprefs'}, id='userprefs', rel='nofollow'))
-           
+
         if request.cfg.show_login:
             if request.user.valid:
                 userlinks.append(d['page'].link_to(request, text=_('Logout', formatted=False),
@@ -295,7 +295,7 @@
         @return: pagename or url, link to page or url
         """
         request = self.request
-        
+
         # Handle [pagename title] or [url title] formats
         if text.startswith('[') and text.endswith(']'):
             try:
@@ -343,10 +343,10 @@
                         page +
                         self.request.formatter.interwikilink(False, interwiki, page)
                         )
-        
+
         except ValueError:
             pass
-                  
+
         pagename = request.normalizePagename(pagename)
         link = Page(request, pagename).link_to(request, title)
 
@@ -375,10 +375,10 @@
                 half, left = divmod(maxLength - 3, 2)
                 name = u'%s...%s' % (name[:half + left], name[-half:])
         return name
-        
+
     def maxPagenameLength(self):
         """ Return maximum length for shortened page names """
-        return 25 
+        return 25
 
     def navibar(self, d):
         """ Assemble the navibar
@@ -461,9 +461,9 @@
                 alt, icon, w, h = self.iconsByFile[icon]
             else:
                 alt, icon, w, h = '', icon, '', ''
-                
+
         return alt, self.img_url(icon), w, h
-   
+
     def make_icon(self, icon, vars=None):
         """
         This is the central routine for making <img> tags for icons!
@@ -527,13 +527,13 @@
             close = d['page'].link_to(self.request,
                                       text=_('Clear message'),
                                       querystr={'action': 'show'})
-            html = u'<p>%s</p>\n<div class="buttons">%s</div>\n' % (msg, close) 
+            html = u'<p>%s</p>\n<div class="buttons">%s</div>\n' % (msg, close)
         else:
             # msg is a widget
             html = msg.render()
 
         return u'<div id="message">\n%s\n</div>\n' % html
-        
+
     def trail(self, d):
         """ Assemble page trail
         
@@ -559,7 +559,7 @@
                             continue
                         else:
                             pagename = page
-                            
+
                     except ValueError:
                         pass
                     page = Page(request, pagename)
@@ -606,9 +606,10 @@
         for media, csshref in self.request.cfg.stylesheets:
             html.append(link % (self.stylesheetsCharset, media, csshref))
 
-        
+
         # tribute to the most sucking browser...
-        if self.cfg.hacks.get('ie7', False):
+        if self.cfg.hacks.get('ie7', False) and self.request.action != 'edit':
+            # using FCKeditor and IE7 at the same time makes nices crashes in IE
             html.append("""
 <!-- compliance patch for microsoft browsers -->
 <!--[if lt IE 7]>
@@ -619,7 +620,7 @@
         # Add user css url (assuming that user css uses same charset)
         if usercss and usercss.lower() != "none":
             html.append(link % (self.stylesheetsCharset, 'all', usercss))
-            
+
         return '\n'.join(html)
 
     def shouldShowPageinfo(self, page):
@@ -640,10 +641,9 @@
             contentActions = [u'', u'show', u'refresh', u'preview', u'diff',
                               u'subscribe', u'RenamePage', u'DeletePage',
                               u'SpellCheck', u'print']
-            action = self.request.form.get('action', [''])[0]
-            return action in contentActions
+            return self.request.action in contentActions
         return False
-    
+
     def pageinfo(self, page):
         """ Return html fragment with page meta data
 
@@ -673,7 +673,7 @@
                     'info': info
                     }
         return html
-    
+
     def searchform(self, d):
         """
         assemble HTML code for the search forms
@@ -685,10 +685,10 @@
         _ = self.request.getText
         form = self.request.form
         updates = {
-            'search_label' : _('Search:'),
+            'search_label': _('Search:'),
             'search_value': wikiutil.escape(form.get('value', [''])[0], 1),
-            'search_full_label' : _('Text', formatted=False),
-            'search_title_label' : _('Titles', formatted=False),
+            'search_full_label': _('Text', formatted=False),
+            'search_title_label': _('Titles', formatted=False),
             }
         d.update(updates)
 
@@ -732,7 +732,7 @@
             html = (u'<div id="version">MoinMoin Release %s [Revision %s], '
                      'Copyright 2000-2006 by Juergen Hermann</div>') % (version.release, version.revision, )
         return html
-    
+
     def headscript(self, d):
         """ Return html head script with common functions
 
@@ -747,9 +747,9 @@
         @return: script for html head
         """
         # Don't add script for print view
-        if self.request.form.get('action', [''])[0] == 'print':
+        if self.request.action == 'print':
             return u''
-        
+
         _ = self.request.getText
         script = u"""
 <script type=\"text/javascript\">
@@ -820,10 +820,10 @@
 //-->
 </script>
 """ % {
-    'search_hint' : _('Search', formatted=False),
+    'search_hint': _('Search', formatted=False),
     }
         return script
-    
+
     def shouldUseRSS(self):
         """ Return True if rss feature is available, or False
 
@@ -837,16 +837,16 @@
         except ImportError:
             # This error reported on Python 2.2
             return False
-        
+
     def rsshref(self):
         """ Create rss href, used for rss button and head link
         
         @rtype: unicode
         @return: rss href
         """
-        return (u'%s/RecentChanges?action=rss_rc&amp;ddiffs=1&amp;unique=1' 
+        return (u'%s/RecentChanges?action=rss_rc&amp;ddiffs=1&amp;unique=1'
                 % self.request.getScriptname())
-                           
+
     def rsslink(self):
         """ Create rss link in head, used by FireFox
 
@@ -863,7 +863,7 @@
                         self.cfg.sitename,
                         self.rsshref() )
         return link
-       
+
     def html_head(self, d):
         """ Assemble html head
         
@@ -917,7 +917,7 @@
         """
         request = self.request
         _ = request.getText
-        
+
         menu = [
             'raw',
             'print',
@@ -964,7 +964,7 @@
         # "disabled", e.g IE, Safari
         # for XHTML: data['disabled'] = ' disabled="disabled"'
         disabled = ' disabled class="disabled"'
-        
+
         # Format standard actions
         available = request.getAvailableActions(page)
         for action in menu:
@@ -984,7 +984,7 @@
             # Actions which are not available for this wiki, user or page
             if (action == '__separator__' or
                 (action[0].isupper() and not action in available)):
-                data['disabled'] = disabled               
+                data['disabled'] = disabled
 
             options.append(option % data)
 
@@ -1034,9 +1034,9 @@
 </script>
 </form>
 ''' % data
-        
-        return html      
-        
+
+        return html
+
     def editbar(self, d):
         """ Assemble the page edit bar.
 
@@ -1057,7 +1057,7 @@
                              for item in self.editbarItems(page) if item])
             html = u'<ul class="editbar">%s</ul>\n' % items
             self._cache['editbar'] = html
-        
+
         return html
 
     def shouldShowEditbar(self, page):
@@ -1077,7 +1077,7 @@
         if (page.exists(includeDeleted=1) and
             self.request.user.may.read(page.page_name)):
             form = self.request.form
-            action = form.get('action', [''])[0]
+            action = self.request.action
             # Do not show editbar on edit but on save/cancel
             return not (action == 'edit' and
                         not form.has_key('button_save') and
@@ -1095,7 +1095,8 @@
                 self.subscribeLink(page),
                 self.quicklinkLink(page),
                 self.attachmentsLink(page),
-                self.actionsMenu(page),]
+                self.actionsMenu(page),
+               ]
 
     def guiworks(self, page):
         """ Return whether the gui editor / converter can work for that page.
@@ -1103,7 +1104,7 @@
             The GUI editor currently only works for wiki format.
         """
         return page.pi_format == 'wiki'
-        
+
     def editorLink(self, page):
         """ Return a link to the editor 
         
@@ -1115,11 +1116,11 @@
         if not (page.isWritable() and
                 self.request.user.may.write(page.page_name)):
             return self.disabledEdit()
-        
+
         _ = self.request.getText
         params = (wikiutil.quoteWikinameURL(page.page_name) +
                   '?action=edit&amp;editor=')
-        
+
         guiworks = self.guiworks(page)
         if self.showBothEditLinks() and guiworks:
             text = _('Edit (Text)', formatted=False)
@@ -1134,7 +1135,7 @@
             else:
                 params = params + 'text'
                 attrs = {'name': 'texteditlink', 'rel': 'nofollow', }
-        
+
         return wikiutil.link_tag(self.request, params, text, **attrs)
 
     def showBothEditLinks(self):
@@ -1164,21 +1165,22 @@
 var gui_editor_link_text = "%(text)s";
 </script>        
 """ % {'url': page.url(self.request),
-       'text': _('Edit (GUI)', formatted=False),}
+       'text': _('Edit (GUI)', formatted=False),
+      }
 
     def disabledEdit(self):
         """ Return a disabled edit link """
         _ = self.request.getText
-        return ('<span class="disabled">%s</span>' 
+        return ('<span class="disabled">%s</span>'
                 % _('Immutable Page', formatted=False))
-        
+
     def infoLink(self, page):
         """ Return link to page information """
         _ = self.request.getText
         return page.link_to(self.request,
-                            text=_('Info', formatted=False), 
+                            text=_('Info', formatted=False),
                             querystr='action=info', rel='nofollow')
-    
+
     def subscribeLink(self, page):
         """ Return subscribe/unsubscribe link to valid users
         
@@ -1187,7 +1189,7 @@
         """
         if not (self.cfg.mail_enabled and self.request.user.valid):
             return ''
-        
+
         _ = self.request.getText
         if self.request.user.isSubscribedTo([page.page_name]):
             text = _("Unsubscribe", formatted=False)
@@ -1204,7 +1206,7 @@
         """
         if not self.request.user.valid:
             return ''
-        
+
         _ = self.request.getText
         if self.request.user.isQuickLinkedTo([page.page_name]):
             text = _("Remove Link", formatted=False)
@@ -1217,7 +1219,7 @@
         """ Return link to page attachments """
         _ = self.request.getText
         return page.link_to(self.request,
-                            text=_('Attachments', formatted=False), 
+                            text=_('Attachments', formatted=False),
                             querystr='action=AttachFile', rel='nofollow')
 
     def startPage(self):
@@ -1227,15 +1229,15 @@
         @return: page div with language and direction attribtues
         """
         return u'<div id="page"%s>\n' % self.content_lang_attr()
-            
+
     def endPage(self):
         """ End page div 
         
         Add an empty page bottom div to prevent floating elements to
         float out of the page bottom over the footer.
         """
-        return '<div id="pagebottom"></div>\n</div>\n'        
-    
+        return '<div id="pagebottom"></div>\n</div>\n'
+
     # Public functions #####################################################
 
     def header(self, d, **kw):
@@ -1249,9 +1251,9 @@
         @return: page header html
         """
         return self.startPage()
-    
+
     editorheader = header
-        
+
     def footer(self, d, **keywords):
         """ Assemble page footer
         
@@ -1278,40 +1280,40 @@
         _ = self.request.getText
         html = []
         html.append('<tr>\n')
-        
+
         html.append('<td class="rcicon1">%(icon_html)s</td>\n' % d)
-        
+
         html.append('<td class="rcpagelink">%(pagelink_html)s</td>\n' % d)
-        
+
         html.append('<td class="rctime">')
         if d['time_html']:
             html.append("%(time_html)s" % d)
         html.append('</td>\n')
 
         html.append('<td class="rcicon2">%(info_html)s</td>\n' % d)
-        
+
         html.append('<td class="rceditor">')
         if d['editors']:
             html.append('<br>'.join(d['editors']))
         html.append('</td>\n')
-            
+
         html.append('<td class="rccomment">')
         if d['comments']:
             if d['changecount'] > 1:
                 notfirst = 0
                 for comment in d['comments']:
                     html.append('%s<tt>#%02d</tt>&nbsp;%s' % (
-                        notfirst and '<br>' or '' , comment[0], comment[1]))
+                        notfirst and '<br>' or '', comment[0], comment[1]))
                     notfirst = 1
             else:
                 comment = d['comments'][0]
                 html.append('%s' % comment[1])
         html.append('</td>\n')
-           
+
         html.append('</tr>\n')
-        
+
         return ''.join(html)
-    
+
     def recentchanges_daybreak(self, d):
         """
         Assemble a rc daybreak indication (table row)
@@ -1338,7 +1340,7 @@
         @return: recentchanges header html
         """
         _ = self.request.getText
-        
+
         # Should use user interface language and direction
         html = '<div class="recentchanges"%s>\n' % self.ui_lang_attr()
         html += '<div>\n'
@@ -1366,7 +1368,7 @@
                             self.request.formatter, rel='nofollow'))
             days = ' | '.join(days)
             html += (_("Show %s days.") % (days,))
-        
+
         if d['rc_update_bookmark']:
             html += " %(rc_update_bookmark)s %(rc_curr_bookmark)s" % d
 
@@ -1392,7 +1394,7 @@
         return html
 
     # Language stuff ####################################################
-    
+
     def ui_lang_attr(self):
         """Generate language attributes for user interface elements
 
@@ -1439,14 +1441,14 @@
         """
         request = self.request
         _ = request.getText
-        
+
         if keywords.has_key('page'):
             page = keywords['page']
             pagename = page.page_name
         else:
             pagename = keywords.get('pagename', '')
             page = Page(request, pagename)
-        
+
         scriptname = request.getScriptname()
         pagename_quoted = wikiutil.quoteWikinameURL(pagename)
 
@@ -1461,7 +1463,7 @@
         page_find_page = wikiutil.getSysPage(request, 'FindPage').page_name
         home_page = wikiutil.getInterwikiHomePage(request) # XXX sorry theme API change!!! Either None or tuple (wikiname,pagename) now.
         page_parent_page = getattr(page.getParentPage(), 'page_name', None)
-        
+
         # Prepare the HTML <head> element
         user_head = [request.cfg.html_head]
 
@@ -1492,7 +1494,7 @@
                           page_title_index, 'TitleIndex',
                           page_find_page, 'FindPage',
                           page_site_navigation, 'SiteNavigation',
-                          'RecentChanges',]:
+                          'RecentChanges', ]:
             user_head.append(request.cfg.html_head_index)
         # if it is a normal page, index it, but do not follow the links, because
         # there are a lot of illegal links (like actions) or duplicates:
@@ -1501,7 +1503,7 @@
 
         if keywords.has_key('pi_refresh') and keywords['pi_refresh']:
             user_head.append('<meta http-equiv="refresh" content="%(delay)d;URL=%(url)s">' % keywords['pi_refresh'])
-        
+
         # output buffering increases latency but increases throughput as well
         output = []
         # later: <html xmlns=\"http://www.w3.org/1999/xhtml\">
@@ -1566,7 +1568,7 @@
             '<link rel="Glossary" href="%s/%s">\n' % (scriptname, wikiutil.quoteWikinameURL(page_word_index)),
             '<link rel="Help" href="%s/%s">\n' % (scriptname, wikiutil.quoteWikinameURL(page_help_formatting)),
                       ])
-        
+
         output.append("</head>\n")
         request.write(''.join(output))
         output = []
@@ -1590,7 +1592,7 @@
 
         # Set body to the user interface language and direction
         bodyattr.append(' %s' % self.ui_lang_attr())
-        
+
         body_onload = keywords.get('body_onload', '')
         if body_onload:
             bodyattr.append(''' onload="%s"''' % body_onload)
@@ -1600,11 +1602,11 @@
 
         # If in print mode, start page div and emit the title
         if keywords.get('print_mode', 0):
-            d = {'title_text': text, 'title_link': None, 'page': page,}
+            d = {'title_text': text, 'title_link': None, 'page': page, }
             request.themedict = d
             output.append(self.startPage())
-            output.append(self.interwiki(d))      
-            output.append(self.title(d))      
+            output.append(self.interwiki(d))
+            output.append(self.title(d))
 
         # In standard mode, emit theme.header
         else:
@@ -1657,7 +1659,7 @@
                 output.append(self.editorheader(d))
             else:
                 output.append(self.header(d))
-        
+
         # emit it
         request.write(''.join(output))
         output = []
@@ -1693,8 +1695,7 @@
         request.clock.stop('total')
 
         # Close html code
-        if (request.cfg.show_timings and
-            request.form.get('action', [None])[0] != 'print'):
+        if request.cfg.show_timings and request.action != 'print':
             request.write('<ul id="timings">\n')
             for t in request.clock.dump():
                 request.write('<li>%s</li>\n' % t)
--- a/MoinMoin/theme/classic.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/theme/classic.py	Sat Jul 22 17:56:50 2006 +0200
@@ -22,7 +22,7 @@
     """ here are the functions generating the html responsible for
         the look and feel of your wiki site
     """
-    
+
     name = "classic"
 
     def footer(self, d, **keywords):
@@ -45,9 +45,9 @@
                  self.editbar(d, **keywords),
                  self.credits(d),
                  self.showversion(d, **keywords),
-                 
+
                  # Post footer custom html
-                 self.emit_custom_html(self.cfg.page_footer2),]
+                 self.emit_custom_html(self.cfg.page_footer2), ]
         return u'\n'.join(parts)
 
     def editbar(self, d, **keywords):
@@ -56,7 +56,7 @@
         parts = [u'<div id="footer">',
                  self.edit_link(d, **keywords),
                  self.availableactions(d),
-                 u'</div>',]
+                 u'</div>', ]
         return ''.join(parts)
 
     def iconbar(self, d):
@@ -82,7 +82,7 @@
                     iconbar.append('<li>%s</li>\n' % self.make_iconlink(icon, d))
             iconbar.append('</ul>\n')
         return ''.join(iconbar)
-    
+
     def header(self, d):
         """
         Assemble page header
@@ -95,10 +95,10 @@
             'config_header1_html': self.emit_custom_html(self.cfg.page_header1),
             'config_header2_html': self.emit_custom_html(self.cfg.page_header2),
             'search_form_html': self.searchform(d),
-            'logo_html':  self.logo(),
-            'interwiki_html':  self.interwiki(d),
-            'title_html':  self.title(d),
-            'username_html':  self.username(d),
+            'logo_html': self.logo(),
+            'interwiki_html': self.interwiki(d),
+            'title_html': self.title(d),
+            'username_html': self.username(d),
             'navibar_html': self.navibar(d),
             'iconbar_html': self.iconbar(d),
             'msg_html': self.msg(d),
@@ -160,7 +160,7 @@
         return html
 
     # Footer stuff #######################################################
-    
+
     def edit_link(self, d, **keywords):
         """
         Assemble EditText link (or indication that page cannot be edited)
@@ -172,7 +172,7 @@
         page = d['page']
         return  u'<ul class="editbar"><li>%s</li></ul>' % self.editorLink(page)
 
-    def availableactions(self, d):    
+    def availableactions(self, d):
         """
         assemble HTML code for the available actions
         
@@ -197,11 +197,11 @@
                 params = '%s?action=%s' % (d['q_page_name'], action)
                 link = wikiutil.link_tag(request, params, title, request.formatter, rel='nofollow')
                 html.append(link)
-                
+
         title = _("DeleteCache", formatted=False)
         params = '%s?action=%s' % (d['page_name'], 'refresh')
         link = wikiutil.link_tag(request, params, title, request.formatter, rel='nofollow')
-        
+
         cache = caching.CacheEntry(request, page, page.getFormatterName(), scope='item')
         date = request.user.getFormattedDateTime(cache.mtime())
         deletecache = u'<p>%s %s</p>' % (link, _('(cached %s)') % date)
--- a/MoinMoin/theme/modern.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/theme/modern.py	Sat Jul 22 17:56:50 2006 +0200
@@ -22,7 +22,7 @@
         html = [
             # Pre header custom html
             self.emit_custom_html(self.cfg.page_header1),
-            
+
             # Header
             u'<div id="header">',
             self.logo(),
@@ -39,10 +39,10 @@
             self.msg(d),
             self.editbar(d),
             u'</div>',
-            
+
             # Post header custom html (not recommended)
             self.emit_custom_html(self.cfg.page_header2),
-            
+
             # Start of page
             self.startPage(),
         ]
@@ -58,16 +58,16 @@
         html = [
             # Pre header custom html
             self.emit_custom_html(self.cfg.page_header1),
-            
+
             # Header
             u'<div id="header">',
             self.title(d),
             self.msg(d),
             u'</div>',
-            
+
             # Post header custom html (not recommended)
             self.emit_custom_html(self.cfg.page_header2),
-            
+
             # Start of page
             self.startPage(),
         ]
@@ -86,23 +86,23 @@
             # End of page
             self.pageinfo(page),
             self.endPage(),
-            
+
             # Pre footer custom html (not recommended!)
             self.emit_custom_html(self.cfg.page_footer1),
-            
+
             # Footer
             u'<div id="footer">',
             self.editbar(d),
             self.credits(d),
             self.showversion(d, **keywords),
             u'</div>',
-            
+
             # Post footer custom html
             self.emit_custom_html(self.cfg.page_footer2),
             ]
         return u'\n'.join(html)
 
-        
+
 def execute(request):
     """
     Generate and return a theme object
--- a/MoinMoin/theme/rightsidebar.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/theme/rightsidebar.py	Sat Jul 22 17:56:50 2006 +0200
@@ -25,7 +25,7 @@
             u'</div>',
             ]
         return u'\n'.join(html)
-    
+
     def pagepanel(self, d):
         """ Create page panel """
         _ = self.request.getText
@@ -37,15 +37,15 @@
                 u'</div>',
                 ]
             return u'\n'.join(html)
-        return ''   
-        
+        return ''
+
     def userpanel(self, d):
         """ Create user panel """
         _ = self.request.getText
 
         html = [
             u'<div class="sidepanel">',
-            u'<h1>%s</h1>' %  _("User"),
+            u'<h1>%s</h1>' % _("User"),
             self.username(d),
             u'</div>'
             ]
@@ -75,7 +75,7 @@
             u'</div>',
             self.trail(d),
             u'</div>',
-            
+
             # Custom html below header (not recomended!)
             self.emit_custom_html(self.cfg.page_header2),
 
@@ -87,12 +87,12 @@
             u'</div>',
 
             self.msg(d),
-            
+
             # Page
             self.startPage(),
             ]
         return u'\n'.join(html)
-    
+
     def editorheader(self, d):
         """
         Assemble page header for editor
@@ -112,7 +112,7 @@
             #self.searchform(d),
             #self.logo(),
             #u'</div>',
-            
+
             # Custom html below header (not recomended!)
             self.emit_custom_html(self.cfg.page_header2),
 
@@ -124,13 +124,13 @@
             u'</div>',
 
             self.msg(d),
-            
+
             # Page
             self.startPage(),
             #self.title(d),
             ]
         return u'\n'.join(html)
-    
+
     def footer(self, d, **keywords):
         """ Assemble wiki footer
         
@@ -144,16 +144,16 @@
             # End of page
             self.pageinfo(page),
             self.endPage(),
-            
+
             # Pre footer custom html (not recommended!)
             self.emit_custom_html(self.cfg.page_footer1),
-            
+
             # Footer
             u'<div id="footer">',
             self.credits(d),
             self.showversion(d, **keywords),
             u'</div>',
-            
+
             # Post footer custom html
             self.emit_custom_html(self.cfg.page_footer2),
             ]
--- a/MoinMoin/user.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/user.py	Sat Jul 22 17:56:50 2006 +0200
@@ -119,7 +119,7 @@
     pwd = '{SHA}' + base64.encodestring(pwd).rstrip()
     return pwd
 
-    
+
 def normalizeName(name):
     """ Make normalized user name
 
@@ -148,7 +148,7 @@
 
     return name
 
-    
+
 def isValidName(request, name):
     """ Validate user name
 
@@ -173,7 +173,7 @@
         if not item:
             continue
         line.append(item)
-        
+
     line = '\t'.join(line)
     return line
 
@@ -193,7 +193,7 @@
         items.append(item)
     return items
 
-    
+
 class User:
     """A MoinMoin User"""
 
@@ -220,7 +220,7 @@
         self.auth_username = auth_username
         self.auth_method = kw.get('auth_method', 'internal')
         self.auth_attribs = kw.get('auth_attribs', ())
-                                       
+
         # create some vars automatically
         self.__dict__.update(self._cfg.user_form_defaults)
 
@@ -254,7 +254,7 @@
         self.editor_default = self._cfg.editor_default
         self.editor_ui = self._cfg.editor_ui
         self.last_saved = str(time.time())
-        
+
         # attrs not saved to profile
         self._request = request
         self._trail = []
@@ -284,7 +284,7 @@
         else:
             from security import Default
             self.may = Default(self)
-        
+
         if self.language and not self.language in i18n.wikiLanguages():
             self.language = 'en'
 
@@ -299,7 +299,7 @@
         # and some other things identifying remote users, then we could also
         # use it reliably in edit locking
         from random import randint
-        return "%s.%d" % (str(time.time()), randint(0,65535))
+        return "%s.%d" % (str(time.time()), randint(0, 65535))
 
     def create_or_update(self, changed=False):
         """ Create or update a user profile
@@ -309,7 +309,7 @@
         if self._cfg.user_autocreate:
             if not self.valid and not self.disabled or changed: # do we need to save/update?
                 self.save() # yes, create/update user profile
-                                
+
     def __filename(self):
         """ Get filename of the user's file on disk
         
@@ -373,7 +373,7 @@
                 return
             # Check for a valid password, possibly changing encoding
             valid, changed = self._validatePassword(user_data)
-            if not valid: 
+            if not valid:
                 return
             else:
                 self.trusted = 1
@@ -395,7 +395,7 @@
             if hasattr(self, attr):
                 delattr(self, attr)
                 changed = 1
-        
+
         # make sure checkboxes are boolean
         for key, label in self._cfg.user_checkbox_fields:
             try:
@@ -458,12 +458,12 @@
 
         # Get the clear text password from the form (require non empty
         # password)
-        password = self._request.form.get('password',[None])[0]
+        password = self._request.form.get('password', [None])[0]
         if not password:
-            return False, False 
-                
+            return False, False
+
         # First get all available pre13 charsets on this system
-        pre13 = ['iso-8859-1', 'iso-8859-2', 'euc-jp', 'gb2312', 'big5',]
+        pre13 = ['iso-8859-1', 'iso-8859-2', 'euc-jp', 'gb2312', 'big5', ]
         available = []
         for charset in pre13:
             try:
@@ -471,7 +471,7 @@
                 available.append(charset)
             except LookupError:
                 pass # missing on this system
-                
+
         # Now try to match the password
         for charset in available:
             # Try to encode, failure is expected
@@ -506,7 +506,7 @@
 
         # !!! should write to a temp file here to avoid race conditions,
         # or even better, use locking
-        
+
         data = codecs.open(self.__filename(), "w", config.charset)
         data.write("# Data saved '%s' for id '%s'\n" % (
             time.strftime(self._cfg.datetime_fmt, time.localtime(time.time())),
@@ -624,7 +624,7 @@
         @return: pages this user has subscribed to
         """
         return self.subscribed_pages
-        
+
     def isSubscribedTo(self, pagelist):
         """ Check if user subscription matches any page in pagelist.
         
@@ -640,15 +640,15 @@
         """
         if not self.valid:
             return False
-        
-        import re        
+
+        import re
         # Create a new list with both names and interwiki names.
         pages = pagelist[:]
         if self._cfg.interwikiname:
             pages += [self._interWikiName(pagename) for pagename in pagelist]
         # Create text for regular expression search
         text = '\n'.join(pages)
-        
+
         for pattern in self.getSubscriptionList():
             # Try simple match first
             if pattern in pages:
@@ -673,15 +673,15 @@
         @type pagename: unicode
         @rtype: bool
         @return: if page was subscribed
-        """        
+        """
         if self._cfg.interwikiname:
             pagename = self._interWikiName(pagename)
-        
+
         if pagename not in self.subscribed_pages:
             self.subscribed_pages.append(pagename)
             self.save()
             return True
-        
+
         return False
 
     def unsubscribe(self, pagename):
@@ -710,16 +710,16 @@
         if pagename in self.subscribed_pages:
             self.subscribed_pages.remove(pagename)
             changed = True
-        
-        interWikiName = self._interWikiName(pagename)        
+
+        interWikiName = self._interWikiName(pagename)
         if interWikiName and interWikiName in self.subscribed_pages:
             self.subscribed_pages.remove(interWikiName)
             changed = True
-    
+
         if changed:
             self.save()
         return not self.isSubscribedTo([pagename])
-        
+
     # -----------------------------------------------------------------
     # Quicklinks
 
@@ -740,14 +740,14 @@
         """
         if not self.valid:
             return False
-            
+
         for pagename in pagelist:
             if pagename in self.quicklinks:
                 return True
             interWikiName = self._interWikiName(pagename)
             if interWikiName and interWikiName in self.quicklinks:
                 return True
-        
+
         return False
 
     def addQuicklink(self, pagename):
@@ -796,8 +796,8 @@
             changed = True
         if pagename in self.quicklinks:
             self.quicklinks.remove(pagename)
-            changed = True        
-        
+            changed = True
+
         if changed:
             self.save()
         return changed
@@ -810,7 +810,7 @@
         """
         if not self._cfg.interwikiname:
             return None
-            
+
         return "%s:%s" % (self._cfg.interwikiname, pagename)
 
     # -----------------------------------------------------------------
@@ -826,7 +826,7 @@
 
         if self.valid and (self.show_page_trail or self.remember_last_visit):
             # load trail if not known
-            self.getTrail()      
+            self.getTrail()
 
             # Add only existing pages that the user may read
             if self._request:
@@ -851,7 +851,7 @@
             self.saveTrail()
 
         # TODO: release lock here
-            
+
     def saveTrail(self):
         """ Save trail file
 
@@ -924,7 +924,7 @@
         """
         if not self.name:
             return self.host()
-        
+
         wikiname, pagename = wikiutil.getInterwikiHomePage(self._request,
                                                            self.name)
         if wikiname == 'Self':
@@ -933,7 +933,7 @@
             else:
                 markup = pagename
         else:
-            markup = '%s:%s' % (wikiname, pagename) 
+            markup = '%s:%s' % (wikiname, pagename)
         return markup
 
     def mailAccountData(self, cleartext_passwd=None):
@@ -944,14 +944,14 @@
         if not self.enc_password: # generate pw if there is none yet
             from random import randint
             import base64
-    
+
             charset = 'utf-8'
             pwd = "%s%d" % (str(time.time()), randint(0, 65535))
             pwd = pwd.encode(charset)
 
             pwd = sha.new(pwd).digest()
             pwd = '{SHA}%s' % base64.encodestring(pwd).rstrip()
-    
+
             self.enc_password = pwd
             self.save()
 
--- a/MoinMoin/util/__init__.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/util/__init__.py	Sat Jul 22 17:56:50 2006 +0200
@@ -31,7 +31,7 @@
     """
     new_string, num_subst = re.subn(g_undoUtf8Pattern, lambda m: m.group(1), text)
     new_string, num_subst = re.subn(g_cdataCharPattern, lambda m, d=g_charToEntity: d[m.group()], new_string)
-    new_string, num_subst = re.subn(g_xmlIllegalCharPattern, lambda m: '&#x%02X;'%ord(m.group()), new_string)
+    new_string, num_subst = re.subn(g_xmlIllegalCharPattern, lambda m: '&#x%02X;' % ord(m.group()), new_string)
     return new_string
 
 def TranslateText(text):
@@ -41,7 +41,7 @@
     """
     new_string, num_subst = re.subn(g_undoUtf8Pattern, lambda m: m.group(1), text)
     new_string, num_subst = re.subn(g_textCharPattern, lambda m, d=g_charToEntity: d[m.group()], new_string)
-    new_string, num_subst = re.subn(g_xmlIllegalCharPattern, lambda m: '&#x%02X;'%ord(m.group()), new_string)
+    new_string, num_subst = re.subn(g_xmlIllegalCharPattern, lambda m: '&#x%02X;' % ord(m.group()), new_string)
     return new_string
 
 
@@ -79,7 +79,7 @@
     result = '<dt><strong>Form entries</strong></dt>'
     for k in form.keys():
         v = form.get(k, ["<empty>"])
-        v = "|".join(v) 
+        v = "|".join(v)
         result = result + '<dd><em>%s</em>=%s</dd>' % (k, wikiutil.escape(v))
 
     return result
@@ -100,12 +100,12 @@
 
     def __init__(self):
         self.buffer = []
-        
+
     def write(self, foo):
         if not isinstance(foo, unicode):
             foo = foo.decode("iso-8859-1", "replace")
         self.buffer.append(foo)
-    
+
     def getvalue(self):
         return u''.join(self.buffer)
 
--- a/MoinMoin/util/bdiff.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/util/bdiff.py	Sat Jul 22 17:56:50 2006 +0200
@@ -30,17 +30,17 @@
 
     bin = []
     la = lb = 0
-    
+
     p = [0]
     for i in a: p.append(p[-1] + len(i))
-    
+
     for am, bm, size in difflib.SequenceMatcher(None, a, b).get_matching_blocks():
         s = "".join(b[lb:bm])
         if am > la or s:
             bin.append(struct.pack(BDIFF_PATT, p[la], p[am], len(s)) + s)
         la = am + size
         lb = bm + size
-    
+
     return "".join(bin)
 
 def textdiff(a, b):
@@ -78,12 +78,12 @@
 def test():
     a = ("foo\n" * 30)
     b = ("  fao" * 30)
-    
+
     a = file(r"C:\Dokumente und Einstellungen\Administrator\Eigene Dateien\Progra\Python\MoinMoin\moin-1.6-sync\MoinMoin\util\test.1").read()
     b = file(r"C:\Dokumente und Einstellungen\Administrator\Eigene Dateien\Progra\Python\MoinMoin\moin-1.6-sync\MoinMoin\util\test.2").read()
     a = a.splitlines(1)
     b = b.splitlines(1)
-    
+
     d = diff(a, b)
     z = compress(d)
     print `patchtext(d)`
--- a/MoinMoin/util/chartypes_create.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/util/chartypes_create.py	Sat Jul 22 17:56:50 2006 +0200
@@ -10,7 +10,7 @@
 lowercase = []
 digits = []
 space = []
-for code in range(1,65535):
+for code in range(1, 65535):
     c = unichr(code)
     str = "\\u%04x" % code
     if c.isupper():
--- a/MoinMoin/util/diff.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/util/diff.py	Sat Jul 22 17:56:50 2006 +0200
@@ -74,10 +74,10 @@
 %s:
 </td>
 </tr>
-""" % ( request.formatter.line_anchorlink(1, llineno) + request.formatter.text(t_line % llineno) + request.formatter.line_anchorlink(0),
-        request.formatter.line_anchorlink(1, rlineno) + request.formatter.text(t_line % rlineno) + request.formatter.line_anchorlink(0))
+""" % (request.formatter.line_anchorlink(1, llineno) + request.formatter.text(t_line % llineno) + request.formatter.line_anchorlink(0),
+       request.formatter.line_anchorlink(1, rlineno) + request.formatter.text(t_line % rlineno) + request.formatter.line_anchorlink(0))
 
-        leftpane  = ''
+        leftpane = ''
         rightpane = ''
         linecount = max(match[0] - lastmatch[0], match[1] - lastmatch[1])
         for line in range(linecount):
@@ -90,7 +90,7 @@
                     rightpane += '\n'
                 rightpane += seq2[lastmatch[1] + line]
 
-        charobj   = difflib.SequenceMatcher(None, leftpane, rightpane)
+        charobj = difflib.SequenceMatcher(None, leftpane, rightpane)
         charmatch = charobj.get_matching_blocks()
 
         if charobj.ratio() < 0.5:
@@ -108,7 +108,7 @@
             # Some similarities; markup changes.
             charlast = (0, 0)
 
-            leftresult  = ''
+            leftresult = ''
             rightresult = ''
             for thismatch in charmatch:
                 if thismatch[0] - charlast[0] != 0:
@@ -121,7 +121,7 @@
                 rightresult += escape(rightpane[thismatch[1]:thismatch[1] + thismatch[2]])
                 charlast = (thismatch[0] + thismatch[2], thismatch[1] + thismatch[2])
 
-        leftpane  = '<br>\n'.join(map(indent, leftresult.splitlines()))
+        leftpane = '<br>\n'.join(map(indent, leftresult.splitlines()))
         rightpane = '<br>\n'.join(map(indent, rightresult.splitlines()))
 
         # removed width="50%%"
--- a/MoinMoin/util/diff3.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/util/diff3.py	Sat Jul 22 17:56:50 2006 +0200
@@ -25,7 +25,7 @@
     old_nr, other_nr, new_nr = 0, 0, 0
     old_len, other_len, new_len = len(old), len(other), len(new)
     result = []
-    while old_nr < old_len and other_nr < other_len  and new_nr < new_len:
+    while old_nr < old_len and other_nr < other_len and new_nr < new_len:
         # unchanged
         if old[old_nr] == other[other_nr] == new[new_nr]:
             result.append(old[old_nr])
@@ -82,7 +82,7 @@
 
     # process tail
     # all finished
-    if old_nr == old_len and other_nr == other_len  and new_nr == new_len:
+    if old_nr == old_len and other_nr == other_len and new_nr == new_len:
         pass
     # new added lines
     elif old_nr == old_len and other_nr == other_len:
@@ -122,9 +122,9 @@
             if match_len == difference:
                 return (new_match[0], other_match[1]+difference, new_match[1])
             else:
-                other_match =  find_match(old, other,
-                                          other_match[0] + match_len,
-                                          other_match[1] + match_len)
+                other_match = find_match(old, other,
+                                         other_match[0] + match_len,
+                                         other_match[1] + match_len)
         # other changed more lines
         elif difference < 0:
             difference = -difference
@@ -134,14 +134,14 @@
                 return (other_match[0], other_match[1],
                         new_match[0] + difference)
             else:
-                new_match =  find_match(old, new,
-                                        new_match[0] + match_len,
-                                        new_match[1] + match_len)
+                new_match = find_match(old, new,
+                                       new_match[0] + match_len,
+                                       new_match[1] + match_len)
         # both conflicts change same number of lines
         # or no match till the end
         else:
             return (new_match[0], other_match[1], new_match[1])
-        
+
 def match(list1, list2, nr1, nr2, maxcount=3):
     """ return the number matching items after the given positions
         maximum maxcount lines are are processed 
@@ -176,10 +176,10 @@
                 hit1 = (i, idx2)
                 break
             i += 1
-            
+
         i = nr2
         while i < idx2:
-            hit_count = match(list1, list2, idx1, i, mincount) 
+            hit_count = match(list1, list2, idx1, i, mincount)
             if hit_count >= mincount:
                 hit2 = (idx1, i)
                 break
--- a/MoinMoin/util/filesys.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/util/filesys.py	Sat Jul 22 17:56:50 2006 +0200
@@ -109,7 +109,7 @@
     """
     names = os.listdir(src)
     os.mkdir(dst)
-    copystat(src,dst)
+    copystat(src, dst)
     errors = []
     for name in names:
         srcname = os.path.join(src, name)
@@ -167,3 +167,4 @@
 
     def realPathCase(path):
         return None
+
--- a/MoinMoin/util/lock.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/util/lock.py	Sat Jul 22 17:56:50 2006 +0200
@@ -23,7 +23,7 @@
     """
     defaultSleep = 0.25
     maxSleep = 0.25
-    
+
     def __init__(self, timeout):
         self.setTimeout(timeout)
         self._start = None
@@ -35,7 +35,7 @@
             self._sleep = self.defaultSleep
         else:
             self._sleep = min(timeout / 10.0, self.maxSleep)
-        
+
     def start(self):
         """ Start the countdown """
         if self.timeout is None:
@@ -53,7 +53,7 @@
     def sleep(self):
         """ Sleep without sleeping over timeout """
         if self._stop is not None:
-            timeLeft = max(self._stop - time.time(), 0)            
+            timeLeft = max(self._stop - time.time(), 0)
             sleep = min(self._sleep, timeLeft)
         else:
             sleep = self._sleep
@@ -62,7 +62,7 @@
     def elapsed(self):
         return time.time() - self._start
 
-    
+
 class ExclusiveLock:
     """ Exclusive lock
     
@@ -77,7 +77,7 @@
     """
     fileName = '' # The directory is the lockDir
     timerClass = Timer
-    
+
     def __init__(self, dir, timeout=None):
         """ Init a write lock
         
@@ -96,7 +96,7 @@
             self.lockDir = os.path.join(dir, self.fileName)
             self._makeDir()
         else:
-            self.lockDir = dir            
+            self.lockDir = dir
         self._locked = False
 
     def acquire(self, timeout=None):
@@ -165,7 +165,7 @@
         return False
 
     # Private -------------------------------------------------------
-    
+
     def _makeDir(self):
         """ Make sure directory exists """
         try:
@@ -180,7 +180,7 @@
         try:
             os.rmdir(self.lockDir)
         except OSError, err:
-            if err.errno != errno.ENOENT: 
+            if err.errno != errno.ENOENT:
                 raise
 
 
@@ -195,7 +195,7 @@
     lock will try to expire all existing ReadLocks.
     """
     fileName = 'write_lock'
-    
+
     def __init__(self, dir, timeout=None, readlocktimeout=None):
         """ Init a write lock
         
@@ -211,7 +211,7 @@
             self.readlocktimeout = timeout
         else:
             self.readlocktimeout = readlocktimeout
-    
+
     def acquire(self, timeout=None):
         """ Acquire an exclusive write lock
         
@@ -221,7 +221,7 @@
         acquired.
         
         Return True if lock acquired, False otherwise.
-        """        
+        """
         if self._locked:
             raise RuntimeError("lock already locked")
         result = False
@@ -242,9 +242,9 @@
                 else:
                     self.release()
         return False
-        
+
     # Private -------------------------------------------------------
-    
+
     def _expireReadLocks(self):
         """ Expire old read locks """
         readLockFileName = ReadLock.fileName
@@ -255,7 +255,7 @@
             ExclusiveLock(LockDir, self.readlocktimeout).expire()
 
     def _haveReadLocks(self):
-        """ Return True if read locks exists; False otherwise """            
+        """ Return True if read locks exists; False otherwise """
         readLockFileName = ReadLock.fileName
         for name in os.listdir(self.dir):
             if name.startswith(readLockFileName):
@@ -273,7 +273,7 @@
     Allows only one lock per instance.
     """
     fileName = 'read_lock_'
-            
+
     def __init__(self, dir, timeout=None):
         """ Init a read lock
         
@@ -302,6 +302,6 @@
                 # log('acquired read lock: %s\n' % self.lockDir)
                 return True
             finally:
-                self.writeLock.release()       
+                self.writeLock.release()
         return False
 
--- a/MoinMoin/util/profile.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/util/profile.py	Sat Jul 22 17:56:50 2006 +0200
@@ -64,7 +64,7 @@
         self.count = 0 # count between somples
         self.requests = 0 # requests added
         self.data = {'collect': 'NA'} # Sample data
-        
+
     def addRequest(self):
         """ Add a request to the profile
 
@@ -76,12 +76,12 @@
         Invoke sample when self.count reach self.requestsPerSample.
         """
         self.requests += 1
-        self.count += 1 
+        self.count += 1
         if self.count == self.requestsPerSample:
             # Time for a sample
             self.count = 0
             self.sample()
-    
+
     def sample(self):
         """ Make a sample of memory usage and log it
 
@@ -90,13 +90,13 @@
         
         Invoke common methods for all profilers. Some profilers like
         TwistedProfiler override this method. 
-        """        
+        """
         self._setData()
         self._setMemory()
         self._log()
-    
+
     # Private methods ------------------------------------------------------
-    
+
     def _setData(self):
         """ Collect sample data into self.data
 
@@ -109,7 +109,7 @@
             d['collect'] = str(gc.collect())
         d['objects'] = len(gc.get_objects())
         d['garbage'] = len(gc.garbage)
-                     
+
     def _setMemory(self):
         """ Get process memory usage
 
@@ -120,14 +120,14 @@
         """
         lines = os.popen('/bin/ps -p %s -o rss' % self.pid).readlines()
         self.data['memory'] = lines[1].strip()
-    
+
     def _log(self):
         """ Format sample and write to log
 
         Private method used by profilers.
         """
         line = ('%(date)s req:%(requests)d mem:%(memory)sKB collect:%(collect)s '
-                'objects:%(objects)d garbage:%(garbage)d\n' % self.data) 
+                'objects:%(objects)d garbage:%(garbage)d\n' % self.data)
         self.logfile.write(line)
         self.logfile.flush()
 
@@ -145,10 +145,10 @@
         Invoke Profiler.__init__ and import getProcessOuput from
         twisted.
         """
-        Profiler.__init__(self, name, requestsPerSample, collect) 
+        Profiler.__init__(self, name, requestsPerSample, collect)
         from twisted.internet.utils import getProcessOutput
-        self._getProcessOutput = getProcessOutput        
-        
+        self._getProcessOutput = getProcessOutput
+
     def sample(self):
         """ Make a sample of memory usage and log it
         
@@ -161,23 +161,22 @@
         """
         self._setData()
         # Memory will be available little later
-        deferred = self._getProcessOutput('/bin/ps', 
+        deferred = self._getProcessOutput('/bin/ps',
                                           ('-p', str(self.pid), '-o', 'rss'))
         deferred.addCallback(self._callback)
 
     # Private methods ------------------------------------------------------
-    
-    def _callback(self, data):        
+
+    def _callback(self, data):
         """ Called from deferred when ps output is available
 
         Private method, don't call this.
         """
         self.data['memory'] = data.split('\n')[1].strip()
-        self._log()  
-    
-    
+        self._log()
+
+
 if __name__ == '__main__':
     # In case someone try to run as a script
     print __doc__
-    
 
--- a/MoinMoin/util/pysupport.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/util/pysupport.py	Sat Jul 22 17:56:50 2006 +0200
@@ -30,7 +30,7 @@
     import os, re
 
     packagedir = os.path.dirname(packagefile)
-    
+
     in_plugin_dir = lambda dir, ops=os.path.split: ops(ops(dir)[0])[1] == "plugin"
 
     moinmodule = __import__('MoinMoin')
@@ -85,12 +85,12 @@
     if lock is None:
         import threading
         lock = threading.Lock()
-    
+
     def decorated(*args, **kw):
         lock.acquire()
         try:
             return function(*args, **kw)
         finally:
             lock.release()
-            
+
     return decorated
--- a/MoinMoin/util/thread_monitor.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/util/thread_monitor.py	Sat Jul 22 17:56:50 2006 +0200
@@ -41,7 +41,7 @@
 
 def dump_hook(a, b, c): # arguments are ignored
     global dumping
-    
+
     if dumping and sys.exc_info()[0] is None:
         thread = threading.currentThread()
         if thread in to_dump:
@@ -65,7 +65,7 @@
     """ Activates the thread monitor hook. Note that this interferes
     with any kind of profiler and some debugging extensions. """
     global hook_enabled
-    
+
     sys.setprofile(dump_hook)
     threading.setprofile(dump_hook)
     hook_enabled = True
@@ -78,6 +78,6 @@
         while 1:
             sleep(seconds)
             trigger_dump()
-    
+
     threading.Thread(target=background_dumper, args=(seconds, )).start()
 
--- a/MoinMoin/widget/base.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/widget/base.py	Sat Jul 22 17:56:50 2006 +0200
@@ -12,5 +12,5 @@
         self.request = request
 
     def render(self):
-        raise NotImplementedError 
+        raise NotImplementedError
 
--- a/MoinMoin/widget/html.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/widget/html.py	Sat Jul 22 17:56:50 2006 +0200
@@ -26,7 +26,7 @@
     def __unicode__(self):
         return wikiutil.escape(self.text)
 
-        
+
 class Raw:
     """ Raw HTML code.
     """
@@ -36,7 +36,7 @@
     def __unicode__(self):
         return self.markup
 
-        
+
 class Element:
     """ Abstract base class for HTML elements.
     """
@@ -86,9 +86,9 @@
         return ' '.join(result)
 
     def __unicode__(self):
-        raise NotImplementedError 
+        raise NotImplementedError
 
-        
+
 class EmptyElement(Element):
     """ HTML elements with an empty content model.
     """
--- a/MoinMoin/wikixml/marshal.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/wikixml/marshal.py	Sat Jul 22 17:56:50 2006 +0200
@@ -34,7 +34,7 @@
     # Container Tags
     ROOT_CONTAINER = "data"
     ITEM_CONTAINER = "item"
-    
+
     # List of private prefixes
     PRIVATE_PREFIXES = ['_']
 
@@ -42,7 +42,7 @@
     TAG_MAP = {}
 
 
-    def __toXML(self, element, data): 
+    def __toXML(self, element, data):
         """ Recursive helper method that transforms an object to XML.
         
             Returns a list of strings, which constitute the XML document.
--- a/MoinMoin/xmlrpc/ProcessMail.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/xmlrpc/ProcessMail.py	Sat Jul 22 17:56:50 2006 +0200
@@ -12,13 +12,13 @@
     request = xmlrpcobj.request
     secret = xmlrpcobj._instr(secret)
     mail = str(mail)
-    
+
     if not request.cfg.mail_import_secret:
         return u"No password set"
-    
+
     if request.cfg.mail_import_secret != secret:
         return u"Invalid password"
-    
+
     try:
         mailimport.import_mail_from_string(request, mail)
     except mailimport.ProcessingError, e:
--- a/MoinMoin/xmlrpc/UpdateGroup.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/xmlrpc/UpdateGroup.py	Sat Jul 22 17:56:50 2006 +0200
@@ -34,7 +34,7 @@
     # change your wikiconfig to have xmlrpc_putpage_trusted_only = 0
     # and make very very sure that nobody untrusted can access your wiki
     # via network or somebody will raid your wiki some day!
-        
+
     if self.request.cfg.xmlrpc_putpage_trusted_only and not self.request.user.trusted:
         return xmlrpclib.Fault(1, "You are not allowed to edit this page")
 
@@ -45,7 +45,7 @@
     # check if groupname matches page_group_regex
     if not re.match(self.request.cfg.page_group_regex, groupname):
         return xmlrpclib.Fault(2, "The groupname %s does not match your page_group_regex (%s)" % (
-	                          groupname, self.request.cfg.page_group_regex))
+                               groupname, self.request.cfg.page_group_regex))
 
     newtext = """\
 #acl %(acl)s
@@ -56,7 +56,7 @@
     'comment': groupcomment,
     'memberlist': "\n * ".join([''] + memberlist)
     }
-    
+
     page = PageEditor(self.request, pagename)
     try:
         msg = page.saveText(newtext, 0)
--- a/MoinMoin/xmlrpc/__init__.py	Sat Jul 22 17:24:41 2006 +0200
+++ b/MoinMoin/xmlrpc/__init__.py	Sat Jul 22 17:56:50 2006 +0200
@@ -59,7 +59,7 @@
         @return: string in config.charset
         """
         raise "NotImplementedError"
-    
+
     def _outstr(self, text):
         """ Convert outbound string to utf-8.
 
@@ -68,7 +68,7 @@
         @return: string in utf-8
         """
         raise "NotImplementedError"
-    
+
     def _inlob(self, text):
         """ Convert inbound base64-encoded utf-8 to Large OBject.
         
@@ -93,7 +93,7 @@
             if config.charset != 'utf-8':
                 text = unicode(text, config.charset).encode('utf-8')
         return xmlrpclib.Binary(text)
-                    
+
     def _dump_exc(self):
         """ Convert an exception to a string.
         
@@ -113,13 +113,13 @@
         try:
             data = self.request.read()
             params, method = xmlrpclib.loads(data)
-    
+
             if _debug:
                 sys.stderr.write('- XMLRPC ' + '-' * 70 + '\n')
                 sys.stderr.write('%s(%s)\n\n' % (method, repr(params)))
-            
+
             response = self.dispatch(method, params)
-            
+
         except:
             # report exception back to server
             response = xmlrpclib.dumps(xmlrpclib.Fault(1, self._dump_exc()))
@@ -142,7 +142,7 @@
 
     def dispatch(self, method, params):
         method = method.replace(".", "_")
-        
+
         try:
             fn = getattr(self, 'xmlrpc_' + method)
         except AttributeError:
@@ -156,16 +156,16 @@
                 response = fn(self, *params)
         else:
             response = fn(*params)
-        
+
         return response
 
     # Common faults -----------------------------------------------------
-    
+
     def notAllowedFault(self):
         return xmlrpclib.Fault(1, "You are not allowed to read this page.")
 
     def noSuchPageFault(self):
-        return xmlrpclib.Fault(1, "No such page was found.")        
+        return xmlrpclib.Fault(1, "No such page was found.")
 
     #############################################################################
     ### System methods
@@ -193,13 +193,13 @@
                 results.append([self.dispatch(method_name, params)])
             except xmlrpclib.Fault, fault:
                 results.append(
-                    {'faultCode' : fault.faultCode,
-                     'faultString' : fault.faultString}
+                    {'faultCode': fault.faultCode,
+                     'faultString': fault.faultString}
                     )
             except:
                 results.append(
-                    {'faultCode' : 1,
-                     'faultString' : "%s:%s" % (sys.exc_type, sys.exc_value)}
+                    {'faultCode': 1,
+                     'faultString': "%s:%s" % (sys.exc_type, sys.exc_value)}
                     )
         return results
 
@@ -240,9 +240,9 @@
             * version (int) :
                 Current version.
         """
-        
+
         return_items = []
-        
+
         edit_log = editlog.EditLog(self.request)
         for log in edit_log.reverse():
             # get last-modified UTC (DateTime) from log
@@ -252,11 +252,11 @@
             # skip if older than "date"
             if lastModified_date < date:
                 break
-            
+
             # skip if knowledge not permitted
             if not self.request.user.may.read(log.pagename):
                 continue
-            
+
             # get page name (str) from log
             pagename_str = self._outstr(log.pagename)
 
@@ -268,12 +268,12 @@
                     author_str = userdata.name
             author_str = self._outstr(author_str)
 
-            return_item = { 'name':  pagename_str,
-                            'lastModified': lastModified_date,
-                            'author': author_str,
-                            'version': int(log.rev) }
+            return_item = {'name': pagename_str,
+                           'lastModified': lastModified_date,
+                           'author': author_str,
+                           'version': int(log.rev) }
             return_items.append(return_item)
-        
+
         return return_items
 
     def xmlrpc_getPageInfo(self, pagename):
@@ -299,7 +299,7 @@
         if not self.request.user.may.read(pn):
             return self.notAllowedFault()
 
-        if rev != None:
+        if rev is not None:
             page = Page(self.request, pn, rev=rev)
         else:
             page = Page(self.request, pn)
@@ -310,10 +310,10 @@
             return self.noSuchPageFault()
 
         # Get page info
-        last_edit = page.last_edit(self.request)           
+        last_edit = page.last_edit(self.request)
         mtime = wikiutil.version2timestamp(long(last_edit['timestamp'])) # must be long for py 2.2.x
         gmtuple = tuple(time.gmtime(mtime))
-        
+
         version = rev # our new rev numbers: 1,2,3,4,....
 
         #######################################################################
@@ -326,10 +326,10 @@
         if self.request.cfg.sitename == 'MoinMaster' and pagename == 'BadContent':
             version = int(mtime)
         #######################################################################
-            
+
         return {
             'name': self._outstr(page.page_name),
-            'lastModified' : xmlrpclib.DateTime(gmtuple),
+            'lastModified': xmlrpclib.DateTime(gmtuple),
             'author': self._outstr(last_edit['editor']),
             'version': version,
             }
@@ -345,14 +345,14 @@
         @param rev: revision number (int)
         @rtype: str
         @return: utf-8 encoded page data
-        """    
+        """
         pagename = self._instr(pagename)
 
         # User may read page?
         if not self.request.user.may.read(pagename):
             return self.notAllowedFault()
 
-        if rev != None:
+        if rev is not None:
             page = Page(self.request, pagename, rev=rev)
         else:
             page = Page(self.request, pagename)
@@ -385,7 +385,7 @@
         if not self.request.user.may.read(pagename):
             return self.notAllowedFault()
 
-        if rev != None:
+        if rev is not None:
             page = Page(self.request, pagename, rev=rev)
         else:
             page = Page(self.request, pagename)
@@ -393,11 +393,11 @@
         # Non existing page?
         if not page.exists():
             return self.noSuchPageFault()
-        
+
         # Render page into a buffer
         result = self.request.redirectedOutput(page.send_page, self.request,
                                                content_only=1)
-        
+
         # Return rendered page
         if self.version == 2:
             return self._outstr(result)
@@ -425,10 +425,10 @@
         # Non existing page?
         if not page.exists():
             return self.noSuchPageFault()
-        
+
         links_out = []
         for link in page.getPageLinks(self.request):
-            links_out.append({ 'name': self._outstr(link), 'type': 0 })
+            links_out.append({'name': self._outstr(link), 'type': 0 })
         return links_out
 
     def xmlrpc_putPage(self, pagename, pagetext):
@@ -440,10 +440,10 @@
         @return: true on success
         """
         # READ THIS OR IT WILL NOT WORK ===================================
-        
+
         # we use a test page instead of using the requested pagename, if
         # xmlrpc_putpage_enabled was not set in wikiconfig.
-        
+
         if self.request.cfg.xmlrpc_putpage_enabled:
             pagename = self._instr(pagename)
         else:
@@ -455,7 +455,7 @@
         # change your wikiconfig to have xmlrpc_putpage_trusted_only = 0
         # and make very very sure that nobody untrusted can access your wiki
         # via network or somebody will raid your wiki some day!
-        
+
         if self.request.cfg.xmlrpc_putpage_trusted_only and not self.request.user.trusted:
             return xmlrpclib.Fault(1, "You are not allowed to edit this page")
 
@@ -499,7 +499,7 @@
         return (version.project, version.release, version.revision)
 
     # authorization methods
-    
+
     def xmlrpc_getAuthToken(self, username, password, *args):
         """ Returns a token which can be used for authentication
             in other XMLRPC calls. If the token is empty, the username
@@ -509,7 +509,7 @@
             return u.id
         else:
             return ""
-    
+
     def xmlrpc_applyAuthToken(self, auth_token):
         """ Applies the auth token and thereby authenticates the user. """
         u = user.User(self.request, id=auth_token, auth_method='xmlrpc_applytoken')
@@ -518,11 +518,11 @@
             return "SUCCESS"
         else:
             return xmlrpclib.Fault("INVALID", "Invalid token.")
-    
+
     def xmlrpc_getDiff(self, pagename, from_rev, to_rev):
         """ Gets the binary difference between two page revisions. See MoinMoin:WikiSyncronisation. """
         from MoinMoin.util.bdiff import textdiff, compress
-        
+
         pagename = self._instr(pagename)
 
         # User may read page?
@@ -536,44 +536,44 @@
 
         if not allowed_rev_type(from_rev):
             return xmlrpclib.Fault("FROMREV_INVALID", "Incorrect type for from_rev.")
-        
+
         if not allowed_rev_type(to_rev):
             return xmlrpclib.Fault("TOREV_INVALID", "Incorrect type for to_rev.")
-        
+
         currentpage = Page(self.request, pagename)
         if not currentpage.exists():
             return xmlrpclib.Fault("NOT_EXIST", "Page does not exist.")
-        
+
         revisions = currentpage.getRevList()
-        
+
         if from_rev is not None and from_rev not in revisions:
             return xmlrpclib.Fault("FROMREV_INVALID", "Unknown from_rev.")
         if to_rev is not None and to_rev not in revisions:
             return xmlrpclib.Fault("TOREV_INVALID", "Unknown to_rev.")
-        
+
         # use lambda to defer execution in the next lines
         if from_rev is None:
             oldcontents = lambda: ""
         else:
             oldpage = Page(request, pagename, rev=from_rev)
             oldcontents = lambda: oldpage.get_raw_body_str()
-        
+
         if to_rev is None:
             newcontents = lambda: currentpage.get_raw_body()
         else:
             newpage = Page(request, pagename, rev=to_rev)
             newcontents = lambda: newpage.get_raw_body_str()
             newrev = newpage.get_real_rev()
-        
+
         if oldcontents() and oldpage.get_real_rev() == newpage.get_real_rev():
             return xmlrpclib.Fault("ALREADY_CURRENT", "There are no changes.")
-        
+
         newcontents = newcontents()
         conflict = wikiutil.containsConflictMarker(newcontents)
         diffblob = xmlrpclib.Binary(compress(textdiff(oldcontents(), newcontents)))
-        
+
         return {"conflict": conflict, "diff": diffblob, "diffversion": 1, "current": currentpage.get_real_rev()}
-    
+
     def xmlrpc_interwikiName(self):
         """ Returns the interwiki name of the current wiki. """
         name = self.request.cfg.interwikiname
@@ -581,7 +581,7 @@
             return None
         else:
             return self._outstr(name)
-    
+
     def xmlrpc_mergeChanges(self, pagename, diff, local_rev, delta_remote_rev, last_remote_rev, interwiki_name):
         """ Merges a diff sent by the remote machine and returns the number of the new revision.
             Additionally, this method tags the new revision.
@@ -594,38 +594,38 @@
             @param interwiki_name: Used to build the interwiki tag.
         """
         from MoinMoin.util.bdiff import decompress, patch
-        
+
         pagename = self._instr(pagename)
-       
+
         # User may read page?
         if not self.request.user.may.read(pagename) or not self.request.user.may.write(pagename):
             return self.notAllowedFault()
 
         # XXX add locking here!
-        
+
         # current version of the page
         currentpage = Page(self.request, pagename)
 
         if currentpage.get_real_rev() != last_remote_rev:
             return xmlrpclib.Fault("LASTREV_INVALID", "The page was changed")
-        
+
         if not currentpage.exists() and diff is None:
             return xmlrpclib.Fault("NOT_EXIST", "The page does not exist and no diff was supplied.")
-        
+
         # base revision used for the diff
         basepage = Page(self.request, pagename, rev=delta_remote_rev)
-        
+
         # generate the new page revision by applying the diff
         newcontents = patch(basepage.get_raw_body_str(), decompress(str(diff)))
-        
+
         # write page
         # XXX ...
-        
+
         # XXX add a tag (interwiki_name, local_rev, current rev) to the page
         # XXX return current rev
         # XXX finished
-        
-        
+
+
     # XXX BEGIN WARNING XXX
     # All xmlrpc_*Attachment* functions have to be considered as UNSTABLE API -
     # they are neither standard nor are they what we need when we have switched
@@ -641,12 +641,12 @@
         @param pagename: pagename (utf-8)
         @rtype: list
         @return: a list of utf-8 attachment names
-        """    
+        """
         pagename = self._instr(pagename)
         # User may read page?
         if not self.request.user.may.read(pagename):
             return self.notAllowedFault()
-        
+
         result = AttachFile._get_files(self.request, pagename)
         return result
 
@@ -690,7 +690,7 @@
         # also check ACLs
         if not self.request.user.may.write(pagename):
             return xmlrpclib.Fault(1, "You are not allowed to edit this page")
-        
+
         attachname = wikiutil.taintfilename(attachname)
         filename = AttachFile.getFilename(self.request, pagename, attachname)
         if os.path.exists(filename) and not os.path.isfile(filename):
@@ -699,12 +699,12 @@
         os.chmod(filename, 0666 & config.umask)
         AttachFile._addLogEntry(self.request, 'ATTNEW', pagename, filename)
         return xmlrpclib.Boolean(1)
-    
+
     # XXX END WARNING XXX
 
 
 class XmlRpc1(XmlRpcBase):
-    
+
     def __init__(self, request):
         XmlRpcBase.__init__(self, request)
         self.version = 1
@@ -727,9 +727,9 @@
         """
         return wikiutil.url_quote(text) # config.charset must be utf-8
 
-    
+
 class XmlRpc2(XmlRpcBase):
-    
+
     def __init__(self, request):
         XmlRpcBase.__init__(self, request)
         self.version = 2
@@ -753,9 +753,9 @@
         @return: text encoded in utf-8
         """
         if isinstance(text, unicode):
-            text = text.encode('utf-8')           
-        elif config.charset != 'utf-8':        
-            text = unicode(text, config.charset).encode('utf-8')               
+            text = text.encode('utf-8')
+        elif config.charset != 'utf-8':
+            text = unicode(text, config.charset).encode('utf-8')
         return text
 
 
--- a/docs/CHANGES	Sat Jul 22 17:24:41 2006 +0200
+++ b/docs/CHANGES	Sat Jul 22 17:56:50 2006 +0200
@@ -116,6 +116,7 @@
     * removed all _ magic in URLs and filenames
       TODO: write mig script for data_dir
       TODO: make blanks in interwiki pagelinks possible
+    * request.action now has the action requested, default: 'show'.
 
   New Features:
     * Removed "underscore in URL" == "blank in pagename magic" - it made more