changeset 1791:6dd2e29acffe

Eclipse PyDev Check: fixed lots of its errors and warnings
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 23 Feb 2007 02:16:07 +0100
parents abe8fa4a13b2
children c907c2942372
files MoinMoin/Page.py MoinMoin/PageEditor.py MoinMoin/PageGraphicalEditor.py MoinMoin/_tests/_test_template.py MoinMoin/_tests/broken/test_converter_text_html_text_moin_wiki.py MoinMoin/_tests/test_formatter.py MoinMoin/_tests/test_macro.py MoinMoin/_tests/test_security.py MoinMoin/_tests/test_user.py MoinMoin/_tests/test_wikisync.py MoinMoin/action/AttachFile.py MoinMoin/action/LikePages.py MoinMoin/action/MyPages.py MoinMoin/action/PackagePages.py MoinMoin/action/RenamePage.py MoinMoin/action/SubscribeUser.py MoinMoin/action/SyncPages.py MoinMoin/action/backup.py MoinMoin/action/bookmark.py MoinMoin/action/fckdialog.py MoinMoin/action/login.py MoinMoin/action/rss_rc.py MoinMoin/action/titleindex.py MoinMoin/caching.py MoinMoin/config/multiconfig.py MoinMoin/filter/EXIF.py MoinMoin/filter/text_html.py MoinMoin/formatter/dom_xml.py MoinMoin/formatter/text_docbook.py MoinMoin/formatter/text_gedit.py MoinMoin/formatter/text_html.py MoinMoin/formatter/text_xml.py MoinMoin/i18n/__init__.py MoinMoin/i18n/msgfmt.py MoinMoin/logfile/editlog.py MoinMoin/logfile/eventlog.py MoinMoin/macro/Action.py MoinMoin/macro/AdvancedSearch.py MoinMoin/macro/EditTemplates.py MoinMoin/macro/EmbedObject.py MoinMoin/macro/FullSearch.py MoinMoin/macro/ImageLink.py MoinMoin/macro/Include.py MoinMoin/macro/Navigation.py MoinMoin/macro/PageHits.py MoinMoin/macro/RandomQuote.py MoinMoin/macro/RecentChanges.py MoinMoin/macro/SystemAdmin.py MoinMoin/macro/WantedPages.py MoinMoin/macro/__init__.py MoinMoin/mail/mailimport.py MoinMoin/packages.py MoinMoin/parser/_ParserBase.py MoinMoin/parser/text_docbook.py MoinMoin/parser/text_irssi.py MoinMoin/parser/text_xslt.py MoinMoin/request/CGI.py MoinMoin/request/CLI.py MoinMoin/request/FCGI.py MoinMoin/request/MODPYTHON.py MoinMoin/request/STANDALONE.py MoinMoin/request/TWISTED.py MoinMoin/request/WSGI.py MoinMoin/script/__init__.py MoinMoin/script/account/check.py MoinMoin/script/account/create.py MoinMoin/script/account/disable.py MoinMoin/script/export/dump.py MoinMoin/script/maint/mkpagepacks.py MoinMoin/script/maint/reducewiki.py MoinMoin/search/Xapian.py MoinMoin/search/builtin.py MoinMoin/search/results.py MoinMoin/stats/hitcounts.py MoinMoin/support/HeaderFixed.py MoinMoin/support/cgitb.py MoinMoin/support/htmlmarkup.py MoinMoin/theme/__init__.py MoinMoin/theme/classic.py MoinMoin/user.py MoinMoin/userform.py MoinMoin/util/filesys.py MoinMoin/util/pysupport.py MoinMoin/util/web.py MoinMoin/widget/html.py MoinMoin/wikidicts.py MoinMoin/wikisync.py MoinMoin/wikiutil.py MoinMoin/xmlrpc/UpdateGroup.py contrib/phpwiki_migration/phpwiki2moinmoin.py tests/runtests.py wiki/config/more_samples/ldap_smb_farmconfig.py wiki/data/edit-log
diffstat 93 files changed, 145 insertions(+), 203 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/Page.py	Fri Feb 23 02:16:07 2007 +0100
@@ -9,11 +9,10 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-import StringIO, os, re, codecs, logging
+import os, re, codecs, logging
 
 from MoinMoin import config, caching, user, util, wikiutil
 from MoinMoin.logfile import eventlog
-from MoinMoin.util import filesys, timefuncs
 
 def is_cache_exception(e):
     args = e.args
@@ -240,7 +239,7 @@
         
         @param pagedir: the storage path to the page directory
         """
-        realPath = filesys.realPathCase(pagedir)
+        realPath = util.filesys.realPathCase(pagedir)
         if not realPath is None:
             realPath = wikiutil.unquoteWikiname(realPath)
             self.page_name = realPath[-len(self.page_name):]
@@ -849,7 +848,7 @@
             # to ensure cacheability where supported. Because we are sending
             # RAW (file) content, the file mtime is correct as Last-Modified header.
             request.setHttpHeader("Status: 200 OK")
-            request.setHttpHeader("Last-Modified: %s" % timefuncs.formathttpdate(os.path.getmtime(self._text_filename())))
+            request.setHttpHeader("Last-Modified: %s" % util.timefuncs.formathttpdate(os.path.getmtime(self._text_filename())))
             text = self.get_raw_body()
             text = self.encodeTextMimeType(text)
         else:
@@ -869,7 +868,7 @@
             # to ensure cacheability where supported. Because we are sending
             # RAW (file) content, the file mtime is correct as Last-Modified header.
             request.setHttpHeader("Status: 200 OK")
-            request.setHttpHeader("Last-Modified: %s" % timefuncs.formathttpdate(os.path.getmtime(self._text_filename())))
+            request.setHttpHeader("Last-Modified: %s" % util.timefuncs.formathttpdate(os.path.getmtime(self._text_filename())))
             file_name = "%s.txt" % self.page_name
             text = self.get_raw_body()
             text = self.encodeTextMimeType(text)
@@ -1070,7 +1069,7 @@
                         # if it does, we must not use the page file mtime as last modified value
                         # XXX The following code is commented because it is incorrect for dynamic pages:
                         #lastmod = os.path.getmtime(self._text_filename())
-                        #request.setHttpHeader("Last-Modified: %s" % timefuncs.formathttpdate(lastmod))
+                        #request.setHttpHeader("Last-Modified: %s" % util.timefuncs.formathttpdate(lastmod))
                         pass
                 else:
                     request.setHttpHeader('Status: 404 NOTFOUND')
--- a/MoinMoin/PageEditor.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/PageEditor.py	Fri Feb 23 02:16:07 2007 +0100
@@ -14,8 +14,7 @@
 from MoinMoin.widget import html
 from MoinMoin.widget.dialog import Status
 from MoinMoin.logfile import editlog, eventlog
-from MoinMoin.util import filesys, timefuncs
-import MoinMoin.util.web
+from MoinMoin.util import filesys, timefuncs, web
 from MoinMoin.mail import sendmail
 
 
@@ -420,7 +419,7 @@
         cat_pages.insert(0, ('', _('<No addition>', formatted=False)))
         request.write("<p>")
         request.write(_('Add to: %(category)s') % {
-            'category': unicode(util.web.makeSelection('category', cat_pages)),
+            'category': unicode(web.makeSelection('category', cat_pages)),
         })
 
         if self.cfg.mail_enabled:
@@ -793,13 +792,13 @@
             cache_data = cache.content()
         else:
             cache_data = {}
+        pagename = self.page_name
         if text is None:
             try:
                 del cache_data[pagename]
             except:
                 pass
         else:
-            pagename = self.page_name
             timestamp = int(time.time())
             cache_data[pagename] = (timestamp, rev, text)
         cache.update(cache_data)
--- a/MoinMoin/PageGraphicalEditor.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/PageGraphicalEditor.py	Fri Feb 23 02:16:07 2007 +0100
@@ -5,21 +5,16 @@
     @copyright: (c) Bastian Blank, Florian Festi, Thomas Waldmann
     @license: GNU GPL, see COPYING for details.
 """
+import re
 
 from MoinMoin import PageEditor
-import os, time, codecs, re
-
-from MoinMoin import caching, config, user, util, wikiutil, error
+from MoinMoin import util, wikiutil
 from MoinMoin.Page import Page
 from MoinMoin.widget import html
 from MoinMoin.widget.dialog import Status
-from MoinMoin.logfile import editlog, eventlog
-from MoinMoin.util import filesys
-import MoinMoin.util.web
+from MoinMoin.util import web
 from MoinMoin.parser.text_moin_wiki import Parser
 
-from StringIO import StringIO
-
 def execute(pagename, request):
     if not request.user.may.write(pagename):
         _ = request.getText
@@ -351,7 +346,7 @@
         cat_pages.insert(0, ('', _('<No addition>', formatted=False)))
         request.write("<p>")
         request.write(_('Add to: %(category)s') % {
-            'category': unicode(util.web.makeSelection('category', cat_pages)),
+            'category': unicode(web.makeSelection('category', cat_pages)),
         })
         if self.cfg.mail_enabled:
             request.write('''
--- a/MoinMoin/_tests/_test_template.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/_tests/_test_template.py	Fri Feb 23 02:16:07 2007 +0100
@@ -74,7 +74,7 @@
     def _helper_fuction(self, test):
         """ Some tests needs extra  work to run
 
-        Keep the test non interesting deatils out of the way.
+        Keep the test non interesting details out of the way.
         """
         module_tested.do_this(self.request)
         module_tested.do_that()
--- a/MoinMoin/_tests/broken/test_converter_text_html_text_moin_wiki.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/_tests/broken/test_converter_text_html_text_moin_wiki.py	Fri Feb 23 02:16:07 2007 +0100
@@ -1098,12 +1098,12 @@
         output = ur"""<t><z>test</z></t>"""
         self.do(test, output)
 
-    def test3(self):
+    def test4(self):
         test = ur"""<p>&nbsp;</p>"""
         output = ur""""""
         self.do(test, output)
 
-    def test4(self):
+    def test5(self):
         test = ur"""<p>test </p>"""
         output = ur"""<p>test</p>"""
         self.do(test, output)
--- a/MoinMoin/_tests/test_formatter.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/_tests/test_formatter.py	Fri Feb 23 02:16:07 2007 +0100
@@ -8,7 +8,7 @@
 
 from unittest import TestCase
 import re
-from StringIO import StringIO
+
 from MoinMoin._tests import TestConfig
 from MoinMoin.Page import Page
 from MoinMoin import wikiutil
--- a/MoinMoin/_tests/test_macro.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/_tests/test_macro.py	Fri Feb 23 02:16:07 2007 +0100
@@ -7,9 +7,9 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-import unittest, os
+import unittest
 
-from MoinMoin import macro, wikiutil
+from MoinMoin import macro
 from MoinMoin.parser.text import Parser
 from MoinMoin.formatter.text_html import Formatter
 
--- a/MoinMoin/_tests/test_security.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/_tests/test_security.py	Fri Feb 23 02:16:07 2007 +0100
@@ -8,7 +8,7 @@
 
 import unittest
 from MoinMoin._tests import TestConfig
-from MoinMoin import config, security, _tests
+from MoinMoin import security, _tests
 
 acliter = security.ACLStringIterator
 
@@ -58,6 +58,13 @@
         self.assertEqual(entries, ['UserOne', 'UserTwo'])
         self.assertEqual(rights, ['read', 'write'])
 
+    def testMultipleWikiNameAndRightsSpaces(self):
+        """ security: multiple names with spaces """
+        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'])
+
     def testMultipleEntries(self):
         """ security: multiple entries """
         iter = acliter(self.request.cfg.acl_rights_valid, 'UserOne:read,write UserTwo:read All:')
@@ -78,13 +85,6 @@
         self.assertEqual(entries, ['user one'])
         self.assertEqual(rights, ['read'])
 
-    def testMultipleWikiNameAndRights(self):
-        """ security: multiple names with spaces """
-        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'])
-
     def testMultipleEntriesWithSpaces(self):
         """ security: multiple entries with spaces """
         iter = acliter(self.request.cfg.acl_rights_valid, 'user one:read,write user two:read')
--- a/MoinMoin/_tests/test_user.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/_tests/test_user.py	Fri Feb 23 02:16:07 2007 +0100
@@ -8,11 +8,10 @@
 
 import unittest, os, dircache
 
-from MoinMoin._tests import TestConfig, TestSkiped
+from MoinMoin._tests import TestConfig, TestSkipped
 from MoinMoin import user, caching
 
 
-
 class EncodePasswordTestCase(unittest.TestCase):
     """user: encode passwords tests"""
 
@@ -162,7 +161,7 @@
         # 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"
+            raise TestSkipped("Test user exists, will not override existing"
                               " user data file!")
 
         # Save test user
@@ -171,7 +170,7 @@
         # Validate user creation
         if not self.user.exists():
             self.user = None
-            raise TestsSkiped("Can't create test user")
+            raise TestSkipped("Can't create test user")
 
 
 class GroupNameTestCase(unittest.TestCase):
--- a/MoinMoin/_tests/test_wikisync.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/_tests/test_wikisync.py	Fri Feb 23 02:16:07 2007 +0100
@@ -7,7 +7,7 @@
 """
 
 from unittest import TestCase
-from MoinMoin.Page import Page
+
 from MoinMoin.PageEditor import PageEditor
 from MoinMoin._tests import TestConfig, TestSkipped
 
--- a/MoinMoin/action/AttachFile.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/action/AttachFile.py	Fri Feb 23 02:16:07 2007 +0100
@@ -28,7 +28,7 @@
 """
 
 import os, time, zipfile
-from MoinMoin import config, user, util, wikiutil, packages
+from MoinMoin import config, wikiutil, packages
 from MoinMoin.Page import Page
 from MoinMoin.util import filesys, timefuncs
 
@@ -163,7 +163,7 @@
         }
     return "\n<p>\n%s\n</p>\n" % attach_info
 
-def add_attachment(request, pagename, target, filecontent):
+def add_attachment(request, pagename, target, filecontent, overwrite=0):
     # replace illegal chars
     target = wikiutil.taintfilename(target)
 
@@ -187,8 +187,7 @@
     fpath = os.path.join(attach_dir, target).encode(config.charset)
     exists = os.path.exists(fpath)
     if exists and not overwrite:
-        msg = _("Attachment '%(target)s' (remote name '%(filename)s') already exists.") % {
-            'target': target, 'filename': filename}
+        msg = _("Attachment '%(target)s' already exists.") % { 'target': target, }
     else:
         if exists:
             try:
@@ -259,6 +258,7 @@
 
 
 def _build_filelist(request, pagename, showheader, readonly, mime_type='*'):
+    import mimetypes
     _ = request.getText
 
     # access directory
@@ -642,7 +642,7 @@
 
     # add the attachment
     try:
-        add_attachment(request, pagename, target, filecontent)
+        add_attachment(request, pagename, target, filecontent, overwrite=overwrite)
 
         bytes = len(filecontent)
         msg = _("Attachment '%(target)s' (remote name '%(filename)s')"
@@ -937,7 +937,7 @@
                             "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)
+            msg = _('The file %(filename)s is not a .zip file.' % {'filename': filename})
 
     upload_form(pagename, request, msg=wikiutil.escape(msg))
 
@@ -972,7 +972,6 @@
         request.write("<pre><b>%s</b>\n%s</pre>" % (_("Package script:"), wikiutil.escape(package.getScript())))
         return
 
-    import zipfile
     if zipfile.is_zipfile(fpath):
         zf = zipfile.ZipFile(fpath, mode='r')
         request.write("<pre>%-46s %19s %12s\n" % (_("File Name"), _("Modified")+" "*5, _("Size")))
--- a/MoinMoin/action/LikePages.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/action/LikePages.py	Fri Feb 23 02:16:07 2007 +0100
@@ -13,8 +13,8 @@
 
 import re
 
+from MoinMoin import config, wikiutil
 from MoinMoin.support import difflib
-from MoinMoin import config, wikiutil
 from MoinMoin.Page import Page
 
 
--- a/MoinMoin/action/MyPages.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/action/MyPages.py	Fri Feb 23 02:16:07 2007 +0100
@@ -56,7 +56,6 @@
 
     pagecontent = pagecontent.replace('\n', '\r\n')
 
-    from MoinMoin.Page import Page
     from MoinMoin.parser.text_moin_wiki import Parser as WikiParser
     request.emit_http_headers()
 
--- a/MoinMoin/action/PackagePages.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/action/PackagePages.py	Fri Feb 23 02:16:07 2007 +0100
@@ -15,7 +15,6 @@
 from datetime import datetime
 
 from MoinMoin import wikiutil, config, user
-from MoinMoin.PageEditor import PageEditor
 from MoinMoin.Page import Page
 from MoinMoin.action.AttachFile import _addLogEntry
 from MoinMoin.packages import MOIN_PACKAGE_FILE, packLine, unpackLine
--- a/MoinMoin/action/RenamePage.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/action/RenamePage.py	Fri Feb 23 02:16:07 2007 +0100
@@ -9,7 +9,6 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-import os
 from MoinMoin import wikiutil
 from MoinMoin.Page import Page
 from MoinMoin.PageEditor import PageEditor
--- a/MoinMoin/action/SubscribeUser.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/action/SubscribeUser.py	Fri Feb 23 02:16:07 2007 +0100
@@ -11,7 +11,6 @@
 import sys, os
 #sys.path.append("YOUR CONFIG DIRECTORY HERE")
 
-from MoinMoin import wikiutil
 from MoinMoin.Page import Page
 from MoinMoin import user
 
--- a/MoinMoin/action/SyncPages.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/action/SyncPages.py	Fri Feb 23 02:16:07 2007 +0100
@@ -8,13 +8,11 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-import os
 import re
 import xmlrpclib
 import traceback
 import StringIO # not relevant for speed, so we do not need cStringIO
 
-
 # Compatiblity to Python 2.3
 try:
     set
@@ -22,7 +20,7 @@
     from sets import Set as set
 
 
-from MoinMoin import wikiutil, config, user
+from MoinMoin import wikiutil
 from MoinMoin.packages import unpackLine, packLine
 from MoinMoin.PageEditor import PageEditor, conflict_markers
 from MoinMoin.Page import Page
--- a/MoinMoin/action/backup.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/action/backup.py	Fri Feb 23 02:16:07 2007 +0100
@@ -11,7 +11,7 @@
 """
 
 import os, re, time, tarfile
-import cStringIO
+
 from MoinMoin import wikiutil
 
 def addFiles(path, tar, exclude):
--- a/MoinMoin/action/bookmark.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/action/bookmark.py	Fri Feb 23 02:16:07 2007 +0100
@@ -9,7 +9,7 @@
 import time
 
 from MoinMoin import wikiutil
-from MoinMoin.Page import Page
+
 
 def execute(pagename, request):
     """ set bookmarks (in time) for RecentChanges or delete them """
@@ -30,4 +30,3 @@
     else:
         request.user.setBookmark(tm)
     request.page.send_page()
-
--- a/MoinMoin/action/fckdialog.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/action/fckdialog.py	Fri Feb 23 02:16:07 2007 +0100
@@ -528,7 +528,7 @@
     if dialog == "macro":
         macro_dialog(request)
     elif dialog == "macrolist":
-        macrolist(request)
+        macro_list(request)
     elif dialog == "pagelist":
         page_list(request)
     elif dialog == "link":
--- a/MoinMoin/action/login.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/action/login.py	Fri Feb 23 02:16:07 2007 +0100
@@ -10,7 +10,7 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-from MoinMoin import user, wikiutil, userform
+from MoinMoin import user, userform
 from MoinMoin.Page import Page
 
 def execute(pagename, request):
--- a/MoinMoin/action/rss_rc.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/action/rss_rc.py	Fri Feb 23 02:16:07 2007 +0100
@@ -7,7 +7,7 @@
 
     @license: GNU GPL, see COPYING for details.
 """
-import StringIO, re, os, time
+import StringIO, re, time
 from MoinMoin import wikixml, config, wikiutil
 from MoinMoin.logfile import editlog
 from MoinMoin.util import timefuncs
--- a/MoinMoin/action/titleindex.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/action/titleindex.py	Fri Feb 23 02:16:07 2007 +0100
@@ -10,7 +10,7 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-from MoinMoin import config, util, wikiutil
+from MoinMoin import config, util
 
 
 def execute(pagename, request):
--- a/MoinMoin/caching.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/caching.py	Fri Feb 23 02:16:07 2007 +0100
@@ -19,7 +19,6 @@
 # Set pickle protocol, see http://docs.python.org/lib/node64.html
 PICKLE_PROTOCOL = pickle.HIGHEST_PROTOCOL
 
-from MoinMoin import config
 from MoinMoin.util import filesys, lock
 
 
--- a/MoinMoin/config/multiconfig.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/config/multiconfig.py	Fri Feb 23 02:16:07 2007 +0100
@@ -779,7 +779,7 @@
         Since each wiki has unique plugins, we load the plugin package
         under the wiki configuration module, named self.siteid.
         """
-        import sys, imp
+        import imp
 
         name = self.siteid + '.plugin'
         try:
--- a/MoinMoin/filter/EXIF.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/filter/EXIF.py	Fri Feb 23 02:16:07 2007 +0100
@@ -1133,7 +1133,7 @@
                     print ' EXIF Interoperability SubSubIFD at offset %d:' \
                           % intr_off.values[0]
                 hdr.dump_IFD(intr_off.values[0], 'EXIF Interoperability',
-                             dict=INTR_TAGSi, name=name)
+                             dict=INTR_TAGS, name=name)
         # GPS IFD
         gps_off = hdr.tags.get(IFD_name+' GPSInfo')
         if gps_off:
--- a/MoinMoin/filter/text_html.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/filter/text_html.py	Fri Feb 23 02:16:07 2007 +0100
@@ -6,7 +6,6 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-import re
 from MoinMoin.filter.text_xml import execute as xmlfilter
 
 def execute(indexobj, filename):
--- a/MoinMoin/formatter/dom_xml.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/formatter/dom_xml.py	Fri Feb 23 02:16:07 2007 +0100
@@ -9,6 +9,7 @@
 line_anchors = True
 
 from xml.dom import minidom
+from MoinMoin import wikiutil
 from MoinMoin.formatter import FormatterBase
 
 #def print_dom(element, indent=''):
--- a/MoinMoin/formatter/text_docbook.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/formatter/text_docbook.py	Fri Feb 23 02:16:07 2007 +0100
@@ -9,10 +9,10 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-import sys, traceback, os
+import os
 
 from MoinMoin.formatter import FormatterBase
-from MoinMoin import wikiutil, config
+from MoinMoin import wikiutil
 from MoinMoin.error import CompositeError
 from MoinMoin.action import AttachFile
 
@@ -428,6 +428,7 @@
         drawing = fname
         fname = fname + ".png"
         filename = filename + ".png"
+        fpath = AttachFile.getFilename(self.request, pagename, fname)
         if not os.path.exists(fpath):
             return self.text("[drawing:%s]" % url)
         else:
--- a/MoinMoin/formatter/text_gedit.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/formatter/text_gedit.py	Fri Feb 23 02:16:07 2007 +0100
@@ -7,7 +7,7 @@
 """
 
 from MoinMoin.formatter import FormatterBase, text_html
-from MoinMoin import wikiutil, config
+from MoinMoin import wikiutil
 from MoinMoin.Page import Page
 from MoinMoin.action import AttachFile
 
--- a/MoinMoin/formatter/text_html.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/formatter/text_html.py	Fri Feb 23 02:16:07 2007 +0100
@@ -13,7 +13,7 @@
     from sets import Set as set
 
 from MoinMoin.formatter import FormatterBase
-from MoinMoin import wikiutil, i18n, config
+from MoinMoin import wikiutil, i18n
 from MoinMoin.Page import Page
 from MoinMoin.action import AttachFile
 
--- a/MoinMoin/formatter/text_xml.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/formatter/text_xml.py	Fri Feb 23 02:16:07 2007 +0100
@@ -212,10 +212,3 @@
 
     def code_token(self, on, tok_type):
         return ('<codetoken type="%s">' % tok_type, '</codetoken')[not on]
-
-    def code_line(self, on):
-        return ('<codeline>', '</codeline')[not on]
-
-    def code_token(self, on, tok_type):
-        return ('<codetoken type="%s">' % tok_type, '</codetoken')[not on]
-
--- a/MoinMoin/i18n/__init__.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/i18n/__init__.py	Fri Feb 23 02:16:07 2007 +0100
@@ -174,7 +174,7 @@
                 uc_texts, uc_unformatted = cache.content()
             except caching.CacheError:
                 if debug:
-                    request.log("i18n: pickle %s load failed" % lang)
+                    request.log("i18n: pickle %s load failed" % self.language)
                 needsupdate = 1
 
         if needsupdate:
@@ -186,7 +186,7 @@
             has_wikimarkup = self.info.get('x-haswikimarkup', 'False') == 'True'
             # convert to unicode
             if debug:
-                request.log("i18n: processing unformatted texts of lang %s" % lang)
+                request.log("i18n: processing unformatted texts of lang %s" % self.language)
             uc_unformatted = {}
             uc_texts = {}
             for ukey, utext in texts.items():
@@ -197,10 +197,10 @@
                         uc_texts[ukey] = self.formatMarkup(request, utext) # XXX RECURSION!!! Calls gettext via markup
                     except: # infinite recursion or crash
                         if debug:
-                            request.log("i18n: crashes in language %s on string: %s" % (lang, text))
+                            request.log("i18n: crashes in language %s on string: %s" % (self.language, utext))
                         uc_texts[ukey] = u"%s*" % utext
             if debug:
-                request.log("i18n: dumping lang %s" % lang)
+                request.log("i18n: dumping lang %s" % self.language)
             try:
                 cache.update((uc_texts, uc_unformatted))
             except caching.CacheError:
--- a/MoinMoin/i18n/msgfmt.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/i18n/msgfmt.py	Fri Feb 23 02:16:07 2007 +0100
@@ -97,7 +97,7 @@
             elif section == STR:
                 msgstr += line
             else:
-                raise SyntaxErrorException('Syntax error on %s:%d, before:\n%s' % (infile, line_no, line))
+                raise SyntaxErrorException('Syntax error on line %d, before:\n%s' % (line_no, line))
         # Add last entry
         if section == STR:
             self.add(msgid, msgstr, fuzzy)
--- a/MoinMoin/logfile/editlog.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/logfile/editlog.py	Fri Feb 23 02:16:07 2007 +0100
@@ -4,7 +4,8 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-import os.path, logging
+import logging
+
 from MoinMoin.logfile import LogFile
 from MoinMoin import wikiutil, user, config
 from MoinMoin.Page import Page
--- a/MoinMoin/logfile/eventlog.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/logfile/eventlog.py	Fri Feb 23 02:16:07 2007 +0100
@@ -4,10 +4,10 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-import os.path, time
+import time
+
 from MoinMoin.logfile import LogFile
-from MoinMoin import util, config, wikiutil
-from MoinMoin.util import web
+from MoinMoin import wikiutil
 
 class EventLog(LogFile):
 
--- a/MoinMoin/macro/Action.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/macro/Action.py	Fri Feb 23 02:16:07 2007 +0100
@@ -17,7 +17,6 @@
 """
 
 from MoinMoin import wikiutil
-from MoinMoin.Page import Page
 
 Dependencies = ["language"]
 
--- a/MoinMoin/macro/AdvancedSearch.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/macro/AdvancedSearch.py	Fri Feb 23 02:16:07 2007 +0100
@@ -6,7 +6,7 @@
         displays advanced search dialog.
 """
 
-from MoinMoin import config, wikiutil, search
+from MoinMoin import search
 from MoinMoin.i18n import languages
 from MoinMoin.support import sorted
 from MoinMoin.widget import html
--- a/MoinMoin/macro/EditTemplates.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/macro/EditTemplates.py	Fri Feb 23 02:16:07 2007 +0100
@@ -6,10 +6,7 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-import re
-
 Dependencies = ["language"]
-from MoinMoin import wikiutil
 
 def execute(self, args):
     result = ''
--- a/MoinMoin/macro/EmbedObject.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/macro/EmbedObject.py	Fri Feb 23 02:16:07 2007 +0100
@@ -149,7 +149,7 @@
 
         if not argc:
            msg = 'Not enough arguments to EmbedObject macro! Try [[EmbedObject(attachment [,width=width] [,height=heigt])]]'
-           return "%s%s%s" % (formatter.sysmsg(1), formatter.text(msg), formatter.sysmsg(0))
+           return "%s%s%s" % (self.formatter.sysmsg(1), self.formatter.text(msg), self.formatter.sysmsg(0))
         else:
             self.target = args[0]
 
--- a/MoinMoin/macro/FullSearch.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/macro/FullSearch.py	Fri Feb 23 02:16:07 2007 +0100
@@ -28,8 +28,7 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-import re
-from MoinMoin import config, wikiutil, search
+from MoinMoin import wikiutil, search
 
 Dependencies = ["pages"]
 
--- a/MoinMoin/macro/ImageLink.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/macro/ImageLink.py	Fri Feb 23 02:16:07 2007 +0100
@@ -93,7 +93,7 @@
 """
 
 import os
-from MoinMoin import wikiutil, config
+from MoinMoin import wikiutil
 from MoinMoin.action import AttachFile
 
 kwAllowed = ['width', 'height', 'alt']
--- a/MoinMoin/macro/Include.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/macro/Include.py	Fri Feb 23 02:16:07 2007 +0100
@@ -19,7 +19,6 @@
 import re, StringIO
 from MoinMoin import wikiutil
 from MoinMoin.Page import Page
-from MoinMoin.util import web
 
 _sysmsg = '<p><strong class="%s">%s</strong></p>'
 
--- a/MoinMoin/macro/Navigation.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/macro/Navigation.py	Fri Feb 23 02:16:07 2007 +0100
@@ -7,7 +7,6 @@
 """
 
 import re
-from MoinMoin import config
 from MoinMoin.Page import Page
 
 Dependencies = ["namespace"]
--- a/MoinMoin/macro/PageHits.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/macro/PageHits.py	Fri Feb 23 02:16:07 2007 +0100
@@ -7,7 +7,7 @@
 
 """
 
-from MoinMoin import caching, config, logfile
+from MoinMoin import caching, logfile
 from MoinMoin.Page import Page
 from MoinMoin.logfile import eventlog
 
--- a/MoinMoin/macro/RandomQuote.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/macro/RandomQuote.py	Fri Feb 23 02:16:07 2007 +0100
@@ -19,7 +19,8 @@
     Gustavo Niemeyer added wiki markup parsing of the quotes.
 """
 
-import random, StringIO
+import random
+
 from MoinMoin.Page import Page, wikiutil
 
 Dependencies = ["time"]
--- a/MoinMoin/macro/RecentChanges.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/macro/RecentChanges.py	Fri Feb 23 02:16:07 2007 +0100
@@ -7,9 +7,9 @@
     @copyright: 2000-2004 by Jürgen Hermann <jh@web.de>
     @license: GNU GPL, see COPYING for details.
 """
+import time
 
-import re, time
-from MoinMoin import util, wikiutil, config
+from MoinMoin import util, wikiutil
 from MoinMoin.Page import Page
 from MoinMoin.logfile import editlog
 
--- a/MoinMoin/macro/SystemAdmin.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/macro/SystemAdmin.py	Fri Feb 23 02:16:07 2007 +0100
@@ -8,8 +8,6 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-from MoinMoin import wikiutil
-from MoinMoin.util import pysupport
 from MoinMoin.userform import do_user_browser
 from MoinMoin.action.AttachFile import do_admin_browser
 
--- a/MoinMoin/macro/WantedPages.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/macro/WantedPages.py	Fri Feb 23 02:16:07 2007 +0100
@@ -6,7 +6,7 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-from MoinMoin import config, wikiutil
+from MoinMoin import wikiutil
 
 Dependencies = ["pages"]
 
--- a/MoinMoin/macro/__init__.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/macro/__init__.py	Fri Feb 23 02:16:07 2007 +0100
@@ -23,7 +23,6 @@
 from MoinMoin import action, config, util
 from MoinMoin import wikiutil, i18n
 from MoinMoin.Page import Page
-from MoinMoin.util import pysupport
 
 names = ["TitleSearch", "WordIndex", "TitleIndex",
          "GoTo", "InterWiki", "PageCount", "UserPreferences",
--- a/MoinMoin/mail/mailimport.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/mail/mailimport.py	Fri Feb 23 02:16:07 2007 +0100
@@ -9,11 +9,11 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-import os, sys, re, time
+import sys, re, time
 import email
-from email.Utils import getaddresses, parseaddr, parsedate_tz, mktime_tz
+from email.Utils import getaddresses, parsedate_tz, mktime_tz
 
-from MoinMoin import user, wikiutil, config
+from MoinMoin import user, wikiutil
 from MoinMoin.action.AttachFile import add_attachment, AttachmentAlreadyExists
 from MoinMoin.Page import Page
 from MoinMoin.PageEditor import PageEditor
--- a/MoinMoin/packages.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/packages.py	Fri Feb 23 02:16:07 2007 +0100
@@ -6,14 +6,12 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-import os, codecs
-import sys
+import os, sys
 import zipfile
 
 from MoinMoin import config, wikiutil, caching, user
 from MoinMoin.Page import Page
 from MoinMoin.PageEditor import PageEditor
-from MoinMoin.util import filesys
 from MoinMoin.logfile import editlog, eventlog
 
 MOIN_PACKAGE_FILE = 'MOIN_PACKAGE'
@@ -469,7 +467,7 @@
 
     def isPackage(self):
         """ Returns true if this package is recognised. """
-        raise NotImplementedException
+        raise NotImplementedError
 
 class ZipPackage(Package, ScriptEngine):
     """ A package that reads its files from a .zip file. """
--- a/MoinMoin/parser/_ParserBase.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/parser/_ParserBase.py	Fri Feb 23 02:16:07 2007 +0100
@@ -22,7 +22,7 @@
 
 """
 
-import re, sys, sha
+import re, sha
 from MoinMoin import config, wikiutil
 
 def parse_start_step(request, args):
--- a/MoinMoin/parser/text_docbook.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/parser/text_docbook.py	Fri Feb 23 02:16:07 2007 +0100
@@ -30,12 +30,11 @@
     http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/domlettes
 """
 
-import StringIO
 import os.path
 import cPickle
 import re
 
-from MoinMoin import caching, config, wikiutil, Page
+from MoinMoin import  Page
 from MoinMoin.parser.text_xslt import Parser as XsltParser
 from MoinMoin.parser.text_moin_wiki import Parser as WikiParser
 
--- a/MoinMoin/parser/text_irssi.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/parser/text_irssi.py	Fri Feb 23 02:16:07 2007 +0100
@@ -8,7 +8,6 @@
 """
 
 import re
-from MoinMoin import wikiutil
 
 Dependencies = []
 
--- a/MoinMoin/parser/text_xslt.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/parser/text_xslt.py	Fri Feb 23 02:16:07 2007 +0100
@@ -17,7 +17,6 @@
 
 # cStringIO cannot be used because it doesn't handle Unicode.
 import StringIO
-import re
 
 from MoinMoin import caching, config, wikiutil, Page
 
--- a/MoinMoin/request/CGI.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/request/CGI.py	Fri Feb 23 02:16:07 2007 +0100
@@ -9,7 +9,6 @@
 """
 import sys, os, cgi
 
-from MoinMoin import config
 from MoinMoin.request import RequestBase
 
 class Request(RequestBase):
--- a/MoinMoin/request/CLI.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/request/CLI.py	Fri Feb 23 02:16:07 2007 +0100
@@ -6,7 +6,7 @@
                 2003-2006 MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
 """
-import sys, os
+import sys
 
 from MoinMoin.request import RequestBase
 
--- a/MoinMoin/request/FCGI.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/request/FCGI.py	Fri Feb 23 02:16:07 2007 +0100
@@ -7,8 +7,6 @@
                 2003-2006 MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
 """
-import sys, os
-from MoinMoin import config
 from MoinMoin.request import RequestBase
 
 class Request(RequestBase):
--- a/MoinMoin/request/MODPYTHON.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/request/MODPYTHON.py	Fri Feb 23 02:16:07 2007 +0100
@@ -6,9 +6,7 @@
                 2003-2006 MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
 """
-import sys, os
-
-from MoinMoin import config
+from MoinMoin import wikiutil
 from MoinMoin.request import RequestBase
 
 class Request(RequestBase):
@@ -145,6 +143,8 @@
         self.mpyreq.status = int(status.split(' ', 1)[0])
         self.mpyreq.content_type = ct_header.split(':', 1)[1].lstrip()
         for header in other_headers:
+            key, value = header.split(':', 1)
+            value = value.lstrip()
             self.mpyreq.headers_out[key] = value
         # this is for mod_python 2.7.X, for 3.X it's a NOP
         self.mpyreq.send_http_header()
--- a/MoinMoin/request/STANDALONE.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/request/STANDALONE.py	Fri Feb 23 02:16:07 2007 +0100
@@ -6,9 +6,8 @@
                 2003-2006 MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
 """
-import sys, os, cgi
+import cgi
 
-from MoinMoin import config
 from MoinMoin.request import RequestBase
 
 class Request(RequestBase):
--- a/MoinMoin/request/TWISTED.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/request/TWISTED.py	Fri Feb 23 02:16:07 2007 +0100
@@ -6,9 +6,7 @@
                 2003-2006 MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
 """
-import sys, os
 
-from MoinMoin import config
 from MoinMoin.request import RequestBase, MoinMoinFinish
 
 class Request(RequestBase):
--- a/MoinMoin/request/WSGI.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/request/WSGI.py	Fri Feb 23 02:16:07 2007 +0100
@@ -6,9 +6,8 @@
                 2003-2006 MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
 """
-import sys, os, cgi
+import cgi, StringIO
 
-from MoinMoin import config
 from MoinMoin.request import RequestBase
 
 class Request(RequestBase):
--- a/MoinMoin/script/__init__.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/script/__init__.py	Fri Feb 23 02:16:07 2007 +0100
@@ -8,10 +8,10 @@
 """
 
 import os, sys, time
+from StringIO import StringIO
 
 flag_quiet = 0
 
-
 # ScriptRequest -----------------------------------------------------------
 
 class ScriptRequest(object):
@@ -26,7 +26,7 @@
     """
     def __init__(self, instream, outstream, errstream):
         self.instream = instream
-        self.outstream = outstrem
+        self.outstream = outstream
         self.errstream = errstream
 
     def read(self, n=None):
@@ -54,10 +54,10 @@
         return self.request.read(n)
 
     def write(self, data):
-        return self.request.write(n)
+        return self.request.write(data)
 
     def write_err(self, data):
-        return self.request.write(n) # XXX use correct request method - log, error, whatever.
+        return self.request.write(data) # XXX use correct request method - log, error, whatever.
 
 class ScriptRequestStrings(ScriptRequest):
     """ When a script gets run by our xmlrpc server, we have the input as a
--- a/MoinMoin/script/account/check.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/script/account/check.py	Fri Feb 23 02:16:07 2007 +0100
@@ -64,7 +64,7 @@
 
 # ----------------------------------------------------------------------------
 
-import os
+import os, sys
 
 from MoinMoin.script import MoinScript
 from MoinMoin import user, wikiutil
@@ -206,7 +206,7 @@
         for uid, u in self.users.items():
             # user.User already clears the old cleartext passwords on loading,
             # so nothing to do here!
-            if save:
+            if self.options.save:
                 # we can't encrypt the cleartext password as it is cleared
                 # already. and we would not trust it anyway, so we don't WANT
                 # to do that either!
@@ -215,8 +215,6 @@
                 u.save()
 
     def mainloop(self):
-        import os, sys
-
         # we don't expect non-option arguments
         if len(self.args) != 0:
             self.parser.error("incorrect number of arguments")
--- a/MoinMoin/script/account/create.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/script/account/create.py	Fri Feb 23 02:16:07 2007 +0100
@@ -42,7 +42,7 @@
         self.init_request()
         request = self.request
 
-        from MoinMoin import user, wikiutil
+        from MoinMoin import user
         u = user.User(request, None, self.options.uname, password=self.options.password)
         u.email = self.options.email
         u.aliasname = self.options.ualiasname or ''
--- a/MoinMoin/script/account/disable.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/script/account/disable.py	Fri Feb 23 02:16:07 2007 +0100
@@ -34,7 +34,7 @@
         self.init_request()
         request = self.request
 
-        from MoinMoin import user, wikiutil
+        from MoinMoin import user
         if self.options.uid:
             u = user.User(request, self.options.uid)
         elif self.options.uname:
--- a/MoinMoin/script/export/dump.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/script/export/dump.py	Fri Feb 23 02:16:07 2007 +0100
@@ -11,7 +11,7 @@
 
 """
 
-import sys, os, time, StringIO, codecs, shutil, re, errno
+import sys, os, time, codecs, shutil, re, errno
 
 from MoinMoin import config, wikiutil, Page
 from MoinMoin import script
@@ -90,7 +90,7 @@
 
         # Prepare output directory
         if not self.options.target_dir:
-            _util.fatal("you must use --target-dir=/your/output/path to specify the directory we write the html files to")
+            script.fatal("you must use --target-dir=/your/output/path to specify the directory we write the html files to")
         outputdir = os.path.abspath(self.options.target_dir)
         try:
             os.mkdir(outputdir)
--- a/MoinMoin/script/maint/mkpagepacks.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/script/maint/mkpagepacks.py	Fri Feb 23 02:16:07 2007 +0100
@@ -14,8 +14,7 @@
 
 from MoinMoin import wikidicts, wikiutil
 from MoinMoin.Page import Page
-from MoinMoin.PageEditor import PageEditor
-from MoinMoin.packages import packLine, unpackLine, MOIN_PACKAGE_FILE
+from MoinMoin.packages import packLine, MOIN_PACKAGE_FILE
 from MoinMoin.script import MoinScript
 
 EXTRA = u'extra'
--- a/MoinMoin/script/maint/reducewiki.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/script/maint/reducewiki.py	Fri Feb 23 02:16:07 2007 +0100
@@ -24,7 +24,7 @@
     @license: GPL, see COPYING for details
 """
 
-import os, sys, shutil, codecs
+import os, shutil, codecs
 
 from MoinMoin import config, wikiutil
 from MoinMoin.Page import Page
--- a/MoinMoin/search/Xapian.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/search/Xapian.py	Fri Feb 23 02:16:07 2007 +0100
@@ -8,7 +8,7 @@
 """
 debug = True
 
-import sys, os, re, codecs, time, os
+import os, re
 from pprint import pprint
 
 import xapian
--- a/MoinMoin/search/builtin.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/search/builtin.py	Fri Feb 23 02:16:07 2007 +0100
@@ -10,10 +10,10 @@
     @license: GNU GPL, see COPYING for details
 """
 
-import time, sys, os, errno, codecs
+import time, os, errno, codecs
 from MoinMoin import wikiutil, config
 from MoinMoin.Page import Page
-from MoinMoin.util import filesys, lock
+from MoinMoin.util import lock
 from MoinMoin.search.results import getSearchResults
 from MoinMoin.search.queryparser import Match, TextMatch, TitleMatch
 
@@ -402,7 +402,7 @@
         from MoinMoin.security import Permissions
         request = Request(request.url)
         class SecurityPolicy(Permissions):
-            def read(*args, **kw):
+            def read(self, *args, **kw):
                 return True
         request.user.may = SecurityPolicy(request.user)
         return request
@@ -597,7 +597,6 @@
         @keyword pages: optional list of pages to search in
         """
         self.request.clock.start('_moinSearch')
-        from MoinMoin.Page import Page
         if pages is None:
             # if we are not called from _xapianSearch, we make a full pagelist,
             # but don't search attachments (thus attachment name = '')
--- a/MoinMoin/search/results.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/search/results.py	Fri Feb 23 02:16:07 2007 +0100
@@ -10,8 +10,9 @@
     @license: GNU GPL, see COPYING for details
 """
 
-import StringIO, time, re
-from MoinMoin import config, wikiutil
+import StringIO, time
+
+from MoinMoin import wikiutil
 from MoinMoin.Page import Page
 
 ############################################################################
@@ -141,9 +142,9 @@
 
         # Filter by type and sort by sort using fast schwartzian transform.
         if sort == 'start':
-            tmp = [(match.start, match) for match in matches if instance(match, type)]
+            tmp = [(match.start, match) for match in matches if isinstance(match, type)]
         else:
-            tmp = [(match.weight(), match) for match in matches if instance(match, type)]
+            tmp = [(match.weight(), match) for match in matches if isinstance(match, type)]
         tmp.sort()
         if sort == 'weight':
             tmp.reverse()
--- a/MoinMoin/stats/hitcounts.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/stats/hitcounts.py	Fri Feb 23 02:16:07 2007 +0100
@@ -14,7 +14,7 @@
 
 _debug = 0
 
-from MoinMoin import caching, config, wikiutil, logfile
+from MoinMoin import caching, wikiutil, logfile
 from MoinMoin.Page import Page
 from MoinMoin.logfile import eventlog
 
--- a/MoinMoin/support/HeaderFixed.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/support/HeaderFixed.py	Fri Feb 23 02:16:07 2007 +0100
@@ -4,7 +4,7 @@
 # Author: Ben Gertzfield, Barry Warsaw
 # Contact: email-sig@python.org
 
-import sys
+import sys, binascii
 
 from email.Header import ecre
 
@@ -13,6 +13,8 @@
 from email.Errors import HeaderParseError
 from email.Charset import Charset
 
+SPACE = ' '
+
 if sys.version_info[:3] < (2, 9, 0): # insert the version number
                                      # of a fixed python here
 
--- a/MoinMoin/support/cgitb.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/support/cgitb.py	Fri Feb 23 02:16:07 2007 +0100
@@ -163,7 +163,7 @@
     def orderedList(self, items, attributes=None):
         if isinstance(items, (list, tuple)):
             result = []
-            for i in rage(items):
+            for i in range(items):
                 result.append(' %d. %s\n' % (i, items[i]))
             return ''.join(result) + '\n'
         return items
--- a/MoinMoin/support/htmlmarkup.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/support/htmlmarkup.py	Fri Feb 23 02:16:07 2007 +0100
@@ -21,7 +21,6 @@
 except NameError:
     from sets import ImmutableSet as frozenset
 from StringIO import StringIO
-import sys
 
 __all__ = ['escape', 'unescape', 'html']
 
--- a/MoinMoin/theme/__init__.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/theme/__init__.py	Fri Feb 23 02:16:07 2007 +0100
@@ -335,8 +335,6 @@
             title = self.shortenPagename(title)
             link = page.link_to(request, title)
 
-
-        from MoinMoin import config
         for scheme in self.linkSchemas:
             if pagename.startswith(scheme):
                 title = wikiutil.escape(title)
@@ -1481,9 +1479,9 @@
         meta_keywords = request.getPragma('keywords')
         meta_desc = request.getPragma('description')
         if meta_keywords:
-            user_head.append('<meta name="keywords" content="%s">\n' % escape(meta_keywords, 1))
+            user_head.append('<meta name="keywords" content="%s">\n' % wikiutil.escape(meta_keywords, 1))
         if meta_desc:
-            user_head.append('<meta name="description" content="%s">\n' % escape(meta_desc, 1))
+            user_head.append('<meta name="description" content="%s">\n' % wikiutil.escape(meta_desc, 1))
 
         # search engine precautions / optimization:
         # if it is an action or edit/search, send query headers (noindex,nofollow):
--- a/MoinMoin/theme/classic.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/theme/classic.py	Fri Feb 23 02:16:07 2007 +0100
@@ -12,7 +12,6 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-from MoinMoin import wikiutil, version
 from MoinMoin import caching
 from MoinMoin.theme import ThemeBase
 from MoinMoin.Page import Page
--- a/MoinMoin/user.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/user.py	Fri Feb 23 02:16:07 2007 +0100
@@ -12,7 +12,7 @@
 import os, time, sha, codecs
 
 from MoinMoin import config, caching, wikiutil, i18n
-from MoinMoin.util import filesys, timefuncs
+from MoinMoin.util import timefuncs
 
 
 def getUserList(request):
--- a/MoinMoin/userform.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/userform.py	Fri Feb 23 02:16:07 2007 +0100
@@ -8,7 +8,6 @@
 
 import time, re
 from MoinMoin import user, util, wikiutil
-from MoinMoin.util import web, timefuncs
 from MoinMoin.widget import html
 
 _debug = 0
@@ -357,7 +356,7 @@
             options.append((
                 str(offset),
                 '%s [%s%s:%s]' % (
-                    time.strftime(self.cfg.datetime_fmt, timefuncs.tmtuple(t)),
+                    time.strftime(self.cfg.datetime_fmt, util.timefuncs.tmtuple(t)),
                     "+-"[offset < 0],
                     "%02d" % (abs(offset) / 3600),
                     "%02d" % (abs(offset) % 3600 / 60),
@@ -515,7 +514,7 @@
                     self._tz_select(),
                     html.BR(),
                     _('Server time is'), ' ',
-                    time.strftime(self.cfg.datetime_fmt, timefuncs.tmtuple()),
+                    time.strftime(self.cfg.datetime_fmt, util.timefuncs.tmtuple()),
                     ' (UTC)',
                 ])
 
--- a/MoinMoin/util/filesys.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/util/filesys.py	Fri Feb 23 02:16:07 2007 +0100
@@ -6,9 +6,8 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-import sys, os, shutil, errno
+import sys, os, shutil
 from stat import S_ISDIR, ST_MODE, S_IMODE
-from MoinMoin import config
 
 #############################################################################
 ### Misc Helpers
--- a/MoinMoin/util/pysupport.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/util/pysupport.py	Fri Feb 23 02:16:07 2007 +0100
@@ -10,9 +10,6 @@
 ### Module import / Plugins
 #############################################################################
 
-import sys
-
-
 def isImportable(module):
     """ Check whether a certain module is available.
     """
--- a/MoinMoin/util/web.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/util/web.py	Fri Feb 23 02:16:07 2007 +0100
@@ -6,9 +6,6 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-import re
-from MoinMoin import config
-
 def getIntegerInput(request, fieldname, default=None, minval=None, maxval=None):
     """ Get an integer value from a request parameter. If the value
         is out of bounds, it's made to fit into those bounds.
--- a/MoinMoin/widget/html.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/widget/html.py	Fri Feb 23 02:16:07 2007 +0100
@@ -666,19 +666,19 @@
 ### Widgets
 #############################################################################
 
-class FormWidget(Widget):
-    """ Widget to display data as an HTML form.
-
-        TODO: write code to combine the labels, data and HTML DOM to a complete form.
-
-        INCOMPLETE!!!
-    """
+#class FormWidget(Widget):
+#    """ Widget to display data as an HTML form.
+#
+#        TODO: write code to combine the labels, data and HTML DOM to a complete form.
+#
+#        INCOMPLETE!!!
+#    """
+#
+#    def __init__(self, request, **kw):
+#        Widget.__init__(self, request)
+#        # FIXME     vvvv
+#        self.form = form(**kw)
+#
+#    def render(self):
+#        self.request.write(str(self.form))
 
-    def __init__(self, request, **kw):
-        Widget.__init__(self, request)
-        # FIXME     vvvv
-        self.form = form(**kw)
-
-    def render(self):
-        self.request.write(str(self.form))
-
--- a/MoinMoin/wikidicts.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/wikidicts.py	Fri Feb 23 02:16:07 2007 +0100
@@ -6,12 +6,12 @@
     @copyright: 2003 by Gustavo Niemeyer, http://moin.conectiva.com.br/GustavoNiemeyer
     @license: GNU GPL, see COPYING for details.
 """
-import re, time, os
+import re, time
 
 #import copy #broken, see comments at top of this file:
 from MoinMoin.support import copy
 
-from MoinMoin import config, caching, wikiutil, Page, logfile
+from MoinMoin import caching, wikiutil, Page, logfile
 from MoinMoin.logfile.editlog import EditLog
 
 # Version of the internal data structure which is pickled
--- a/MoinMoin/wikisync.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/wikisync.py	Fri Feb 23 02:16:07 2007 +0100
@@ -331,7 +331,7 @@
 
     # Methods implementing the RemoteWiki interface
     def delete_page(self, pagename, comment):
-        page = PageEditor(self.request, page_name)
+        page = PageEditor(self.request, pagename)
         try:
             page.deletePage(comment)
         except PageEditor.AccessDenied, (msg, ):
--- a/MoinMoin/wikiutil.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/wikiutil.py	Fri Feb 23 02:16:07 2007 +0100
@@ -14,8 +14,8 @@
 import time
 import urllib
 
-from MoinMoin import util, version, config
-from MoinMoin.util import pysupport, filesys, lock
+from MoinMoin import config
+from MoinMoin.util import pysupport, lock
 
 # Exceptions
 class InvalidFileNameError(Exception):
@@ -1396,8 +1396,8 @@
         return parameter_list, parameter_dict
 
 
+""" never used:
     def _check_type(value, type, format):
-        """Never used!"""
         if type == 'n' and 's' in format: # n as s
             return value
 
@@ -1416,13 +1416,11 @@
             if 'b' in format:
                 return value.lower() != 'false' # s-> b
 
-
         if 's' in format: # * -> s
             return str(value)
         else:
             pass # XXX error
 
-"""
 def main():
     pattern = "%i%sf%s%ifs%(a)s|%(b)s"
     param = ' 4,"DI\'NG", b=retry, a="DING"'
--- a/MoinMoin/xmlrpc/UpdateGroup.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/MoinMoin/xmlrpc/UpdateGroup.py	Fri Feb 23 02:16:07 2007 +0100
@@ -6,9 +6,8 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-import sys, xmlrpclib, re
+import sys, xmlrpclib
 
-from MoinMoin.Page import Page
 from MoinMoin.PageEditor import PageEditor
 
 _debug = 0
--- a/contrib/phpwiki_migration/phpwiki2moinmoin.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/contrib/phpwiki_migration/phpwiki2moinmoin.py	Fri Feb 23 02:16:07 2007 +0100
@@ -110,7 +110,7 @@
         sys.path.append(wikipath)
 
 from MoinMoin.PageEditor import PageEditor
-from MoinMoin.request import RequestCLI
+from MoinMoin.request.CLI import Request
 
 # the block parser deals with the whole text to be converted
 #
@@ -358,7 +358,7 @@
 result = cursor.fetchall()
 for pagename,content,versiondata in result:
         utf8pagename = unicode(pagename, 'latin-1')
-        request = RequestCLI(utf8pagename)
+        request = Request(utf8pagename)
         page = PageEditor(utf8pagename, request)
         print pagename,
         # overwriting pages if selecting only some
--- a/tests/runtests.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/tests/runtests.py	Fri Feb 23 02:16:07 2007 +0100
@@ -12,7 +12,7 @@
 @license: GNU GPL, see COPYING for details.
 """
 
-import os, sys
+import sys
 
 from MoinMoin import _tests
 
--- a/wiki/config/more_samples/ldap_smb_farmconfig.py	Thu Feb 22 18:51:15 2007 +0100
+++ b/wiki/config/more_samples/ldap_smb_farmconfig.py	Fri Feb 23 02:16:07 2007 +0100
@@ -76,8 +76,8 @@
 
 class FarmConfig(DefaultConfig):
 
-    from MoinMoin import auth
-    auth = [auth.ldap_login, auth.smb_mount, auth.moin_cookie]
+    from MoinMoin import auth as authmod
+    auth = [authmod.ldap_login, authmod.smb_mount, authmod.moin_session]
 
     import ldap
     ldap_uri = 'ldap://ad.example.org' # ldap / active directory server URI
--- a/wiki/data/edit-log	Thu Feb 22 18:51:15 2007 +0100
+++ b/wiki/data/edit-log	Fri Feb 23 02:16:07 2007 +0100
@@ -0,0 +1,1 @@
+1172193184000000	00000002	SAVE	WikiSandBox	127.0.0.1	localhost