changeset 927:28ae528ca238

merge with main
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Fri, 07 Jul 2006 12:30:34 +0200
parents 134b5ee99046 (current diff) eb465f4d2af0 (diff)
children 6ed0a66797eb 248789a3f155
files MoinMoin/PageEditor.py
diffstat 29 files changed, 275 insertions(+), 243 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Fri Jul 07 12:28:54 2006 +0200
+++ b/Makefile	Fri Jul 07 12:30:34 2006 +0200
@@ -78,6 +78,11 @@
 	@python tests/maketestwiki.py
 	@python tests/runtests.py
 
+coverage:
+	@python tests/maketestwiki.py
+	@python -u -m trace --count --coverdir=cover --missing tests/runtests.py
+
+
 clean: clean-testwiki clean-pyc
 	rm -rf build
 
--- a/MoinMoin/PageEditor.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/PageEditor.py	Fri Jul 07 12:30:34 2006 +0200
@@ -629,6 +629,34 @@
         # No mail sent, no message.
         return ''
 
+    def _get_local_timestamp(self):
+        """
+        Returns the string that can be used by the TIME substitution.
+
+        @return: str with a timestamp in it
+        """
+
+        now = time.time()
+        # default: UTC
+        zone = "Z"
+        user = self.request.user
+
+        # setup the timezone
+        if user.valid and user.tz_offset:
+            tz = user.tz_offset
+            # round to minutes
+            tz -= tz % 60
+            minutes = tz / 60
+            hours = minutes / 60
+            minutes -= hours * 60
+
+            # construct the offset
+            zone = "%+0.2d%02d" % (hours, minutes)
+            # correct the time by the offset we've found
+            now += tz
+
+        return time.strftime("%Y-%m-%dT%H:%M:%S", timefuncs.tmtuple(now)) + zone
+
     def _expand_variables(self, text):
         """
         Expand @VARIABLE@ in `text`and return the expanded text.
@@ -639,7 +667,7 @@
         """
         # TODO: Allow addition of variables via wikiconfig or a global
         # wiki dict.
-        now = time.strftime("%Y-%m-%dT%H:%M:%SZ", timefuncs.tmtuple())
+        now = self._get_local_timestamp()
         user = self.request.user
         signature = user.signature()
         variables = {
--- a/MoinMoin/_tests/__init__.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/_tests/__init__.py	Fri Jul 07 12:30:34 2006 +0200
@@ -74,7 +74,7 @@
             def testSomething(self):
                 # test that needs those defaults and custom values
     """
-    
+
     def __init__(self, request, defaults=(), **custom):
         """ Create temporary configuration for a test 
 
@@ -88,7 +88,7 @@
         self.new = []  # New added attributes
         self.setDefaults(defaults)
         self.setCustom(**custom)
-    
+
     def setDefaults(self, defaults=()):
         """ Set default values for keys in defaults list
         
@@ -97,20 +97,20 @@
         from MoinMoin.multiconfig import DefaultConfig
         for key in defaults:
             self._setattr(key, getattr(DefaultConfig, key))
-            
+
     def setCustom(self, **custom):
         """ Set custom values """
         for key, value in custom.items():
             self._setattr(key, value)
-    
+
     def _setattr(self, key, value):
         """ Set a new value for key saving new added keys """
         if hasattr(self.request.cfg, key):
             self.old[key] = getattr(self.request.cfg, key)
         else:
             self.new.append(key)
-        setattr(self.request.cfg, key, value)        
-       
+        setattr(self.request.cfg, key, value)
+
     def __del__(self):
         """ Restore previous request.cfg 
         
@@ -134,8 +134,8 @@
 
     def loadTestsFromTestCase(self, testCaseClass):
         testCaseClass.request = self.request
-        return TestLoader.loadTestsFromTestCase(self, testCaseClass)        
-        
+        return TestLoader.loadTestsFromTestCase(self, testCaseClass)
+
     def loadTestsFromModuleNames(self, names):
         """ Load tests from qualified module names, eg. a.b.c
         
@@ -146,7 +146,7 @@
         suites = []
         for name in names:
             module = __import__(name, globals(), {}, ['dummy'])
-            suites.append(self.loadTestsFromModule(module))    
+            suites.append(self.loadTestsFromModule(module))
         return self.suiteClass(suites)
 
 
@@ -165,7 +165,7 @@
         names = [name for name in names if name.startswith('test_')]
         caseInsensitiveCompare = lambda a, b: cmp(a.lower(), b.lower())
         names.sort(caseInsensitiveCompare)
-    
+
     return MoinTestLoader(request).loadTestsFromModuleNames(names)
 
 
@@ -179,12 +179,13 @@
     if request is None:
         from MoinMoin.request import CLI
         from MoinMoin.user import User
-        request = CLI.Request()   
+        request = CLI.Request()
         request.form = request.args = request.setup_args()
         request.user = User(request)
-        
+
     suite = makeSuite(request, names)
-    
+
     # do not redirect the stream to request here because request.write can
     # be invalid or broken because not all redirections of it use a finally: block
     TextTestRunner(stream=sys.stdout, verbosity=2).run(suite)
+
--- a/MoinMoin/_tests/_test_template.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/_tests/_test_template.py	Fri Jul 07 12:30:34 2006 +0200
@@ -34,8 +34,8 @@
         expected = 'expected value'
         self.assertEqual(result, expected,
                          ('Expected "%(expected)s" but got "%(result)s"') % locals())
-    
-    
+
+
 class ComplexTestCase(unittest.TestCase):
     """ Describe these tests here...
 
@@ -53,16 +53,16 @@
         Some test needs specific config values, or they will fail.
         """
         self.config = TestConfig(self.request,
-                                 defaults=['this option', 'that option'], 
+                                 defaults=['this option', 'that option'],
                                  another_option='non default value')
-    
+
     def tearDown(self):
         """ Stuff that should run after each test
 
         Delete TestConfig, if used.
-        """       
+        """
         del self.config
-    
+
     def testFunction(self):
         """ module_tested: function should... """
         for description, test, expected in self._tests:
@@ -81,4 +81,3 @@
 
         return result
 
-
--- a/MoinMoin/_tests/test_Page.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/_tests/test_Page.py	Fri Jul 07 12:30:34 2006 +0200
@@ -11,7 +11,7 @@
 
 class existsTestCase(unittest.TestCase):
     """Page: testing wiki page"""
-    
+
     def testExists(self):
         """ Page: page.exists() finds existing pages only """
         tests = (
--- a/MoinMoin/_tests/test_PageEditor.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/_tests/test_PageEditor.py	Fri Jul 07 12:30:34 2006 +0200
@@ -13,7 +13,7 @@
 
 
 class ExpandVarsTestCase(unittest.TestCase):
-    """PageEditor: testing page editor"""   
+    """PageEditor: testing page editor"""
 
     pagename = u'AutoCreatedMoinMoinTemporaryTestPage'
 
@@ -33,7 +33,7 @@
         for var, expected in self._tests:
             result = self.page._expand_variables(var)
             self.assertEqual(result, expected,
-                'Expected "%(expected)s" but got "%(result)s"' % locals())   
+                'Expected "%(expected)s" but got "%(result)s"' % locals())
 
 
 class ExpandUserNameTest(unittest.TestCase):
@@ -43,7 +43,7 @@
     """
     pagename = u'AutoCreatedMoinMoinTemporaryTestPage'
     variable = u'@USERNAME@'
-    
+
     def setUp(self):
         self.page = PageEditor(self.request, self.pagename)
         self.savedName = self.request.user.name
@@ -51,24 +51,24 @@
 
     def tearDown(self):
         self.request.user.name = self.savedName
-    
+
     def expand(self):
         return self.page._expand_variables(self.variable)
 
 
 class ExpandCamelCaseName(ExpandUserNameTest):
-    
+
     name = u'UserName'
-    
+
     def testExpandCamelCaseUserName(self):
         """ PageEditor: expand @USERNAME@ CamelCase """
         self.assertEqual(self.expand(), self.name)
 
 
 class ExpandExtendedName(ExpandUserNameTest):
-    
+
     name = u'user name'
-    
+
     def testExtendedNamesEnabled(self):
         """ PageEditor: expand @USERNAME@ extended name - enabled """
         try:
@@ -77,7 +77,7 @@
         finally:
             del config
 
-        
+
 class ExpandMailto(ExpandUserNameTest):
 
     variable = u'@MAILTO@'
@@ -95,11 +95,11 @@
         ExpandUserNameTest.tearDown(self)
         self.request.user.valid = self.savedValid
         self.request.user.email = self.savedEmail
-    
+
     def testMailto(self):
         """ PageEditor: expand @MAILTO@ """
         self.assertEqual(self.expand(), u'[[MailTo(%s)]]' % self.email)
-        
+
 
 class ExpandPrivateVariables(ExpandUserNameTest):
 
@@ -107,7 +107,7 @@
     name = u'AutoCreatedMoinMoinTemporaryTestUser'
     dictPage = name + '/MyDict'
     shouldDeleteTestPage = True
-    
+
     def setUp(self):
         ExpandUserNameTest.setUp(self)
         self.savedValid = self.request.user.valid
@@ -121,7 +121,7 @@
         self.deleteTestPage()
 
     def testPrivateVariables(self):
-        """ PageEditor: expand user variables """        
+        """ PageEditor: expand user variables """
         self.assertEqual(self.expand(), self.name)
 
     def createTestPage(self):
@@ -135,7 +135,7 @@
         path = self.dictPagePath()
         if os.path.exists(path):
             self.shouldDeleteTestPage = False
-            raise TestSkiped("%s exists. Won't overwrite exiting page" % 
+            raise TestSkiped("%s exists. Won't overwrite exiting page" %
                              self.dictPage)
         try:
             os.mkdir(path)
@@ -157,14 +157,14 @@
         if hasattr(self.request.cfg, 'DICTS_DATA'):
             del self.request.cfg.DICTS_DATA
         self.request.pages = {}
-        
+
     def deleteTestPage(self):
         """ Delete temporary page, bypass logs and notifications """
         if self.shouldDeleteTestPage:
             import shutil
             shutil.rmtree(self.dictPagePath(), True)
-        
+
     def dictPagePath(self):
         page = Page(self.request, self.dictPage)
         return page.getPagePath(use_underlay=0, check_create=0)
-        
+
--- a/MoinMoin/_tests/test_error.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/_tests/test_error.py	Fri Jul 07 12:30:34 2006 +0200
@@ -19,13 +19,13 @@
         err = error.Error(u'טעות')
         self.assertEqual(unicode(err), u'טעות')
         self.assertEqual(str(err), 'טעות')
-        
+
     def testCreateWithEncodedString(self):
         """ error: create with encoded string """
         err = error.Error('טעות')
         self.assertEqual(unicode(err), u'טעות')
         self.assertEqual(str(err), 'טעות')
-         
+
     def testCreateWithObject(self):
         """ error: create with any object """
         class Foo:
@@ -33,15 +33,14 @@
                 return u'טעות'
             def __str__(self):
                 return 'טעות'
-        
+
         err = error.Error(Foo())
         self.assertEqual(unicode(err), u'טעות')
         self.assertEqual(str(err), 'טעות')
-         
+
     def testAccessLikeDict(self):
         """ error: access error like a dict """
         test = 'value'
         err = error.Error(test)
         self.assertEqual('%(message)s' % err, test)
 
-
--- a/MoinMoin/_tests/test_formatter.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/_tests/test_formatter.py	Fri Jul 07 12:30:34 2006 +0200
@@ -20,7 +20,6 @@
         for f_name in formatters:
             #if f_name in ('dom_xml', ):
             #    continue
-            
             try:
                 formatter = wikiutil.importPlugin(self.request.cfg, "formatter", f_name, "Formatter")
             except wikiutil.PluginAttributeError:
@@ -40,6 +39,6 @@
         self.request.formatter = page.formatter = formatter(self.request)
         #page.formatter.setPage(page)
         #page.hilite_re = None
-        
+
         return self.request.redirectedOutput(page.send_page, self.request)
 
--- a/MoinMoin/_tests/test_macro.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/_tests/test_macro.py	Fri Jul 07 12:30:34 2006 +0200
@@ -21,7 +21,7 @@
         expected = m.formatter.linebreak(0)
         result = m.execute("BR", "")
         self.assertEqual(result, expected,
-            'Expected "%(expected)s" but got "%(result)s"' % locals())        
+            'Expected "%(expected)s" but got "%(result)s"' % locals())
 
     def _make_macro(self):
         """Test helper"""
@@ -31,3 +31,4 @@
         p.form = self.request.form
         m = macro.Macro(p)
         return m
+
--- a/MoinMoin/_tests/test_mail_sendmail.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/_tests/test_mail_sendmail.py	Fri Jul 07 12:30:34 2006 +0200
@@ -15,7 +15,7 @@
 
 class decodeSpamSafeEmailTestCase(unittest.TestCase):
     """mail.sendmail: testing mail"""
-    
+
     _tests = (
         ('', ''),
         ('AT', '@'),
@@ -54,7 +54,7 @@
     mailbox     =   name-addr / addr-spec
     name-addr   =   [display-name] angle-addr
     angle-addr  =   [CFWS] "<" addr-spec ">" [CFWS] / obs-angle-addr
-    """    
+    """
     charset = Charset(config.charset)
     charset.header_encoding = QP
     charset.body_encoding = QP
@@ -73,7 +73,7 @@
         expected = phrase + '<local@domain>'
         self.failUnlessEqual(sendmail.encodeAddress(address, self.charset),
                              expected)
-                             
+
     def testCompositeUnicode(self):
         """ mail.sendmail: encode Uncode address: 'ויקי <local@domain>' """
         address = u'ויקי <local@domain>'
@@ -81,14 +81,14 @@
         expected = phrase + '<local@domain>'
         self.failUnlessEqual(sendmail.encodeAddress(address, self.charset),
                              expected)
-                             
+
     def testEmptyPhrase(self):
         """ mail.sendmail: encode address with empty phrase: '<local@domain>' """
         address = u'<local@domain>'
         expected = address.encode(config.charset)
         self.failUnlessEqual(sendmail.encodeAddress(address, self.charset),
                              expected)
-                             
+
     def testEmptyAddress(self):
         """ mail.sendmail: encode address with empty address: 'Phrase <>' 
         
@@ -112,3 +112,4 @@
         expected = address.encode(config.charset)
         self.failUnlessEqual(sendmail.encodeAddress(address, self.charset),
                              expected)
+
--- a/MoinMoin/_tests/test_packages.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/_tests/test_packages.py	Fri Jul 07 12:30:34 2006 +0200
@@ -44,7 +44,7 @@
 
     def isPackage(self):
         return True
-    
+
 class UnsafePackageTestcase(TestCase):
     """ Tests various things in the packages package. Note that this package does
         not care to clean up and needs to run in a test wiki because of that. """
@@ -52,7 +52,7 @@
     def setUp(self):
         if not getattr(self.request.cfg, 'is_test_wiki', False):
             raise TestSkipped('This test needs to be run using the test wiki.')
-   
+
     def testBasicPackageThings(self):
         myPackage = DebugPackage(self.request, 'test')
         myPackage.installPackage()
@@ -66,3 +66,4 @@
     def testQuoting(self):
         for line in ([':foo', 'is\\', 'ja|', u't|', u'baAz'], [], ['', '']):
             self.assertEqual(line, unpackLine(packLine(line)))
+
--- a/MoinMoin/_tests/test_pysupport.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/_tests/test_pysupport.py	Fri Jul 07 12:30:34 2006 +0200
@@ -21,25 +21,25 @@
     def testNonExistingModule(self):
         """ pysupport: import nonexistent module raises ImportError """
         self.assertRaises(ImportError, pysupport.importName,
-                          'MoinMoin.parser.abcdefghijkl','Parser')
+                          'MoinMoin.parser.abcdefghijkl', 'Parser')
 
     def testNonExistingAttribute(self):
         """ pysupport: import nonexistent attritbue raises AttributeError """
         self.assertRaises(AttributeError, pysupport.importName,
-                          'MoinMoin.parser.text_moin_wiki','NoSuchParser')
+                          'MoinMoin.parser.text_moin_wiki', 'NoSuchParser')
 
     def testExisting(self):
         """ pysupport: import name from existing module """
         from MoinMoin.parser import text_moin_wiki
         Parser = pysupport.importName('MoinMoin.parser.text_moin_wiki', 'Parser')
         self.failUnless(Parser is text_moin_wiki.Parser)
-   
+
 
 class ImportNameFromPlugin(unittest.TestCase):
     """ Base class for import plugin tests """
-    
+
     name = 'Parser'
-    
+
     def setUp(self):
         """ Check for valid plugin package """
         self.pluginDirectory = os.path.join(self.request.cfg.data_dir, 'plugin', 'parser')
@@ -60,7 +60,7 @@
 
 
 class ImportNonExisiting(ImportNameFromPlugin):
-    
+
     plugin = 'NonExistingWikiPlugin'
 
     def testNonEsisting(self):
@@ -111,7 +111,7 @@
             file(self.pluginFilePath('.py'), 'w').write(data)
         except Exception, err:
             raise TestSkiped("Can't create test plugin: %s" % str(err))
-        
+
     def deleteTestPlugin(self):
         """ Delete plugin files ignoring missing files errors """
         if not self.shouldDeleteTestPlugin:
--- a/MoinMoin/_tests/test_request.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/_tests/test_request.py	Fri Jul 07 12:30:34 2006 +0200
@@ -8,18 +8,18 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-import unittest 
+import unittest
 from MoinMoin._tests import TestConfig
 from MoinMoin import config
 
 class NormalizePagenameTestCase(unittest.TestCase):
-            
+
     def testPageInvalidChars(self):
         """ request: normalize pagename: remove invalid unicode chars
 
         Assume the default setting
         """
-        test  = u'\u0000\u202a\u202b\u202c\u202d\u202e'
+        test = u'\u0000\u202a\u202b\u202c\u202d\u202e'
         expected = u''
         result = self.request.normalizePagename(test)
         self.assertEqual(result, expected,
@@ -27,7 +27,7 @@
 
     def testNormalizeSlashes(self):
         """ request: normalize pagename: normalize slashes """
-        cases  = (
+        cases = (
             (u'/////', u''),
             (u'/a', u'a'),
             (u'a/', u'a'),
@@ -42,7 +42,7 @@
 
     def testNormalizeWhitespace(self):
         """ request: normalize pagename: normalize whitespace """
-        cases  = (
+        cases = (
             (u'         ', u''),
             (u'    a', u'a'),
             (u'a    ', u'a'),
@@ -63,12 +63,12 @@
         Underscores should convert to spaces, then spaces should be
         normalized, order is important!
         """
-        cases  = (
-            (u'_________', u''),
-            (u'__a', u'a'),
-            (u'a__', u'a'),
-            (u'a__b__c', u'a b c'),
-            (u'a__b__/__c__d__/__e__f', u'a b/c d/e f'),
+        cases = (
+            (u'         ', u''),
+            (u'  a', u'a'),
+            (u'a  ', u'a'),
+            (u'a  b  c', u'a b c'),
+            (u'a  b  /  c  d  /  e  f', u'a b/c d/e f'),
             )
         for test, expected in cases:
             result = self.request.normalizePagename(test)
@@ -81,7 +81,7 @@
 
    def setUp(self):
        self.config = TestConfig(self.request,
-                                page_group_regex = r'.+Group')              
+                                page_group_regex=r'.+Group')
 
    def tearDown(self):
        del self.config
@@ -92,8 +92,8 @@
        Spaces should normalize after invalid chars removed!
        """
        import re
-       group = re.compile(r'.+Group', re.UNICODE)       
-       cases  = (
+       group = re.compile(r'.+Group', re.UNICODE)
+       cases = (
            # current acl chars
            (u'Name,:Group', u'NameGroup'),
            # remove than normalize spaces
@@ -112,42 +112,36 @@
 
     def testRFC1123Date(self):
         """ request: httpDate default rfc1123 """
-        self.failUnlessEqual(self.request.httpDate(0), 
+        self.failUnlessEqual(self.request.httpDate(0),
                              'Thu, 01 Jan 1970 00:00:00 GMT',
                              'wrong date string')
 
     def testRFC850Date(self):
         """ request: httpDate rfc850 """
-        self.failUnlessEqual(self.request.httpDate(0, rfc='850'), 
+        self.failUnlessEqual(self.request.httpDate(0, rfc='850'),
                              'Thursday, 01-Jan-70 00:00:00 GMT',
                              'wrong date string')
-                             
+
 
 class GetPageNameFromQueryString(unittest.TestCase):
     """ Test urls like http://netloc/wiki?pagename """
 
     def setUp(self):
         self.savedQuery = self.request.query_string
-    
+
     def tearDown(self):
         self.request.query_string = self.savedQuery
-    
+
     def testAscii(self):
         """ request: getPageNameFromQueryString: ascii """
         name = expected = u'page name'
         self.runTest(name, expected)
-        
+
     def testNonAscii(self):
         """ request: getPageNameFromQueryString: non ascii """
         name = expected = u'דף עברי'
         self.runTest(name, expected)
 
-    def testUnderscore(self):
-        """ request: getPageNameFromQueryString: under_score """
-        name = u'page_name'
-        expected = u'page name'
-        self.runTest(name, expected)
-        
     def runTest(self, name, expected):
         import urllib
         # query as made by most browsers when you type the url into the
@@ -155,3 +149,4 @@
         query = urllib.quote(name.encode('utf-8'))
         self.request.query_string = query
         self.assertEqual(self.request.getPageNameFromQueryString(), expected)
+
--- a/MoinMoin/_tests/test_search.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/_tests/test_search.py	Fri Jul 07 12:30:34 2006 +0200
@@ -21,7 +21,7 @@
 
     def setUp(self):
         self.parser = search.QueryParser()
-   
+
     def testIsQuoted(self):
         """ search: quoting bug - quoted terms """
         for case in ('"yes"', "'yes'"):
@@ -29,8 +29,8 @@
 
     def testIsNot(self):
         """ search: quoting bug - unquoted terms """
-        tests = ('', "'", '"', '""', "''", "'\"",'"no', 'no"', "'no", 
+        tests = ('', "'", '"', '""', "''", "'\"", '"no', 'no"', "'no",
                  "no'", '"no\'')
         for case in tests:
             self.assertEqual(self.parser.isQuoted(case), False)
-    
+
--- a/MoinMoin/_tests/test_security.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/_tests/test_security.py	Fri Jul 07 12:30:34 2006 +0200
@@ -13,14 +13,13 @@
 acliter = security.ACLStringIterator
 
 class ACLStringIteratorTestCase(unittest.TestCase):
-    
+
     def setUp(self):
         self.config = TestConfig(self.request,
                                  defaults=['acl_rights_valid', 'acl_rights_before'])
-                
     def tearDown(self):
         del self.config
-        
+
     def testEmpty(self):
         """ security: empty acl string raise StopIteration """
         iter = acliter(self.request.cfg.acl_rights_valid, '')
@@ -30,16 +29,16 @@
         """ security: white space acl string raise StopIteration """
         iter = acliter(self.request.cfg.acl_rights_valid, '       ')
         self.failUnlessRaises(StopIteration, iter.next)
-            
+
     def testDefault(self):
         """ security: default meta acl """
         iter = acliter(self.request.cfg.acl_rights_valid, 'Default Default')
         for mod, entries, rights in iter:
             self.assertEqual(entries, ['Default'])
             self.assertEqual(rights, [])
-                
+
     def testEmptyRights(self):
-        """ security: empty rights """    
+        """ security: empty rights """
         iter = acliter(self.request.cfg.acl_rights_valid, 'WikiName:')
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['WikiName'])
@@ -57,21 +56,21 @@
         iter = acliter(self.request.cfg.acl_rights_valid, 'UserOne,UserTwo:read,write')
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['UserOne', 'UserTwo'])
-        self.assertEqual(rights, ['read', 'write'])      
-        
+        self.assertEqual(rights, ['read', 'write'])
+
     def testMultipleEntries(self):
         """ security: multiple entries """
         iter = acliter(self.request.cfg.acl_rights_valid, 'UserOne:read,write UserTwo:read All:')
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['UserOne'])
-        self.assertEqual(rights, ['read', 'write'])      
+        self.assertEqual(rights, ['read', 'write'])
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['UserTwo'])
-        self.assertEqual(rights, ['read'])      
+        self.assertEqual(rights, ['read'])
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['All'])
-        self.assertEqual(rights, [])      
-       
+        self.assertEqual(rights, [])
+
     def testNameWithSpaces(self):
         """ security: single name with spaces """
         iter = acliter(self.request.cfg.acl_rights_valid, 'user one:read')
@@ -84,27 +83,27 @@
         iter = acliter(self.request.cfg.acl_rights_valid, 'user one,user two:read')
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['user one', 'user two'])
-        self.assertEqual(rights, ['read'])      
-        
+        self.assertEqual(rights, ['read'])
+
     def testMultipleEntriesWithSpaces(self):
         """ security: multiple entries with spaces """
         iter = acliter(self.request.cfg.acl_rights_valid, 'user one:read,write user two:read')
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['user one'])
-        self.assertEqual(rights, ['read', 'write'])      
+        self.assertEqual(rights, ['read', 'write'])
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['user two'])
-        self.assertEqual(rights, ['read'])      
-         
+        self.assertEqual(rights, ['read'])
+
     def testMixedNames(self):
         """ security: mixed wiki names and names with spaces """
         iter = acliter(self.request.cfg.acl_rights_valid, 'UserOne,user two:read,write user three,UserFour:read')
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['UserOne', 'user two'])
-        self.assertEqual(rights, ['read', 'write'])      
+        self.assertEqual(rights, ['read', 'write'])
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['user three', 'UserFour'])
-        self.assertEqual(rights, ['read'])      
+        self.assertEqual(rights, ['read'])
 
     def testModifier(self):
         """ security: acl modifiers """
@@ -117,7 +116,7 @@
         self.assertEqual(mod, '-')
         self.assertEqual(entries, ['UserTwo'])
         self.assertEqual(rights, [])
-        
+
     def testIgnoreInvalidACL(self):
         """ security: ignore invalid acl
 
@@ -129,7 +128,7 @@
         self.assertEqual(entries, ['UserOne'])
         self.assertEqual(rights, ['read'])
         self.failUnlessRaises(StopIteration, iter.next)
-        
+
     def testEmptyNamesWithRight(self):
         """ security: empty names with rights
 
@@ -142,7 +141,7 @@
         self.assertEqual(rights, ['read'])
         mod, entries, rights = iter.next()
         self.assertEqual(entries, [])
-        self.assertEqual(rights, ['read'])        
+        self.assertEqual(rights, ['read'])
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['All'])
         self.assertEqual(rights, [])
@@ -151,7 +150,7 @@
         """ security: ignore rights not in acl_rights_valid """
         iter = acliter(self.request.cfg.acl_rights_valid, 'UserOne:read,sing,write,drink,sleep')
         mod, entries, rights = iter.next()
-        self.assertEqual(rights, ['read', 'write'])        
+        self.assertEqual(rights, ['read', 'write'])
 
     def testBadGuy(self):
         """ security: bad guy may not allowed anything
@@ -169,14 +168,14 @@
         iter = acliter(self.request.cfg.acl_rights_valid, 'UserOne,user two:read,write   user three,UserFour:read  All:')
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['UserOne', 'user two'])
-        self.assertEqual(rights, ['read', 'write'])      
+        self.assertEqual(rights, ['read', 'write'])
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['user three', 'UserFour'])
-        self.assertEqual(rights, ['read'])      
+        self.assertEqual(rights, ['read'])
         mod, entries, rights = iter.next()
         self.assertEqual(entries, ['All'])
-        self.assertEqual(rights, [])            
-       
+        self.assertEqual(rights, [])
+
 
 class AclTestCase(unittest.TestCase):
     """ security: testing access control list
@@ -187,12 +186,12 @@
         # Backup user
         self.config = TestConfig(self.request, defaults=['acl_rights_valid', 'acl_rights_before'])
         self.savedUser = self.request.user.name
-        
+
     def tearDown(self):
         # Restore user
         self.request.user.name = self.savedUser
         del self.config
-        
+
     def testApplyACLByUser(self):
         """ security: applying acl by user name"""
         # This acl string...
@@ -226,7 +225,7 @@
             # All other users - every one not mentioned in the acl lines
             ('All',                 ('read',)),
             ('Anonymous',           ('read',)),
-            )       
+            )
 
         # Check rights
         for user, may in users:
@@ -240,4 +239,4 @@
             for right in mayNot:
                 self.failIf(acl.may(self.request, user, right),
                     '"%(user)s" should NOT be allowed to "%(right)s"' % locals())
-            
+
--- a/MoinMoin/_tests/test_user.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/_tests/test_user.py	Fri Jul 07 12:30:34 2006 +0200
@@ -20,7 +20,7 @@
         """user: encode ascii password"""
         # u'MoinMoin' and 'MoinMoin' should be encoded to same result
         expected = "{SHA}X+lk6KR7JuJEH43YnmettCwICdU="
-        
+
         result = user.encodePassword("MoinMoin")
         self.assertEqual(result, expected,
                          'Expected "%(expected)s" but got "%(result)s"' % locals())
@@ -43,7 +43,7 @@
         # Save original user and cookie
         self.saved_cookie = self.request.saved_cookie
         self.saved_user = self.request.user
-        
+
         # Create anon user for the tests
         self.request.saved_cookie = ''
         self.request.user = user.User(self.request)
@@ -54,7 +54,7 @@
             del dircache.cache[self.request.cfg.user_dir]
         except KeyError:
             pass
-        
+
     def tearDown(self):
         """ Run after each test
         
@@ -72,25 +72,25 @@
         # Restore original user
         self.request.saved_cookie = self.saved_cookie
         self.request.user = self.saved_user
-                
+
         # Remove user name to id cache, or next test will fail
         caching.CacheEntry(self.request, 'user', 'name2id', scope='wiki').remove()
         del self.request.cfg._name2id
-        
+
         # Prevent user list caching - we create and delete users too
         # fast for that.
         try:
             del dircache.cache[self.request.cfg.user_dir]
         except KeyError:
             pass
-              
+
     def testAsciiPassword(self):
         """ user: login with ascii password """
         # Create test user
         name = u'__Non Existent User Name__'
         password = name
         self.createUser(name, password)
-        
+
         # Try to "login"           
         theUser = user.User(self.request, name=name, password=password)
         self.failUnless(theUser.valid, "Can't login with ascii password")
@@ -101,7 +101,7 @@
         name = u'__שם משתמש לא קיים__' # Hebrew
         password = name
         self.createUser(name, password)
-        
+
         # Try to "login"
         theUser = user.User(self.request, name=name, password=password)
         self.failUnless(theUser.valid, "Can't login with unicode password")
@@ -119,7 +119,7 @@
         name = u'__Jürgen Herman__'
         password = name
         self.createUser(name, password, charset='iso-8859-1')
-        
+
         # Try to "login"           
         theUser = user.User(self.request, name=name, password=password)
         self.failUnless(theUser.valid, "Can't login with old unicode password")
@@ -136,7 +136,6 @@
         name = u'__Jürgen Herman__'
         password = name
         self.createUser(name, password, charset='iso-8859-1')
-        
         # Login - this should replace the old password in the user file         
         theUser = user.User(self.request, name=name, password=password)
         # Login again - the password should be new unicode password
@@ -144,61 +143,61 @@
         theUser = user.User(self.request, name=name, password=password)
         self.assertEqual(theUser.enc_password, expected,
                          "User password was not replaced with new")
-            
+
     # Helpers ---------------------------------------------------------
-    
+
     def createUser(self, name, password, charset='utf-8'):
         """ helper to create test user 
         
         charset is used to create user with pre 1.3 password hash
         """
         # Hack self.request form to contain the password
-        self.request.form['password'] = [password]  
-        
+        self.request.form['password'] = [password]
+
         # Create user
         self.user = user.User(self.request)
         self.user.name = name
         self.user.enc_password = user.encodePassword(password, charset=charset)
-        
+
         # Validate that we are not modifying existing user data file!
         if self.user.exists():
             self.user = None
             raise TestsSkiped("Test user exists, will not override existing"
                               " user data file!")
-        
+
         # Save test user
         self.user.save()
-        
+
         # Validate user creation
         if not self.user.exists():
             self.user = None
             raise TestsSkiped("Can't create test user")
-                        
+
 
 class GroupNameTestCase(unittest.TestCase):
 
     def setUp(self):
         self.config = TestConfig(self.request,
-                                 page_group_regex = r'.+Group')              
+                                 page_group_regex=r'.+Group')
 
     def tearDown(self):
         del self.config
 
     import re
     group = re.compile(r'.+Group', re.UNICODE)
-    
+
     def testGroupNames(self):
-        """ user: isValidName: reject group names """   
+        """ user: isValidName: reject group names """
         test = u'AdminGroup'
         assert self.group.search(test)
         result = user.isValidName(self.request, test)
         expected = False
         self.assertEqual(result, expected,
-                        'Expected "%(expected)s" but got "%(result)s"' % locals()) 
-            
+                        'Expected "%(expected)s" but got "%(result)s"' % locals())
+
 
 class IsValidNameTestCase(unittest.TestCase):
-    
+
     def testNonAlnumCharacters(self):
         """ user: isValidName: reject unicode non alpha numeric characters
 
@@ -209,9 +208,9 @@
         expected = False
         for c in invalid:
             name = base % c
-            result = user.isValidName(self.request, name)           
+            result = user.isValidName(self.request, name)
         self.assertEqual(result, expected,
-                         'Expected "%(expected)s" but got "%(result)s"' % locals()) 
+                         'Expected "%(expected)s" but got "%(result)s"' % locals())
 
     def testWhitespace(self):
         """ user: isValidName: reject leading, trailing or multiple whitespace """
@@ -222,7 +221,7 @@
             )
         expected = False
         for test in cases:
-            result = user.isValidName(self.request, test)          
+            result = user.isValidName(self.request, test)
             self.assertEqual(result, expected,
                          'Expected "%(expected)s" but got "%(result)s"' % locals())
 
@@ -236,8 +235,7 @@
             )
         expected = True
         for test in cases:
-            result = user.isValidName(self.request, test)          
+            result = user.isValidName(self.request, test)
             self.assertEqual(result, expected,
                              'Expected "%(expected)s" but got "%(result)s"' % locals())
 
-
--- a/MoinMoin/_tests/test_widget_html.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/_tests/test_widget_html.py	Fri Jul 07 12:30:34 2006 +0200
@@ -48,13 +48,13 @@
 
         actions = (
             # action, data, expected
-            (element.append, 
+            (element.append,
              html.Text('Text & '),
              '<p>Text &amp; </p>'),
-            (element.append, 
+            (element.append,
              html.Text('more text. '),
              '<p>Text &amp; more text. </p>'),
-            (element.extend, 
+            (element.extend,
              (html.Text('And then '), html.Text('some.')),
              '<p>Text &amp; more text. And then some.</p>'),
             )
@@ -64,5 +64,4 @@
             result = unicode(element)
             self.assertEqual(result, expected,
                              'Expected "%(expected)s" but got "%(result)s"' % locals())
-            
 
--- a/MoinMoin/_tests/test_wikidicts.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/_tests/test_wikidicts.py	Fri Jul 07 12:30:34 2006 +0200
@@ -9,7 +9,7 @@
 import unittest
 import re
 
-from MoinMoin import wikidicts 
+from MoinMoin import wikidicts
 from MoinMoin import Page
 
 class GroupPageTestCase(unittest.TestCase):
@@ -61,12 +61,12 @@
  *   take this  
 """
         self.assertEqual(self.getMembers(text), ['take this'])
-        
+
     def getMembers(self, text):
         group = wikidicts.Group(self.request, '')
         group.initFromText(text)
         return group.members()
-        
+
 
 class DictPageTestCase(unittest.TestCase):
 
@@ -85,10 +85,10 @@
  Last:: last item
 '''
         d = wikidicts.Dict(self.request, '')
-        d.initFromText(text)        
+        d.initFromText(text)
         self.assertEqual(d['First'], 'first item')
         self.assertEqual(d['text with spaces'], 'second item')
-        self.assertEqual(d['Empty string'], '')        
+        self.assertEqual(d['Empty string'], '')
         self.assertEqual(d['Last'], 'last item')
 
 
@@ -106,4 +106,5 @@
         systemPages = wikidicts.Group(self.request, 'SystemPagesGroup')
         for member in systemPages.members():
             self.assert_(self.request.dicts.has_member('SystemPagesGroup', member),
-                         '%s should be in request.dict' % member)    
+                         '%s should be in request.dict' % member)
+
--- a/MoinMoin/_tests/test_wikixml_marshal.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/_tests/test_wikixml_marshal.py	Fri Jul 07 12:30:34 2006 +0200
@@ -12,7 +12,7 @@
 
 class MarshalTestCase(unittest.TestCase):
     """Testing Marshal used for ...XXX"""
-    
+
     class Data:
         cvar = 'Class Variable'
         def __init__(self, value):
@@ -28,22 +28,22 @@
         (1, '<data><prop>1</prop></data>'),
         (Data('value'), '<data><prop><data><ivar>value</ivar></data></prop></data>'),
         (array.array("i", [42]), "<data><prop>array('i', [42])</prop></data>"),
-        (buffer("0123456789", 2, 3),"<data><prop>234</prop></data>"),        
+        (buffer("0123456789", 2, 3), "<data><prop>234</prop></data>"),
         )
-        
+
     def setUp(self):
         self.obj = marshal.Marshal()
-        
+
     def testCreateMarshal(self):
         """wikixml.marshal: create new marshal"""
         self._checkData(self.obj, '<data></data>')
-        
+
     def testSetMarshalProperty(self):
         """wikixml.marshal: setting marshal property"""
         for value, xml in self.prop:
             self.obj.prop = value
             self._checkData(self.obj, xml)
-    
+
     def _canonize(self, xml):
         xml = xml.replace('\n', '')
         return xml
@@ -51,5 +51,6 @@
     def _checkData(self, obj, xml):
         objXML = self._canonize(obj.toXML())
         expected = self._canonize(xml)
-        self.assertEqual(objXML, expected, 
+        self.assertEqual(objXML, expected,
             'Expected "%(expected)s" but got "%(objXML)s"' % locals())
+
--- a/MoinMoin/action/AttachFile.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/action/AttachFile.py	Fri Jul 07 12:30:34 2006 +0200
@@ -121,7 +121,7 @@
     if not files: return ''
 
     attach_count = _('[%d attachments]') % len(files)
-    attach_icon = request.theme.make_icon('attach', vars={ 'attach_count': attach_count })
+    attach_icon = request.theme.make_icon('attach', vars={'attach_count': attach_count})
     attach_link = wikiutil.link_tag(request,
         "%s?action=AttachFile" % wikiutil.quoteWikinameURL(pagename),
         attach_icon,
@@ -192,7 +192,7 @@
         os.chmod(fpath, 0666 & config.umask)
 
         _addLogEntry(request, 'ATTNEW', pagename, target)
-        
+
         return target
 
 
@@ -268,7 +268,7 @@
         label_install = _("install")
 
         for file in files:
-            fsize = float(os.stat(os.path.join(attach_dir,file).encode(config.charset))[6]) # in byte
+            fsize = float(os.stat(os.path.join(attach_dir, file).encode(config.charset))[6]) # in byte
             fsize = "%.1f" % (fsize / 1024)
             baseurl = request.getScriptname()
             action = action_name
@@ -301,7 +301,7 @@
             if (packages.ZipPackage(request, os.path.join(attach_dir, file).encode(config.charset)).isPackage() and
                 request.user.isSuperUser()):
                 viewlink += ' | <a href="%(baseurl)s/%(urlpagename)s?action=%(action)s&amp;do=install&amp;target=%(urlfile)s">%(label_install)s</a>' % parmdict
-            elif (zipfile.is_zipfile(os.path.join(attach_dir,file).encode(config.charset)) and
+            elif (zipfile.is_zipfile(os.path.join(attach_dir, file).encode(config.charset)) and
                 request.user.may.read(pagename) and request.user.may.delete(pagename)
                 and request.user.may.write(pagename)):
                 viewlink += ' | <a href="%(baseurl)s/%(urlpagename)s?action=%(action)s&amp;do=unzip&amp;target=%(urlfile)s">%(label_unzip)s</a>' % parmdict
@@ -581,7 +581,7 @@
         bsindex = target.rfind('\\')
         if bsindex >= 0:
             target = target[bsindex+1:]
-    
+
     # add the attachment
     try:
         add_attachment(request, pagename, target, filecontent)
@@ -613,10 +613,10 @@
 
     if ext == '.draw':
         _addLogEntry(request, 'ATTDRW', pagename, basename + ext)
-        filecontent = filecontent.replace("\r","")
+        filecontent = filecontent.replace("\r", "")
 
     savepath = os.path.join(getAttachDir(request, pagename), basename + ext)
-    if ext == '.map' and filecontent.strip()=='':
+    if ext == '.map' and not filecontent.strip():
         # delete map file if it is empty
         os.unlink(savepath)
     else:
@@ -675,9 +675,9 @@
 
     if package.isPackage():
         if package.installPackage():
-            msg=_("Attachment '%(filename)s' installed.") % {'filename': wikiutil.escape(target)}
+            msg = _("Attachment '%(filename)s' installed.") % {'filename': wikiutil.escape(target)}
         else:
-            msg=_("Installation of '%(filename)s' failed.") % {'filename': wikiutil.escape(target)}
+            msg = _("Installation of '%(filename)s' failed.") % {'filename': wikiutil.escape(target)}
         if package.msg != "":
             msg += "<br><pre>" + wikiutil.escape(package.msg) + "</pre>"
     else:
@@ -710,7 +710,7 @@
 
         available_attachments_file_space = attachments_file_space - fsize
         available_attachments_file_count = attachments_file_count - fcount
-        
+
         if zipfile.is_zipfile(fpath):
             zf = zipfile.ZipFile(fpath)
             sum_size_over_all_valid_files = 0.0
@@ -727,19 +727,19 @@
                     count_valid_files += 1
 
             if sum_size_over_all_valid_files > available_attachments_file_space:
-                msg=_("Attachment '%(filename)s' could not be unzipped because"
-                      " the resulting files would be too large (%(space)d kB"
-                      " missing).") % {
-                        'filename': filename,
-                        'space': (sum_size_over_all_valid_files -
-                              available_attachments_file_space) / 1000 }
+                msg = _("Attachment '%(filename)s' could not be unzipped because"
+                        " the resulting files would be too large (%(space)d kB"
+                        " missing).") % {
+                            'filename': filename,
+                            'space': (sum_size_over_all_valid_files -
+                                available_attachments_file_space) / 1000 }
             elif count_valid_files > available_attachments_file_count:
-                msg=_("Attachment '%(filename)s' could not be unzipped because"
-                      " the resulting files would be too many (%(count)d "
-                      "missing).") % {
-                        'filename': filename,
-                        'count': (count_valid_files -
-                                  available_attachments_file_count) }
+                msg = _("Attachment '%(filename)s' could not be unzipped because"
+                        " the resulting files would be too many (%(count)d "
+                        "missing).") % {
+                            'filename': filename,
+                            'count': (count_valid_files -
+                                available_attachments_file_count) }
             else:
                 valid_name = False
                 for (origname, finalname) in namelist.iteritems():
@@ -760,11 +760,11 @@
                                     _addLogEntry(request, 'ATTNEW', pagename, finalname)
 
                 if valid_name:
-                    msg=_("Attachment '%(filename)s' unzipped.") % {'filename': filename}
+                    msg = _("Attachment '%(filename)s' unzipped.") % {'filename': filename}
                 else:
-                    msg=_("Attachment '%(filename)s' not unzipped because the "
-                          "files are too big, .zip files only, exist already or "
-                          "reside in folders.") % {'filename': filename}
+                    msg = _("Attachment '%(filename)s' not unzipped because the "
+                            "files are too big, .zip files only, exist already or "
+                            "reside in folders.") % {'filename': filename}
         else:
             msg = _('The file %(target)s is not a .zip file.' % target)
 
@@ -798,7 +798,7 @@
 
     package = packages.ZipPackage(request, fpath)
     if package.isPackage():
-        request.write("<pre><b>%s</b>\n%s</pre>" % (_("Package script:"),wikiutil.escape(package.getScript())))
+        request.write("<pre><b>%s</b>\n%s</pre>" % (_("Package script:"), wikiutil.escape(package.getScript())))
         return
 
     import zipfile
@@ -854,7 +854,7 @@
     data.columns = [
         Column('page', label=('Page')),
         Column('file', label=('Filename')),
-        Column('size',  label=_('Size'), align='right'),
+        Column('size', label=_('Size'), align='right'),
         #Column('action', label=_('Action')),
     ]
 
--- a/MoinMoin/action/DeletePage.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/action/DeletePage.py	Fri Jul 07 12:30:34 2006 +0200
@@ -27,20 +27,20 @@
     def is_allowed(self):
         may = self.request.user.may
         return may.write(self.pagename) and may.delete(self.pagename)
-    
+
     def check_condition(self):
         _ = self._
         if not self.page.exists():
             return _('This page is already deleted or was never created!')
         else:
             return None
-        
+
     def do_action(self):
         """ Delete pagename """
         form = self.form
         comment = form.get('comment', [u''])[0]
         comment = wikiutil.clean_comment(comment)
-        
+
         # Create a page editor that does not do editor backups, because
         # delete generates a "deleted" version of the page.
         self.page = PageEditor(self.request, self.pagename, do_editor_backup=0)
--- a/MoinMoin/action/Despam.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/action/Despam.py	Fri Jul 07 12:30:34 2006 +0200
@@ -17,8 +17,8 @@
 from MoinMoin.macro import RecentChanges
 
 def show_editors(request, pagename, timestamp):
-    _ =  request.getText
-    
+    _ = request.getText
+
     timestamp = int(timestamp * 1000000)
     log = editlog.EditLog(request)
     editors = {}
@@ -26,15 +26,15 @@
     for line in log.reverse():
         if line.ed_time_usecs < timestamp:
             break
-        
+
         if not request.user.may.read(line.pagename):
             continue
-        
+
         editor = line.getEditor(request)
         if not line.pagename in pages:
             pages[line.pagename] = 1
             editors[editor] = editors.get(editor, 0) + 1
-            
+
     editors = [(nr, editor) for editor, nr in editors.iteritems()]
     editors.sort()
 
@@ -46,7 +46,7 @@
                        Column('link', label='', align='left')]
     for nr, editor in editors:
         dataset.addRow((editor, unicode(nr), pg.link_to(request, text=_("Select Author"), querystr="action=Despam&editor=%s" % wikiutil.url_quote_plus(editor))))
-    
+
     table = DataBrowserWidget(request)
     table.setData(dataset)
     table.render()
@@ -55,8 +55,8 @@
     pass
 
 def show_pages(request, pagename, editor, timestamp):
-    _ =  request.getText
-    
+    _ = request.getText
+
     timestamp = int(timestamp * 1000000)
     log = editlog.EditLog(request)
     lines = []
@@ -70,7 +70,7 @@
     for line in log.reverse():
         if line.ed_time_usecs < timestamp:
             break
-        
+
         if not request.user.may.read(line.pagename):
             continue
 
@@ -125,9 +125,9 @@
         except pg.SaveError, msg:
             savemsg = unicode(msg)
     return savemsg
-    
+
 def revert_pages(request, editor, timestamp):
-    _ =  request.getText
+    _ = request.getText
 
     editor = wikiutil.url_unquote(editor, want_unicode=False)
     timestamp = int(timestamp * 1000000)
@@ -162,7 +162,7 @@
     if actname in request.cfg.actions_excluded or \
        not request.user.isSuperUser():
         return Page.Page(request, pagename).send_page(request,
-            msg = _('You are not allowed to use this action.'))
+            msg=_('You are not allowed to use this action.'))
 
     editor = request.form.get('editor', [None])[0]
     timestamp = time.time() - 24 * 3600
@@ -170,10 +170,10 @@
     ok = request.form.get('ok', [0])[0]
 
     request.http_headers()
-    request.theme.send_title("Despam", pagename=pagename)    
+    request.theme.send_title("Despam", pagename=pagename)
     # Start content (important for RTL support)
     request.write(request.formatter.startContent("content"))
-    
+
     if ok:
         revert_pages(request, editor, timestamp)
     elif editor:
--- a/MoinMoin/action/rss_rc.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/action/rss_rc.py	Fri Jul 07 12:30:34 2006 +0200
@@ -54,8 +54,9 @@
     if interwiki[-1] != "/": interwiki = interwiki + "/"
 
     logo = re.search(r'src="([^"]*)"', cfg.logo_string)
-    if logo: logo = request.getQualifiedURL(logo.group(1))
-    
+    if logo:
+        logo = request.getQualifiedURL(logo.group(1))
+
     log = editlog.EditLog(request)
     logdata = []
     counter = 0
@@ -148,7 +149,7 @@
             handler.simpleNode('link', link+"?action=diff")
         else:
             handler.simpleNode('link', link)
-            
+
         handler.simpleNode(('dc', 'date'), timefuncs.W3CDate(item.time))
 
         # description
@@ -183,10 +184,10 @@
         else: # 'ip'
             edname = item.editor[1]
             ##edattr[(None, 'link')] = link + "?action=info"
-        
+
         # this edattr stuff, esp. None as first tuple element breaks things (tracebacks)
         # if you know how to do this right, please send us a patch
-        
+
         handler.startNode(('dc', 'contributor'))
         handler.startNode(('rdf', 'Description'), attr=edattr)
         handler.simpleNode(('rdf', 'value'), edname)
@@ -221,6 +222,4 @@
     # send the generated XML document
     request.http_headers(httpheaders)
     request.write(out.getvalue())
-    request.finish()
-    request.no_closing_html_code = 1
 
--- a/MoinMoin/i18n/__init__.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/i18n/__init__.py	Fri Jul 07 12:30:34 2006 +0200
@@ -97,7 +97,7 @@
     def __init__(self, language, domain='MoinMoin'):
         self.language = language
         self.domain = domain
-        
+
     def load_mo(self, filename):
         """ load the mo file, setup some attributes from metadata """
         # binary files have to be opened in the binary file mode!
@@ -108,7 +108,7 @@
         self.direction = info['x-direction']
         assert self.direction in ('ltr', 'rtl', )
         self.maintainer = info['last-translator']
-    
+
     def formatMarkup(self, request, text, currentStack=[]):
         """
         Formats the text passed according to wiki markup.
@@ -140,7 +140,7 @@
         formatter.setPage(p)
         parser.format(formatter)
         text = out.getvalue()
-        if reqformatter == None:
+        if reqformatter is None:
             del request.formatter
         else:
             request.formatter = reqformatter
@@ -186,10 +186,10 @@
             if debug:
                 request.log("i18n: dumping lang %s" % lang)
             cache.update(pickle.dumps((uc_texts, uc_unformatted), PICKLE_PROTOCOL))
-        
+
         self.formatted = uc_texts
         self.raw = uc_unformatted
-        
+
 
 def getDirection(lang):
     """ Return the text direction for a language, either 'ltr' or 'rtl'. """
@@ -273,7 +273,7 @@
                 if request.http_accept_language:
                     request.setHttpHeader('Vary: Accept-Language')
                 return lang
-    
+
     # Or return the wiki default language...
     if request.cfg.language_default in available:
         lang = request.cfg.language_default
--- a/MoinMoin/macro/NewPage.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/macro/NewPage.py	Fri Jul 07 12:30:34 2006 +0200
@@ -9,6 +9,7 @@
     @copyright: 2004 Vito Miliano (vito_moinnewpagewithtemplate@perilith.com)
     @copyright: 2004 by Nir Soffer <nirs@freeshell.org>
     @copyright: 2004 Alexander Schremmer <alex AT alexanderweb DOT de>
+    @copyright: 2006 MoinMoin:ReimarBauer
     @license: GNU GPL, see COPYING for details.
 """
 
@@ -75,6 +76,9 @@
         label = self.args.get('buttonLabel')
         nametemplate = self.args.get('nameTemplate') or u'%s'
         
+        if parent == '@ME' and self.request.user.valid:
+            parent = self.request.user.name
+        
         requires_input = nametemplate.find('%s') != -1
         
         if label:
--- a/MoinMoin/parser/text_rst.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/parser/text_rst.py	Fri Jul 07 12:30:34 2006 +0200
@@ -28,8 +28,8 @@
 
 # --- make docutils safe by overriding all module-scoped names related to IO ---
 
-# TODO: Add an error message to dummyOpen so that the user knows what they did
-# requested an unsupported feature of docutils in MoinMoin.
+# TODO: Add an error message to dummyOpen so that the user knows that
+# they requested an unsupported feature of Docutils in MoinMoin.
 def dummyOpen(x, y=None, z=None): return
 
 class dummyIO(StringIO.StringIO):
@@ -70,7 +70,7 @@
             _ = self.request.getText
             from MoinMoin.parser.text import Parser as TextParser
             self.request.write(formatter.sysmsg(1) +
-                               formatter.rawHTML(_('Rendering of reStructured text is not possible, ''please'' install docutils.')) +
+                               formatter.rawHTML(_('Rendering of reStructured text is not possible, please install Docutils.')) +
                                formatter.sysmsg(0))
             TextParser(self.raw, self.request).format(formatter)
     
@@ -165,7 +165,7 @@
                                  self)
         self.document.walkabout(visitor)
         self.visitor = visitor
-        # Docutils 0.5.0 and later require the writer to have the visitor 
+        # Docutils 0.5 and later require the writer to have the visitor 
         # attributes.
         if (hasattr(html4css1.Writer, 'visitor_attributes')):
             for attr in html4css1.Writer.visitor_attributes:
@@ -200,10 +200,12 @@
 
         html = []
         if parts['title']:
+            # Document title.
             html.append(formatter.rawHTML('<h1>%s</h1>' % parts['title']))
-        # If there is only one subtitle then it is held in parts['subtitle'].
-        # However, if there is more than one subtitle then this is empty and
-        # fragment contains all of the subtitles.
+        # If there is only one subtitle it is propagated by Docutils
+        # to a document subtitle and is held in parts['subtitle'].
+        # However, if there is more than one subtitle then this is
+        # empty and fragment contains all of the subtitles.
         if parts['subtitle']:
             html.append(formatter.rawHTML('<h2>%s</h2>' % parts['subtitle']))
         if parts['docinfo']:
@@ -379,7 +381,7 @@
                     node['classes'].append(prefix)
             else:
                 # Default case - make a link to a wiki page.
-                page = MoinMoin.Page.Page(self.request, refuri)
+                page = Page(self.request, refuri)
                 node['refuri'] = page.url(self.request)
                 if not page.exists():
                     node['classes'].append('nonexistent')
--- a/MoinMoin/request/__init__.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/request/__init__.py	Fri Jul 07 12:30:34 2006 +0200
@@ -165,7 +165,6 @@
             self.logger = None
             self.pragma = {}
             self.mode_getpagelinks = 0
-            self.no_closing_html_code = 0
 
             self.lang = i18n.requestLanguage(self) 
             # Language for content. Page content should use the wiki default lang,
--- a/MoinMoin/theme/__init__.py	Fri Jul 07 12:28:54 2006 +0200
+++ b/MoinMoin/theme/__init__.py	Fri Jul 07 12:30:34 2006 +0200
@@ -1690,14 +1690,13 @@
         request.clock.stop('total')
 
         # Close html code
-        if not request.no_closing_html_code:
-            if (request.cfg.show_timings and
-                request.form.get('action', [None])[0] != 'print'):
-                request.write('<ul id="timings">\n')
-                for t in request.clock.dump():
-                    request.write('<li>%s</li>\n' % t)
-                request.write('</ul>\n')
-            #request.write('<!-- auth_method == %s -->' % repr(request.user.auth_method))
-            request.write('</body>\n</html>\n\n')
+        if (request.cfg.show_timings and
+            request.form.get('action', [None])[0] != 'print'):
+            request.write('<ul id="timings">\n')
+            for t in request.clock.dump():
+                request.write('<li>%s</li>\n' % t)
+            request.write('</ul>\n')
+        #request.write('<!-- auth_method == %s -->' % repr(request.user.auth_method))
+        request.write('</body>\n</html>\n\n')
 
 
--- a/docs/CHANGES	Fri Jul 07 12:28:54 2006 +0200
+++ b/docs/CHANGES	Fri Jul 07 12:30:34 2006 +0200
@@ -156,6 +156,8 @@
       engines don't fetch the targets (if they do, they will just get 403 and
       cause unnecessary traffic).
     * Included EmbedObject macro for embedding shockwave flash, mp3, visio, ...
+    * @SIG@ etc. generate local time stamps now, no difference visible on page
+      view.
 
   Bugfixes:
     * on action "info" page, "revert" link will not be displayed for empty page