changeset 1975:384555088cab

lots of pep8 fixes
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 11 Feb 2013 04:49:04 +0100
parents 87272c032485
children 889e1e62e551
files MoinMoin/_tests/__init__.py MoinMoin/_tests/_test_template.py MoinMoin/_tests/ldap_testbase.py MoinMoin/_tests/wikiconfig.py MoinMoin/apps/admin/views.py MoinMoin/apps/feed/views.py MoinMoin/apps/frontend/views.py MoinMoin/apps/misc/views.py MoinMoin/auth/__init__.py MoinMoin/auth/http.py MoinMoin/auth/ldap_login.py MoinMoin/auth/log.py MoinMoin/auth/smb_mount.py MoinMoin/config/default.py MoinMoin/conftest.py MoinMoin/constants/forms.py MoinMoin/constants/keys.py MoinMoin/constants/tools/chartypes_create.py MoinMoin/converter/_args_wiki.py MoinMoin/converter/_table.py MoinMoin/converter/_util.py MoinMoin/converter/_wiki_macro.py MoinMoin/converter/archive_in.py MoinMoin/converter/audio_video_in.py MoinMoin/converter/creole_in.py MoinMoin/converter/docbook_in.py MoinMoin/converter/everything.py MoinMoin/converter/html_in.py MoinMoin/converter/html_out.py MoinMoin/converter/image_in.py MoinMoin/converter/include.py MoinMoin/converter/link.py MoinMoin/converter/markdown_in.py MoinMoin/converter/mediawiki_in.py MoinMoin/converter/moinwiki19_in.py MoinMoin/converter/moinwiki_in.py MoinMoin/converter/moinwiki_out.py MoinMoin/converter/nonexistent_in.py MoinMoin/converter/pdf_in.py MoinMoin/converter/pygments_in.py MoinMoin/converter/rst_in.py MoinMoin/converter/rst_out.py MoinMoin/converter/smiley.py MoinMoin/converter/xml_in.py MoinMoin/datastruct/backends/__init__.py MoinMoin/error.py MoinMoin/forms.py MoinMoin/items/__init__.py MoinMoin/items/blog.py MoinMoin/items/content.py MoinMoin/items/ticket.py MoinMoin/log.py MoinMoin/macro/Anchor.py MoinMoin/macro/Date.py MoinMoin/macro/DateTime.py MoinMoin/macro/GetText.py MoinMoin/macro/GetVal.py MoinMoin/macro/MailTo.py MoinMoin/macro/PagenameList.py MoinMoin/macro/RandomItem.py MoinMoin/macro/Verbatim.py MoinMoin/macro/_base.py MoinMoin/mail/sendmail.py MoinMoin/script/__init__.py MoinMoin/script/account/disable.py MoinMoin/script/account/resetpw.py MoinMoin/script/maint/modified_systemitems.py MoinMoin/script/maint/modify_item.py MoinMoin/script/maint/serialization.py MoinMoin/script/migration/moin19/import19.py MoinMoin/search/__init__.py MoinMoin/search/analyzers.py MoinMoin/security/__init__.py MoinMoin/security/textcha.py MoinMoin/security/ticket.py MoinMoin/signalling/log.py MoinMoin/storage/__init__.py MoinMoin/storage/backends/fileserver.py MoinMoin/storage/backends/stores.py MoinMoin/storage/error.py MoinMoin/storage/middleware/indexing.py MoinMoin/storage/middleware/routing.py MoinMoin/storage/middleware/serialization.py MoinMoin/storage/middleware/validation.py MoinMoin/storage/stores/__init__.py MoinMoin/storage/stores/kc.py MoinMoin/storage/stores/kt.py MoinMoin/storage/stores/mongodb.py MoinMoin/storage/stores/sqla.py MoinMoin/storage/stores/sqlite.py MoinMoin/themes/__init__.py MoinMoin/user.py MoinMoin/util/__init__.py MoinMoin/util/clock.py MoinMoin/util/crypto.py MoinMoin/util/diff3.py MoinMoin/util/diff_html.py MoinMoin/util/diff_text.py MoinMoin/util/filesys.py MoinMoin/util/forms.py MoinMoin/util/interwiki.py MoinMoin/util/iri.py MoinMoin/util/mime.py MoinMoin/util/mimetype.py MoinMoin/util/monkeypatch.py MoinMoin/util/paramparser.py MoinMoin/util/plugins.py MoinMoin/util/profile.py MoinMoin/util/pysupport.py MoinMoin/util/thread_monitor.py MoinMoin/util/version.py MoinMoin/wikiutil.py _ui_tests/conftest.py _ui_tests/driver_register.py _ui_tests/test_subitems.py _ui_tests/utils.py contrib/pep8/DeleteTrailingSpaces.py contrib/wsgi/profiler.py contrib/wsgi/proxy.py contrib/wsgi/raw_wsgi_bench.py setup.py wikiconfig.py
diffstat 122 files changed, 874 insertions(+), 513 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/__init__.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/_tests/__init__.py	Mon Feb 11 04:49:04 2013 +0100
@@ -22,6 +22,7 @@
 # Usually the tests run as anonymous user, but for some stuff, you
 # need more privs...
 
+
 def become_valid(username=u"ValidUser"):
     """ modify flaskg.user to make the user valid.
         Note that a valid user will only be in ACL special group "Known", if
@@ -57,11 +58,13 @@
     rev = item.store_revision(meta, StringIO(data), return_rev=True)
     return rev
 
+
 def create_random_string_list(length=14, count=10):
     """ creates a list of random strings """
     chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
     return [u"{0}".format(random_string(length, chars)) for counter in range(count)]
 
+
 def nuke_item(name):
     """ complete destroys an item """
     item = Item.create(name)
--- a/MoinMoin/_tests/_test_template.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/_tests/_test_template.py	Mon Feb 11 04:49:04 2013 +0100
@@ -45,6 +45,7 @@
     )
 
     from MoinMoin._tests import wikiconfig
+
     class Config(wikiconfig.Config):
         foo = 'bar'  # we want to have this non-default setting
 
--- a/MoinMoin/_tests/ldap_testbase.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/_tests/ldap_testbase.py	Mon Feb 11 04:49:04 2013 +0100
@@ -39,7 +39,11 @@
 SLAPD_EXECUTABLE = 'slapd'  # filename of LDAP server executable - if it is not
                             # in your PATH, you have to give full path/filename.
 
-import os, shutil, tempfile, time, base64
+import os
+import shutil
+import tempfile
+import time
+import base64
 from StringIO import StringIO
 import signal
 import subprocess
@@ -80,7 +84,7 @@
     def __init__(self,
                  config=None,  # config filename for -f
                  executable=SLAPD_EXECUTABLE,
-                 debug_flags='', # None,  # for -d stats,acl,args,trace,sync,config
+                 debug_flags='',  # None,  # for -d stats,acl,args,trace,sync,config
                  proto='ldap', ip='127.0.0.1', port=3890,  # use -h proto://ip:port
                  service_name=''  # defaults to -n executable:port, use None to not use -n
                 ):
@@ -90,7 +94,7 @@
         self.proto = proto
         self.ip = ip
         self.port = port
-        self.url = '{0}://{1}:{2}'.format(proto, ip, port) # can be used for ldap.initialize() call
+        self.url = '{0}://{1}:{2}'.format(proto, ip, port)  # can be used for ldap.initialize() call
         if service_name == '':
             self.service_name = '{0}:{1}'.format(executable, port)
         else:
@@ -109,7 +113,7 @@
         started = None
         if timeout:
             lo = ldap.initialize(self.url)
-            ldap.set_option(ldap.OPT_PROTOCOL_VERSION, ldap.VERSION3) # ldap v2 is outdated
+            ldap.set_option(ldap.OPT_PROTOCOL_VERSION, ldap.VERSION3)  # ldap v2 is outdated
             started = False
             wait_until = time.time() + timeout
             while time.time() < wait_until:
@@ -200,14 +204,14 @@
 
     def start_slapd(self):
         """ start a slapd and optionally wait until it talks with us """
-        self.slapd = Slapd(config=self.slapd_conf, port=3890+self.instance)
+        self.slapd = Slapd(config=self.slapd_conf, port=3890 + self.instance)
         started = self.slapd.start(timeout=self.timeout)
         return started
 
     def load_directory(self, ldif_content):
         """ load the directory with the ldif_content (str) """
         lo = ldap.initialize(self.slapd.url)
-        ldap.set_option(ldap.OPT_PROTOCOL_VERSION, ldap.VERSION3) # ldap v2 is outdated
+        ldap.set_option(ldap.OPT_PROTOCOL_VERSION, ldap.VERSION3)  # ldap v2 is outdated
         lo.simple_bind_s(self.rootdn, self.rootpw)
 
         class LDIFLoader(ldif.LDIFParser):
--- a/MoinMoin/_tests/wikiconfig.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/_tests/wikiconfig.py	Mon Feb 11 04:49:04 2013 +0100
@@ -15,10 +15,11 @@
 from os.path import abspath, dirname, join
 from MoinMoin.config.default import DefaultConfig
 
+
 class Config(DefaultConfig):
     _here = abspath(dirname(__file__))
     _root = abspath(join(_here, '..', '..'))
-    data_dir = join(_here, 'wiki', 'data') # needed for plugins package TODO
+    data_dir = join(_here, 'wiki', 'data')  # needed for plugins package TODO
     index_storage = 'FileStorage', (join(_here, 'wiki', 'index'), ), {}
     content_acl = None
     item_root = 'FrontPage'
--- a/MoinMoin/apps/admin/views.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/apps/admin/views.py	Mon Feb 11 04:49:04 2013 +0100
@@ -24,11 +24,13 @@
 from MoinMoin.constants.rights import SUPERUSER
 from MoinMoin.security import require_permission
 
+
 @admin.route('/superuser')
 @require_permission(SUPERUSER)
 def index():
     return render_template('admin/index.html', title_name=_(u"Admin"))
 
+
 @admin.route('/user')
 def index_user():
     return render_template('user/index_user.html', title_name=_(u"User"))
@@ -41,7 +43,7 @@
     User Account Browser
     """
     groups = flaskg.groups
-    revs = user.search_users() # all users
+    revs = user.search_users()  # all users
     user_accounts = [dict(uid=rev.meta[ITEMID],
                           name=rev.meta[NAME],
                           email=rev.meta[EMAIL],
@@ -119,6 +121,7 @@
 
 from MoinMoin.config import default as defaultconfig
 
+
 @admin.route('/wikiconfig', methods=['GET', ])
 @require_permission(SUPERUSER)
 def wikiconfig():
--- a/MoinMoin/apps/feed/views.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/apps/feed/views.py	Mon Feb 11 04:49:04 2013 +0100
@@ -31,6 +31,7 @@
 from MoinMoin.util.crypto import cache_key
 from MoinMoin.util.interwiki import url_for_item
 
+
 @feed.route('/atom/<itemname:item_name>')
 @feed.route('/atom', defaults=dict(item_name=''))
 def atom(item_name):
@@ -75,7 +76,8 @@
                     content = hl_item.content._render_data_diff_atom(previous_rev, this_rev)
                 else:
                     # full html rendering for new items
-                    content = render_template('atom.html', get='first_revision', rev=this_rev, content=Markup(hl_item.content._render_data()), revision=this_revid)
+                    content = render_template('atom.html', get='first_revision', rev=this_rev,
+                                              content=Markup(hl_item.content._render_data()), revision=this_revid)
                 content_type = 'html'
             except Exception as e:
                 logging.exception("content rendering crashed")
@@ -86,7 +88,8 @@
             if rev_comment:
                 # Trim down extremely long revision comment
                 if len(rev_comment) > 80:
-                    content = render_template('atom.html', get='comment_cont_merge', comment=rev_comment[79:], content=Markup(content))
+                    content = render_template('atom.html', get='comment_cont_merge', comment=rev_comment[79:],
+                                              content=Markup(content))
                     rev_comment = u"{0}...".format(rev_comment[:79])
                 feed_title = u"{0} - {1}".format(author.get(NAME, ''), rev_comment)
             else:
--- a/MoinMoin/apps/frontend/views.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/apps/frontend/views.py	Mon Feb 11 04:49:04 2013 +0100
@@ -46,7 +46,8 @@
 from MoinMoin.i18n import _, L_, N_
 from MoinMoin.themes import render_template, contenttype_to_class
 from MoinMoin.apps.frontend import frontend
-from MoinMoin.forms import OptionalText, RequiredText, URL, YourOpenID, YourEmail, RequiredPassword, Checkbox, InlineCheckbox, Select, Names, Tags, Natural, Submit, Hidden, MultiSelect
+from MoinMoin.forms import (OptionalText, RequiredText, URL, YourOpenID, YourEmail, RequiredPassword, Checkbox,
+                            InlineCheckbox, Select, Names, Tags, Natural, Submit, Hidden, MultiSelect)
 from MoinMoin.items import BaseChangeForm, Item, NonExistent
 from MoinMoin.items.content import content_registry
 from MoinMoin import user, util
@@ -75,6 +76,7 @@
     item_name = app.cfg.item_root
     return redirect(url_for_item(item_name))
 
+
 @frontend.route('/robots.txt')
 def robots():
     return Response("""\
@@ -163,7 +165,7 @@
     # TAGS might be there multiple times, thus we need multi:
     lookup_form = LookupForm.from_flat(request.values.items(multi=True))
     valid = lookup_form.validate()
-    lookup_form['submit'].set_default() # XXX from_flat() kills all values
+    lookup_form['submit'].set_default()  # XXX from_flat() kills all values
     if valid:
         history = bool(request.values.get('history'))
         idx_name = ALL_REVS if history else LATEST_REVS
@@ -233,12 +235,13 @@
             transcluded_names.update(transclusions)
         return transcluded_names
 
+
 @frontend.route('/+search/<itemname:item_name>', methods=['GET', 'POST'])
 @frontend.route('/+search', defaults=dict(item_name=u''), methods=['GET', 'POST'])
 def search(item_name):
     search_form = SearchForm.from_flat(request.values)
     valid = search_form.validate()
-    search_form['submit'].set_default() # XXX from_flat() kills all values
+    search_form['submit'].set_default()  # XXX from_flat() kills all values
     query = search_form['q'].value
     if valid:
         history = bool(request.values.get('history'))
@@ -247,7 +250,7 @@
         q = qp.parse(query)
 
         _filter = None
-        if item_name: # Only search this item and subitems
+        if item_name:  # Only search this item and subitems
             prefix_name = item_name + u'/'
             terms = [Term(NAME_EXACT, item_name), Prefix(NAME_EXACT, prefix_name), ]
 
@@ -283,8 +286,10 @@
             key_terms_is_fast = False
             if key_terms_is_fast:
                 flaskg.clock.start('search suggestions')
-                name_suggestions = u', '.join([word for word, score in results.key_terms(NAME, docs=20, numterms=10)])
-                content_suggestions = u', '.join([word for word, score in results.key_terms(CONTENT, docs=20, numterms=10)])
+                name_suggestions = u', '.join([word
+                                               for word, score in results.key_terms(NAME, docs=20, numterms=10)])
+                content_suggestions = u', '.join([word
+                                                  for word, score in results.key_terms(CONTENT, docs=20, numterms=10)])
                 flaskg.clock.stop('search suggestions')
             else:
                 name_suggestions = u''
@@ -401,7 +406,7 @@
 @presenter('meta', add_trail=True)
 def show_item_meta(item):
     show_revision = request.view_args['rev'] != CURRENT
-    show_navigation = False # TODO
+    show_navigation = False  # TODO
     first_rev = None
     last_rev = None
     if show_navigation:
@@ -420,6 +425,7 @@
                            show_navigation=show_navigation,
                           )
 
+
 @frontend.route('/+content/+<rev>/<itemname:item_name>')
 @frontend.route('/+content/<itemname:item_name>', defaults=dict(rev=CURRENT))
 def content_item(item_name, rev):
@@ -428,7 +434,7 @@
     search_form = SearchForm.from_flat(request.values)
     if search_form.validate():
         return _search(search_form, item_name)
-    search_form['submit'].set_default() # XXX from_flat() kills all values
+    search_form['submit'].set_default()  # XXX from_flat() kills all values
     item_displayed.send(app._get_current_object(),
                         item_name=item_name)
     try:
@@ -442,15 +448,18 @@
                            data_rendered=Markup(item.content._render_data()),
                            )
 
+
 @presenter('get')
 def get_item(item):
     return item.content.do_get()
 
+
 @presenter('download')
 def download_item(item):
     mimetype = request.values.get("mimetype")
     return item.content.do_get(force_attachment=True, mimetype=mimetype)
 
+
 @frontend.route('/+convert/<itemname:item_name>')
 def convert_item(item_name):
     """
@@ -502,15 +511,19 @@
 class TargetChangeForm(BaseChangeForm):
     target = RequiredText.using(label=L_('Target')).with_properties(placeholder=L_("The name of the target item"))
 
+
 class RevertItemForm(BaseChangeForm):
     name = 'revert_item'
 
+
 class DeleteItemForm(BaseChangeForm):
     name = 'delete_item'
 
+
 class DestroyItemForm(BaseChangeForm):
     name = 'destroy_item'
 
+
 class RenameItemForm(TargetChangeForm):
     name = 'rename_item'
 
@@ -597,6 +610,7 @@
                            form=form,
                           )
 
+
 @frontend.route('/+ajaxdelete/<itemname:item_name>', methods=['POST'])
 @frontend.route('/+ajaxdelete', defaults=dict(item_name=''), methods=['POST'])
 def ajaxdelete(item_name):
@@ -622,6 +636,7 @@
 
     return jsonify(response)
 
+
 @frontend.route('/+ajaxdestroy/<itemname:item_name>', methods=['POST'])
 @frontend.route('/+ajaxdestroy', defaults=dict(item_name=''), methods=['POST'])
 def ajaxdestroy(item_name):
@@ -665,7 +680,7 @@
 def destroy_item(item_name, rev):
     if rev is None:
         # no revision given
-        _rev = CURRENT # for item creation
+        _rev = CURRENT  # for item creation
         destroy_item = True
     else:
         _rev = rev
@@ -705,7 +720,7 @@
     """
     data_file = request.files.get('data_file')
     subitem_name = data_file.filename
-    contenttype = data_file.content_type # guess by browser, based on file name
+    contenttype = data_file.content_type  # guess by browser, based on file name
     data = data_file.stream
     if item_name:
         subitem_prefix = item_name + u'/'
@@ -732,17 +747,20 @@
     contenttype_group_descriptions[g] = ', '.join([e.display_name for e in content_registry.groups[g]])
 contenttype_groups.append('unknown items')
 
-ContenttypeGroup = MultiSelect.of(Enum.using(valid_values=contenttype_groups).with_properties(descriptions=contenttype_group_descriptions)).using(optional=True)
+ContenttypeGroup = MultiSelect.of(Enum.using(valid_values=contenttype_groups).with_properties(
+                                  descriptions=contenttype_group_descriptions)).using(optional=True)
+
 
 class IndexForm(Form):
     contenttype = ContenttypeGroup
     submit = Submit.using(default=L_('Filter'))
 
+
 @frontend.route('/+index/', defaults=dict(item_name=''), methods=['GET', 'POST'])
 @frontend.route('/+index/<itemname:item_name>', methods=['GET', 'POST'])
 def index(item_name):
     try:
-        item = Item.create(item_name) # when item_name='', it gives toplevel index
+        item = Item.create(item_name)  # when item_name='', it gives toplevel index
     except AccessDenied:
         abort(403)
 
@@ -752,7 +770,7 @@
     # values, eg. calling items with multi=True. See Werkzeug documentation for
     # more.
     form = IndexForm.from_flat(request.args.items(multi=True))
-    form['submit'].set_default() # XXX from_flat() kills all values
+    form['submit'].set_default()  # XXX from_flat() kills all values
     if not form['contenttype']:
         form['contenttype'].set(contenttype_groups)
 
@@ -856,7 +874,7 @@
     history = [dict((k, v) for k, v in rev.meta.iteritems() if k != CONTENT) for rev in revs]
     history_page = util.getPageContent(history, offset, results_per_page)
     return render_template('history.html',
-                           item_name=item_name, # XXX no item here
+                           item_name=item_name,  # XXX no item here
                            history_page=history_page,
                            bookmark_time=bookmark_time,
                           )
@@ -897,6 +915,7 @@
                            bookmark_time=bookmark_time,
                           )
 
+
 def _compute_item_sets():
     """
     compute sets of existing, linked, transcluded and no-revision item names
@@ -999,8 +1018,8 @@
             return False
         if element['password1'].value != element['password2'].value:
             return self.note_error(element, state, 'passwords_mismatch_msg')
+        return True
 
-        return True
 
 class RegistrationForm(TextChaizedForm):
     """a simple user registration form"""
@@ -1024,6 +1043,7 @@
 
     openid = YourOpenID
 
+
 def _using_moin_auth():
     """Check if MoinAuth is being used for authentication.
 
@@ -1096,7 +1116,8 @@
                     if is_ok:
                         flash(_('Account verification required, please see the email we sent to your address.'), "info")
                     else:
-                        flash(_('An error occurred while sending the verification email: "%(message)s" Please contact an administrator to activate your account.',
+                        flash(_('An error occurred while sending the verification email: "%(message)s" '
+                                'Please contact an administrator to activate your account.',
                             message=msg), "error")
                 else:
                     flash(_('Account created, please log in now.'), "info")
@@ -1180,6 +1201,7 @@
                            form=form,
                           )
 
+
 class ValidPasswordRecovery(Validator):
     """Validator for a valid password recovery form
     """
@@ -1198,14 +1220,18 @@
 
         return True
 
+
 class PasswordRecoveryForm(Form):
     """a simple password recovery form"""
     name = 'recoverpass'
 
     username = RequiredText.using(label=L_('Name')).with_properties(placeholder=L_("Your login name"))
-    token = RequiredText.using(label=L_('Recovery token')).with_properties(placeholder=L_("The recovery token that has been sent to you"))
-    password1 = RequiredPassword.using(label=L_('New password')).with_properties(placeholder=L_("The login password you want to use"))
-    password2 = RequiredPassword.using(label=L_('New password (repeat)')).with_properties(placeholder=L_("Repeat the same password"))
+    token = RequiredText.using(label=L_('Recovery token')).with_properties(
+        placeholder=L_("The recovery token that has been sent to you"))
+    password1 = RequiredPassword.using(label=L_('New password')).with_properties(
+        placeholder=L_("The login password you want to use"))
+    password2 = RequiredPassword.using(label=L_('New password (repeat)')).with_properties(
+        placeholder=L_("Repeat the same password"))
     submit = Submit.using(default=L_('Change password'))
 
     validators = [ValidPasswordRecovery()]
@@ -1343,11 +1369,15 @@
     name = 'usersettings_password'
     validators = [ValidChangePass()]
 
-    password_current = RequiredPassword.using(label=L_('Current Password')).with_properties(placeholder=L_("Your current login password"))
-    password1 = RequiredPassword.using(label=L_('New password')).with_properties(placeholder=L_("The login password you want to use"))
-    password2 = RequiredPassword.using(label=L_('New password (repeat)')).with_properties(placeholder=L_("Repeat the same password"))
+    password_current = RequiredPassword.using(label=L_('Current Password')).with_properties(
+        placeholder=L_("Your current login password"))
+    password1 = RequiredPassword.using(label=L_('New password')).with_properties(
+        placeholder=L_("The login password you want to use"))
+    password2 = RequiredPassword.using(label=L_('New password (repeat)')).with_properties(
+        placeholder=L_("Repeat the same password"))
     submit = Submit.using(default=L_('Change password'))
 
+
 class UserSettingsNotificationForm(Form):
     name = 'usersettings_notification'
     email = YourEmail
@@ -1377,9 +1407,10 @@
 
     # these forms can't be global because we need app object, which is only available within a request:
     class UserSettingsPersonalForm(Form):
-        name = 'usersettings_personal' # "name" is duplicate
+        name = 'usersettings_personal'  # "name" is duplicate
         name = Names.using(label=L_('Names')).with_properties(placeholder=L_("The login names you want to use"))
-        display_name = OptionalText.using(label=L_('Display-Name')).with_properties(placeholder=L_("Your display name (informational)"))
+        display_name = OptionalText.using(label=L_('Display-Name')).with_properties(
+            placeholder=L_("Your display name (informational)"))
         openid = YourOpenID.using(optional=True)
         #timezones_keys = sorted(Locale('en').time_zones.keys())
         timezones_keys = [unicode(tz) for tz in pytz.common_timezones]
@@ -1396,10 +1427,14 @@
         themes_available = sorted([(unicode(t.identifier), t.name) for t in get_themes_list()],
                                   key=lambda x: x[1])
         themes_keys = [t[0] for t in themes_available]
-        theme_name = Select.using(label=L_('Theme name')).with_properties(labels=dict(themes_available)).valued(*themes_keys)
-        css_url = URL.using(label=L_('User CSS URL'), optional=True).with_properties(placeholder=L_("Give the URL of your custom CSS (optional)"))
-        edit_rows = Natural.using(label=L_('Editor size')).with_properties(placeholder=L_("Editor textarea height (0=auto)"))
-        results_per_page = Natural.using(label=L_('History results per page')).with_properties(placeholder=L_("Number of results per page (0=no paging)"))
+        theme_name = Select.using(label=L_('Theme name')).with_properties(
+            labels=dict(themes_available)).valued(*themes_keys)
+        css_url = URL.using(label=L_('User CSS URL'), optional=True).with_properties(
+            placeholder=L_("Give the URL of your custom CSS (optional)"))
+        edit_rows = Natural.using(label=L_('Editor size')).with_properties(
+            placeholder=L_("Editor textarea height (0=auto)"))
+        results_per_page = Natural.using(label=L_('History results per page')).with_properties(
+            placeholder=L_("Number of results per page (0=no paging)"))
         submit = Submit.using(default=L_('Save'))
 
     form_classes = dict(
@@ -1445,7 +1480,8 @@
                     response['flash'].append((_("Your password has been changed."), "info"))
                 else:
                     if part == 'personal':
-                        if form['openid'].value and form['openid'].value != flaskg.user.openid and user.search_users(openid=form['openid'].value):
+                        if (form['openid'].value and form['openid'].value != flaskg.user.openid and
+                            user.search_users(openid=form['openid'].value)):
                             # duplicate openid
                             response['flash'].append((_("This openid is already in use."), "error"))
                             success = False
@@ -1454,7 +1490,8 @@
                             for name in new_names:
                                 if user.search_users(name_exact=name):
                                     # duplicate name
-                                    response['flash'].append((_("The username %(name)r is already in use.", name=name), "error"))
+                                    response['flash'].append((_("The username %(name)r is already in use.", name=name),
+                                                              "error"))
                                     success = False
                     if part == 'notification':
                         if (form['email'].value != flaskg.user.email and
@@ -1468,21 +1505,26 @@
                         d.pop('submit')
                         for k, v in d.items():
                             flaskg.user.profile[k] = v
-                        if part == 'notification' and app.cfg.user_email_verification and form['email'].value != user_old_email:
+                        if (part == 'notification' and app.cfg.user_email_verification and
+                            form['email'].value != user_old_email):
                             # disable account
                             flaskg.user.profile[DISABLED] = True
                             # send verification mail
                             is_ok, msg = flaskg.user.mail_email_verification()
                             if is_ok:
                                 flaskg.user.logout_session()
-                                response['flash'].append((_('Your account has been disabled because you changed your email address. Please see the email we sent to your address to reactivate it.'), "info"))
+                                response['flash'].append((_('Your account has been disabled because you changed your '
+                                                            'email address. Please see the email we sent to your '
+                                                            'address to reactivate it.'), "info"))
                                 response['redirect'] = url_for('.show_root')
                             else:
                                 # sending the verification email didn't work. reset email change and alert the user.
                                 flaskg.user.profile[DISABLED] = False
                                 flaskg.user.profile[EMAIL] = user_old_email
                                 flaskg.user.save()
-                                response['flash'].append((_('Your email address was not changed because sending the verification email failed. Please try again later.'), "error"))
+                                response['flash'].append((_('Your email address was not changed because sending the '
+                                                            'verification email failed. Please try again later.'),
+                                                          "error"))
                         else:
                             flaskg.user.save()
 
@@ -1667,7 +1709,7 @@
                 item_names.append(name)
     return render_template("link_list_item_panel.html",
                            headline=_("Items with similar names to '%(item_name)s'", item_name=item_name),
-                           item_name=item_name, # XXX no item
+                           item_name=item_name,  # XXX no item
                            item_names=item_names)
 
 
@@ -1798,9 +1840,9 @@
     if not flaskg.storage[item_name]:
         abort(404, item_name)
     sitemap = NestedItemListBuilder().recurse_build([item_name])
-    del sitemap[0] # don't show current item name as sole toplevel list item
+    del sitemap[0]  # don't show current item name as sole toplevel list item
     return render_template('sitemap.html',
-                           item_name=item_name, # XXX no item
+                           item_name=item_name,  # XXX no item
                            sitemap=sitemap,
                           )
 
@@ -1809,7 +1851,7 @@
     def __init__(self):
         self.children = set()
         self.numnodes = 0
-        self.maxnodes = 35 # approx. max count of nodes, not strict
+        self.maxnodes = 35  # approx. max count of nodes, not strict
 
     def recurse_build(self, names):
         result = []
@@ -1868,10 +1910,11 @@
             scale = weight_max / 2
         else:
             scale = weight_max / (count_max - count_min)
+
         def cls(count):
             # return the css class for this tag
             weight = scale * (count - count_min)
-            return "weight{0}".format(int(weight)) # weight0, ..., weight9
+            return "weight{0}".format(int(weight))  # weight0, ..., weight9
         tags = [(cls(count), tag) for tag, count in tags_counts]
     else:
         tags = []
--- a/MoinMoin/apps/misc/views.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/apps/misc/views.py	Mon Feb 11 04:49:04 2013 +0100
@@ -20,6 +20,7 @@
 
 SITEMAP_HAS_SYSTEM_ITEMS = True
 
+
 @misc.route('/sitemap')
 def sitemap():
     """
@@ -33,7 +34,7 @@
     for rev in flaskg.storage.documents(wikiname=app.cfg.interwikiname):
         name = rev.name
         mtime = rev.meta[MTIME]
-        if False: # was: wikiutil.isSystemItem(name)   XXX add back later, when we have that in the index
+        if False:  # was: wikiutil.isSystemItem(name)   XXX add back later, when we have that in the index
             if not SITEMAP_HAS_SYSTEM_ITEMS:
                 continue
             # system items are rather boring
--- a/MoinMoin/auth/__init__.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/auth/__init__.py	Mon Feb 11 04:49:04 2013 +0100
@@ -177,21 +177,25 @@
         self.multistage = multistage
         self.redirect_to = redirect_to
 
+
 class ContinueLogin(LoginReturn):
     """ ContinueLogin - helper for auth method login that just continues """
     def __init__(self, user_obj, message=None):
         LoginReturn.__init__(self, user_obj, True, message=message)
 
+
 class CancelLogin(LoginReturn):
     """ CancelLogin - cancel login showing a message """
     def __init__(self, message):
         LoginReturn.__init__(self, None, False, message=message)
 
+
 class MultistageFormLogin(LoginReturn):
     """ MultistageFormLogin - require user to fill in another form """
     def __init__(self, multistage):
         LoginReturn.__init__(self, None, False, multistage=multistage)
 
+
 class MultistageRedirectLogin(LoginReturn):
     """ MultistageRedirectLogin - redirect user to another site before continuing login """
     def __init__(self, url):
@@ -202,22 +206,28 @@
     name = None
     login_inputs = []
     logout_possible = False
+
     def __init__(self, trusted=False, **kw):
         self.trusted = trusted
         if kw:
             raise TypeError("got unexpected arguments %r" % kw)
+
     def login(self, user_obj, **kw):
         return ContinueLogin(user_obj)
+
     def request(self, user_obj, **kw):
         return user_obj, True
+
     def logout(self, user_obj, **kw):
         if self.name and user_obj and user_obj.auth_method == self.name:
             logging.debug("{0}: logout - invalidating user {1!r}".format(self.name, user_obj.name))
             user_obj.valid = False
         return user_obj, True
+
     def login_hint(self):
         return None
 
+
 class MoinAuth(BaseAuth):
     """ handle login from moin login form """
     def __init__(self, **kw):
@@ -267,7 +277,7 @@
         Alternatively you can directly give a fixed user name (user_name)
         that will be considered as authenticated.
     """
-    name = 'given' # was 'http' in 1.8.x and before
+    name = 'given'  # was 'http' in 1.8.x and before
 
     def __init__(self,
                  env_var=None,  # environment variable we want to read (default: REMOTE_USER)
@@ -352,7 +362,7 @@
             u.create_or_update()
         if u and u.valid:
             logging.debug("returning valid user {0!r}".format(u))
-            return u, True # True to get other methods called, too
+            return u, True  # True to get other methods called, too
         else:
             logging.debug("returning {0!r}".format(user_obj))
             return user_obj, True
@@ -407,6 +417,7 @@
 
     return userobj
 
+
 def handle_logout(userobj):
     """ Logout the passed user from every configured authentication method. """
     if userobj is None:
@@ -419,6 +430,7 @@
             break
     return userobj
 
+
 def handle_request(userobj):
     """ Handle the per-request callbacks of the configured authentication methods. """
     for authmethod in app.cfg.auth:
@@ -427,6 +439,7 @@
             break
     return userobj
 
+
 def setup_from_session():
     userobj = None
     if 'user.itemid' in session:
--- a/MoinMoin/auth/http.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/auth/http.py	Mon Feb 11 04:49:04 2013 +0100
@@ -48,7 +48,8 @@
 
         auth = request.authorization
         if auth and auth.username and auth.password is not None:
-            logging.debug("http basic auth, received username: {0!r} password: {1!r}".format(auth.username, auth.password))
+            logging.debug("http basic auth, received username: {0!r} password: {1!r}".format(
+                auth.username, auth.password))
             u = user.User(name=auth.username.decode(self.coding),
                           password=auth.password.decode(self.coding),
                           auth_method=self.name, auth_attribs=[], trusted=self.trusted)
@@ -66,7 +67,7 @@
             u.create_or_update()
         if u and u.valid:
             logging.debug("returning valid user {0!r}".format(u))
-            return u, True # True to get other methods called, too
+            return u, True  # True to get other methods called, too
         else:
             logging.debug("returning {0!r}".format(user_obj))
             return user_obj, True
--- a/MoinMoin/auth/ldap_login.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/auth/ldap_login.py	Mon Feb 11 04:49:04 2013 +0100
@@ -60,32 +60,32 @@
         bind_pw='',
         base_dn='',  # base DN we use for searching
                      #base_dn = 'ou=SOMEUNIT,dc=example,dc=org'
-        scope=ldap.SCOPE_SUBTREE, # scope of the search we do (2 == ldap.SCOPE_SUBTREE)
-        referrals=0, # LDAP REFERRALS (0 needed for AD)
+        scope=ldap.SCOPE_SUBTREE,  # scope of the search we do (2 == ldap.SCOPE_SUBTREE)
+        referrals=0,  # LDAP REFERRALS (0 needed for AD)
         search_filter='(uid=%(username)s)',  # ldap filter used for searching:
                                              #search_filter = '(sAMAccountName=%(username)s)' # (AD)
                                              #search_filter = '(uid=%(username)s)' # (OpenLDAP)
                                              # you can also do more complex filtering like:
                                              # "(&(cn=%(username)s)(memberOf=CN=WikiUsers,OU=Groups,DC=example,DC=org))"
         # some attribute names we use to extract information from LDAP:
-        givenname_attribute=None, # ('givenName') ldap attribute we get the first name from
-        surname_attribute=None, # ('sn') ldap attribute we get the family name from
-        displayname_attribute=None, # ('displayName') ldap attribute we get the display_name from
-        email_attribute=None, # ('mail') ldap attribute we get the email address from
-        email_callback=None, # called to make up email address
-        name_callback=None, # called to use a Wiki name different from the login name
-        coding='utf-8', # coding used for ldap queries and result values
-        timeout=10, # how long we wait for the ldap server [s]
-        start_tls=0, # 0 = No, 1 = Try, 2 = Required
+        givenname_attribute=None,  # ('givenName') ldap attribute we get the first name from
+        surname_attribute=None,  # ('sn') ldap attribute we get the family name from
+        displayname_attribute=None,  # ('displayName') ldap attribute we get the display_name from
+        email_attribute=None,  # ('mail') ldap attribute we get the email address from
+        email_callback=None,  # called to make up email address
+        name_callback=None,  # called to use a Wiki name different from the login name
+        coding='utf-8',  # coding used for ldap queries and result values
+        timeout=10,  # how long we wait for the ldap server [s]
+        start_tls=0,  # 0 = No, 1 = Try, 2 = Required
         tls_cacertdir=None,
         tls_cacertfile=None,
         tls_certfile=None,
         tls_keyfile=None,
-        tls_require_cert=0, # 0 == ldap.OPT_X_TLS_NEVER (needed for self-signed certs)
-        bind_once=False, # set to True to only do one bind - useful if configured to bind as the user on the first attempt
-        autocreate=False, # set to True if you want to autocreate user profiles
-        name='ldap', # use e.g. 'ldap_pdc' and 'ldap_bdc' (or 'ldap1' and 'ldap2') if you auth against 2 ldap servers
-        report_invalid_credentials=True, # whether to emit "invalid username or password" msg at login time or not
+        tls_require_cert=0,  # 0 == ldap.OPT_X_TLS_NEVER (needed for self-signed certs)
+        bind_once=False,  # set to True to only do one bind - useful if configured to bind as the user on first attempt
+        autocreate=False,  # set to True if you want to autocreate user profiles
+        name='ldap',  # use e.g. 'ldap_pdc' and 'ldap_bdc' (or 'ldap1' and 'ldap2') if you auth against 2 ldap servers
+        report_invalid_credentials=True,  # whether to emit "invalid username or password" msg at login time or not
         **kw
         ):
         super(LDAPAuth, self).__init__(**kw)
@@ -135,7 +135,7 @@
                 dn = None
                 coding = self.coding
                 logging.debug("Setting misc. ldap options...")
-                ldap.set_option(ldap.OPT_PROTOCOL_VERSION, ldap.VERSION3) # ldap v2 is outdated
+                ldap.set_option(ldap.OPT_PROTOCOL_VERSION, ldap.VERSION3)  # ldap v2 is outdated
                 ldap.set_option(ldap.OPT_REFERRALS, self.referrals)
                 ldap.set_option(ldap.OPT_NETWORK_TIMEOUT, self.timeout)
 
@@ -193,7 +193,8 @@
                 result_length = len(lusers)
                 if result_length != 1:
                     if result_length > 1:
-                        logging.warning("Search found more than one ({0}) matches for {1!r}.".format(result_length, filterstr))
+                        logging.warning("Search found more than one ({0}) matches for {1!r}.".format(
+                            result_length, filterstr))
                     if result_length == 0:
                         logging.debug("Search found no matches for {0!r}.".format(filterstr, ))
                     if self.report_invalid_credentials:
@@ -233,18 +234,22 @@
                     username = self.name_callback(ldap_dict)
 
                 if email:
-                    u = user.User(auth_username=username, auth_method=self.name, auth_attribs=('name', 'password', 'email', 'mailto_author', ),
+                    u = user.User(auth_username=username, auth_method=self.name,
+                                  auth_attribs=('name', 'password', 'email', 'mailto_author', ),
                                   trusted=self.trusted)
                     u.email = email
                 else:
-                    u = user.User(auth_username=username, auth_method=self.name, auth_attribs=('name', 'password', 'mailto_author', ),
+                    u = user.User(auth_username=username, auth_method=self.name,
+                                  auth_attribs=('name', 'password', 'mailto_author', ),
                                   trusted=self.trusted)
                 u.name = username
                 u.display_name = display_name
-                logging.debug("creating user object with name {0!r} email {1!r} display name {2!r}".format(username, email, display_name))
+                logging.debug("creating user object with name {0!r} email {1!r} display name {2!r}".format(
+                    username, email, display_name))
 
             except ldap.INVALID_CREDENTIALS as err:
-                logging.debug("invalid credentials (wrong password?) for dn {0!r} (username: {1!r})".format(dn, username))
+                logging.debug("invalid credentials (wrong password?) for dn {0!r} (username: {1!r})".format(
+                    dn, username))
                 return CancelLogin(_("Invalid username or password."))
 
             if u and self.autocreate:
--- a/MoinMoin/auth/log.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/auth/log.py	Mon Feb 11 04:49:04 2013 +0100
@@ -14,6 +14,7 @@
 
 from MoinMoin.auth import BaseAuth, ContinueLogin
 
+
 class AuthLog(BaseAuth):
     """ just log the call, do nothing else """
     name = "log"
--- a/MoinMoin/auth/smb_mount.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/auth/smb_mount.py	Mon Feb 11 04:49:04 2013 +0100
@@ -16,6 +16,7 @@
 
 from MoinMoin.auth import BaseAuth, CancelLogin, ContinueLogin
 
+
 class SMBMount(BaseAuth):
     """ auth plugin for (un)mounting an smb share,
         this is a wrapper around mount.cifs -o <options> //server/share mountpoint
@@ -23,17 +24,17 @@
         See man mount.cifs for details.
     """
     def __init__(self,
-        server, # mount.cifs //server/share
-        share, # mount.cifs //server/share
-        mountpoint_fn, # function of username to determine the mountpoint, e.g.:
-                       # lambda username: u'/mnt/wiki/%s' % username
-        dir_user, # username to get the uid that is used for mount.cifs -o uid=... (e.g. 'www-data')
-        domain, # mount.cifs -o domain=...
-        dir_mode='0700', # mount.cifs -o dir_mode=...
-        file_mode='0600', # mount.cifs -o file_mode=...
-        iocharset='utf-8', # mount.cifs -o iocharset=... (try 'iso8859-1' if default does not work)
-        coding='utf-8', # encoding used for username/password/cmdline (try 'iso8859-1' if default does not work)
-        log='/dev/null', # logfile for mount.cifs output
+        server,  # mount.cifs //server/share
+        share,  # mount.cifs //server/share
+        mountpoint_fn,  # function of username to determine the mountpoint, e.g.:
+                        # lambda username: u'/mnt/wiki/%s' % username
+        dir_user,  # username to get the uid that is used for mount.cifs -o uid=... (e.g. 'www-data')
+        domain,  # mount.cifs -o domain=...
+        dir_mode='0700',  # mount.cifs -o dir_mode=...
+        file_mode='0600',  # mount.cifs -o file_mode=...
+        iocharset='utf-8',  # mount.cifs -o iocharset=... (try 'iso8859-1' if default does not work)
+        coding='utf-8',  # encoding used for username/password/cmdline (try 'iso8859-1' if default does not work)
+        log='/dev/null',  # logfile for mount.cifs output
         **kw
         ):
         super(SMBMount, self).__init__(**kw)
@@ -51,13 +52,16 @@
     def do_smb(self, username, password, login):
         logging.debug("login={0} logout={1}: got name={2!r}".format(login, not login, username))
 
-        import os, pwd, subprocess
+        import os
+        import pwd
+        import subprocess
         web_username = self.dir_user
-        web_uid = pwd.getpwnam(web_username)[2] # XXX better just use current uid?
+        web_uid = pwd.getpwnam(web_username)[2]  # XXX better just use current uid?
 
         mountpoint = self.mountpoint_fn(username)
         if login:
-            cmd = u"sudo mount -t cifs -o user=%(user)s,domain=%(domain)s,uid=%(uid)d,dir_mode=%(dir_mode)s,file_mode=%(file_mode)s,iocharset=%(iocharset)s //%(server)s/%(share)s %(mountpoint)s >>%(log)s 2>&1"
+            cmd = (u"sudo mount -t cifs -o user=%(user)s,domain=%(domain)s,uid=%(uid)d,dir_mode=%(dir_mode)s,file_mode="
+                   u"%(file_mode)s,iocharset=%(iocharset)s //%(server)s/%(share)s %(mountpoint)s >>%(log)s 2>&1")
         else:
             cmd = u"sudo umount %(mountpoint)s >>%(log)s 2>&1"
 
@@ -77,7 +81,7 @@
         if login:
             try:
                 if not os.path.exists(mountpoint):
-                    os.makedirs(mountpoint) # the dir containing the mountpoint must be writeable for us!
+                    os.makedirs(mountpoint)  # the dir containing the mountpoint must be writeable for us!
             except OSError:
                 pass
             env['PASSWD'] = password.encode(self.coding)
--- a/MoinMoin/config/default.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/config/default.py	Mon Feb 11 04:49:04 2013 +0100
@@ -114,22 +114,28 @@
         self.mail_enabled = self.mail_enabled and True or False
 
         if self.namespace_mapping is None:
-            raise error.ConfigurationError("No storage configuration specified! You need to define a namespace_mapping. "
-                                           "For further reference, please see HelpOnStorageConfiguration.")
+            raise error.ConfigurationError(
+                "No storage configuration specified! You need to define a namespace_mapping. "
+                "For further reference, please see HelpOnStorageConfiguration.")
 
         if self.backend_mapping is None:
-            raise error.ConfigurationError("No storage configuration specified! You need to define a backend_mapping. " +
-                                           "For further reference, please see HelpOnStorageConfiguration.")
+            raise error.ConfigurationError(
+                "No storage configuration specified! You need to define a backend_mapping. " +
+                "For further reference, please see HelpOnStorageConfiguration.")
 
         if self.acl_mapping is None:
-            raise error.ConfigurationError("No acl configuration specified! You need to define a acl_mapping. "
-                                           "For further reference, please see HelpOnStorageConfiguration.")
+            raise error.ConfigurationError(
+                "No acl configuration specified! You need to define a acl_mapping. "
+                "For further reference, please see HelpOnStorageConfiguration.")
 
         if self.secrets is None:  # admin did not setup a real secret
-            raise error.ConfigurationError("No secret configured! You need to set secrets = 'somelongsecretstring' in your wiki config.")
+            raise error.ConfigurationError(
+                "No secret configured! You need to set secrets = 'somelongsecretstring' in your wiki config.")
 
         if self.interwikiname is None:  # admin did not setup a real interwikiname
-            raise error.ConfigurationError("No interwikiname configured! You need to set interwikiname = u'YourUniqueStableInterwikiName' in your wiki config.")
+            raise error.ConfigurationError(
+                "No interwikiname configured! "
+                "You need to set interwikiname = u'YourUniqueStableInterwikiName' in your wiki config.")
 
         secret_key_names = ['security/ticket', ]
         if self.textchas:
@@ -138,8 +144,9 @@
         secret_min_length = 10
         if isinstance(self.secrets, str):
             if len(self.secrets) < secret_min_length:
-                raise error.ConfigurationError("The secrets = '...' wiki config setting is a way too short string (minimum length is {0} chars)!".format(
-                    secret_min_length))
+                raise error.ConfigurationError(
+                    "The secrets = '...' wiki config setting is a way too short string "
+                    "(minimum length is {0} chars)!".format(secret_min_length))
             # for lazy people: set all required secrets to same value
             secrets = {}
             for key in secret_key_names:
@@ -153,7 +160,8 @@
                 if len(secret) < secret_min_length:
                     raise ValueError
             except (KeyError, ValueError):
-                raise error.ConfigurationError("You must set a (at least {0} chars long) secret string for secrets['{1}']!".format(
+                raise error.ConfigurationError(
+                    "You must set a (at least {0} chars long) secret string for secrets['{1}']!".format(
                     secret_min_length, secret_key_name))
 
         from passlib.context import CryptContext
@@ -174,7 +182,7 @@
         unknown = ['"{0}"'.format(name) for name in dir(self)
                   if not name.startswith('_') and
                   name not in DefaultConfig.__dict__ and
-                  not isinstance(getattr(self, name), (type(sys), type(DefaultConfig)))]
+                  not isinstance(getattr(self, name), (type(re), type(DefaultConfig)))]
         if unknown:
             msg = """
 Unknown configuration options: {0}.
@@ -276,9 +284,9 @@
        username_lower in password_lower or password_lower in username_lower:
         return _("Password is too easy to guess (password contains name or name contains password).")
 
-    keyboards = (ur"`1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./", # US kbd
-                 ur"^1234567890ß´qwertzuiopü+asdfghjklöä#yxcvbnm,.-", # german kbd
-                ) # add more keyboards!
+    keyboards = (ur"`1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./",  # US kbd
+                 ur"^1234567890ß´qwertzuiopü+asdfghjklöä#yxcvbnm,.-",  # german kbd
+                )  # TODO add more keyboards!
     for kbd in keyboards:
         rev_kbd = kbd[::-1]
         if password in kbd or password in rev_kbd or \
@@ -490,11 +498,11 @@
             # XXX PageCopiedEvent.__name__
             # XXX PageRevertedEvent.__name__
         ],
-        theme_name=None, # None -> use cfg.theme_default
+        theme_name=None,  # None -> use cfg.theme_default
         edit_rows=0,
         results_per_page=0,
-        locale=None, # None -> do browser language detection, otherwise just use this locale
-        timezone=None, # None -> use cfg.timezone_default
+        locale=None,  # None -> do browser language detection, otherwise just use this locale
+        timezone=None,  # None -> use cfg.timezone_default
       ),
      'Default attributes of the user object'),
   )),
@@ -526,8 +534,8 @@
     ('refresh', None,
      "refresh = (minimum_delay_s, targets_allowed) enables use of `#refresh 5 PageName` processing instruction, targets_allowed must be either `'internal'` or `'external'`"),
 
-    ('siteid', 'MoinMoin', None), # XXX just default to some existing module name to
-                                  # make plugin loader etc. work for now
+    ('siteid', 'MoinMoin', None),  # XXX just default to some existing module name to
+                                   # make plugin loader etc. work for now
   )),
 }
 
@@ -597,6 +605,7 @@
     )),
 }
 
+
 def _add_options_to_defconfig(opts, addgroup=True):
     for groupname in opts:
         group_short, group_doc, group_opts = opts[groupname]
--- a/MoinMoin/conftest.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/conftest.py	Mon Feb 11 04:49:04 2013 +0100
@@ -20,8 +20,8 @@
 
 # exclude some directories from py.test test discovery, pathes relative to this file
 collect_ignore = ['static',  # same
-                  '../wiki', # no tests there
-                  '../instance', # tw likes to use this for wiki data (non-revisioned)
+                  '../wiki',  # no tests there
+                  '../instance',  # tw likes to use this for wiki data (non-revisioned)
                  ]
 import atexit
 import os
@@ -50,10 +50,10 @@
         namespace_mapping=namespace_mapping,
         backend_mapping=backend_mapping,
         acl_mapping=acl_mapping,
-        create_storage=True, # create a fresh storage at each app start
-        destroy_storage=True, # kill all storage contents at app shutdown
-        create_index=True, # create a fresh index at each app start
-        destroy_index=True, # kill index contents at app shutdown
+        create_storage=True,  # create a fresh storage at each app start
+        destroy_storage=True,  # kill all storage contents at app shutdown
+        create_index=True,  # create a fresh index at each app start
+        destroy_index=True,  # kill index contents at app shutdown
     )
     app = create_app_ext(flask_config_dict=dict(SECRET_KEY='foobarfoobar'),
                          moin_config_class=given_config,
@@ -63,6 +63,7 @@
     before_wiki()
     return app, ctx
 
+
 def deinit_test_app(app, ctx):
     teardown_wiki('')
     ctx.pop()
@@ -74,6 +75,7 @@
 prev_ctx = None
 prev_cfg = None
 
+
 class MoinTestFunction(pytest.collect.Function):
     def setup(self):
         global prev_app, prev_ctx, prev_cfg
@@ -109,10 +111,12 @@
 def pytest_pycollect_makemodule(path, parent):
     return Module(path, parent=parent)
 
+
 def pytest_pycollect_makeitem(__multicall__, collector, name, obj):
     if collector.funcnamefilter(name) and inspect.isfunction(obj):
         return MoinTestFunction(name, parent=collector)
 
+
 def pytest_pyfunc_call(pyfuncitem):
     """hook to intercept generators and run them as a single test items"""
     if inspect.isgeneratorfunction(pyfuncitem.obj):
@@ -120,9 +124,11 @@
             kwarg = item[1:]
             item[0](*kwarg)
 
+
 def pytest_report_header(config):
     return "The tests here are implemented only for pytest-2"
 
+
 class Module(pytest.collect.Module):
     def run(self, *args, **kwargs):
         if coverage is not None:
--- a/MoinMoin/constants/forms.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/constants/forms.py	Mon Feb 11 04:49:04 2013 +0100
@@ -7,7 +7,7 @@
 
 # Widget types
 
-WIDGET_TEXT = u'text' # single-line text
+WIDGET_TEXT = u'text'  # single-line text
 WIDGET_MULTILINE_TEXT = u'multiline_text'
 WIDGET_URL = u'url'
 WIDGET_EMAIL = u'email'
--- a/MoinMoin/constants/keys.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/constants/keys.py	Mon Feb 11 04:49:04 2013 +0100
@@ -53,7 +53,7 @@
 # data. meta[HASH_ALGORITHM] = hash(rev_data, HASH_ALGORITHM)
 # some backends may use this also for other purposes.
 HASH_ALGORITHM = 'sha1'
-HASH_LEN = 40 # length of hex str representation of hash value
+HASH_LEN = 40  # length of hex str representation of hash value
 
 # some field names for whoosh index schema / documents in index:
 NAME_EXACT = "name_exact"
--- a/MoinMoin/constants/tools/chartypes_create.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/constants/tools/chartypes_create.py	Mon Feb 11 04:49:04 2013 +0100
@@ -25,7 +25,7 @@
             space.append(str)
 
     chars_upper = u''.join(uppercase)
-    chars_lower = u''.join(lowercase+digits)
+    chars_lower = u''.join(lowercase + digits)
     chars_digits = u''.join(digits)
     chars_spaces = u''.join(space)
 
--- a/MoinMoin/converter/_args_wiki.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/_args_wiki.py	Mon Feb 11 04:49:04 2013 +0100
@@ -32,6 +32,7 @@
 '''
 _parse_re = re.compile(_parse_rules, re.X)
 
+
 def parse(input):
     """
     Parse <input> for positional and keyword arguments, with value quoting and
@@ -57,6 +58,7 @@
 _unparse_rules = r'''^[-\w]+$'''
 _unparse_re = re.compile(_unparse_rules, re.X)
 
+
 def unparse(args):
     """
     Generate a argument string from a Argument instance <args>.
--- a/MoinMoin/converter/_table.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/_table.py	Mon Feb 11 04:49:04 2013 +0100
@@ -13,6 +13,7 @@
 
 WORDBREAK_LEN = 30
 
+
 class TableMixin(object):
     """
     Mixin to support building a DOM table.
--- a/MoinMoin/converter/_util.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/_util.py	Mon Feb 11 04:49:04 2013 +0100
@@ -17,10 +17,12 @@
 from MoinMoin.util.mime import Type
 from MoinMoin.util.tree import html, moin_page
 
+
 def allowed_uri_scheme(uri):
     parsed = Iri(uri)
     return not parsed.scheme or parsed.scheme in URI_SCHEMES
 
+
 def decode_data(data, contenttype=None):
     """
     read and decode data, return unicode text
@@ -42,7 +44,8 @@
             coding = ct.parameters.get('charset', coding)
         data = data.decode(coding)
     if not isinstance(data, unicode):
-        raise TypeError("data must be rev or str (requires contenttype with charset) or unicode, but we got {0!r}".format(data))
+        raise TypeError("data must be rev or str (requires contenttype with charset) or unicode, "
+                        "but we got {0!r}".format(data))
     return data
 
 
@@ -119,7 +122,8 @@
         """
         if request.user_agent and flaskg.user.edit_on_doubleclick:
             # this is not py.test and user has option to edit on doubleclick
-            # TODO: move the 2 lines above and 2 related import statements outside of the converters (needed for standalone converter)
+            # TODO: move the 2 lines above and 2 related import statements outside of the converters
+            # (this is needed for a standalone converter)
             if self.last_lineno != self.iter_content.lineno:
                 # avoid adding same lineno to parent and multiple children or grand-children
                 elem.attrib[html.data_lineno] = self.iter_content.lineno
--- a/MoinMoin/converter/_wiki_macro.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/_wiki_macro.py	Mon Feb 11 04:49:04 2013 +0100
@@ -16,6 +16,7 @@
 from MoinMoin.util.mime import Type
 from MoinMoin.util.tree import moin_page, xinclude
 
+
 class ConverterMacro(object):
     def _BR_repl(self, args, text, context_block):
         if context_block:
@@ -42,8 +43,8 @@
             return text
 
         pagename = args[0]
-        heading = None # TODO
-        level = None # TODO
+        heading = None  # TODO
+        level = None  # TODO
         sort = 'sort' in args and args['sort']
         if sort and sort not in ('ascending', 'descending'):
             raise RuntimeError
--- a/MoinMoin/converter/archive_in.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/archive_in.py	Mon Feb 11 04:49:04 2013 +0100
@@ -27,6 +27,7 @@
     exception class used in case of trouble with opening/listing an archive
     """
 
+
 class ArchiveConverter(TableMixin):
     """
     Base class for archive converters, convert an archive to a DOM table
@@ -39,7 +40,8 @@
     def process_name(self, member_name):
         name = unicode(member_name, 'utf-8')
         attrib = {
-            xlink.href: Iri(scheme='wiki', authority='', path='/'+self.item_name, query=u'do=get&member={0}'.format(name)),
+            xlink.href: Iri(scheme='wiki', authority='', path='/' + self.item_name,
+                            query=u'do=get&member={0}'.format(name)),
         }
         return moin_page.a(attrib=attrib, children=[name, ])
 
@@ -113,7 +115,7 @@
                     # display only normal files, not directories
                     rows.append((
                         zinfo.file_size,
-                        datetime(*zinfo.date_time), # y,m,d,h,m,s
+                        datetime(*zinfo.date_time),  # y,m,d,h,m,s
                         zinfo.filename,
                     ))
             return rows
--- a/MoinMoin/converter/audio_video_in.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/audio_video_in.py	Mon Feb 11 04:49:04 2013 +0100
@@ -31,7 +31,8 @@
         item_name = rev.item.name
         attrib = {
             moin_page.type_: unicode(self.input_type),
-            xlink.href: Iri(scheme='wiki', authority='', path='/'+item_name, query='do=get&rev={0}'.format(rev.revid)),
+            xlink.href: Iri(scheme='wiki', authority='', path='/' + item_name,
+                            query='do=get&rev={0}'.format(rev.revid)),
         }
         obj = moin_page.object_(attrib=attrib, children=[u'Your Browser does not support HTML5 audio/video element.', ])
         body = moin_page.body(children=(obj, ))
--- a/MoinMoin/converter/creole_in.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/creole_in.py	Mon Feb 11 04:49:04 2013 +0100
@@ -330,9 +330,9 @@
         """Handle all kinds of links."""
 
         if link_page is not None:
-            att = 'attachment:' # moin 1.9 needed this for an attached file
+            att = 'attachment:'  # moin 1.9 needed this for an attached file
             if link_page.startswith(att):
-                link_page = '/' + link_page[len(att):] # now we have a subitem
+                link_page = '/' + link_page[len(att):]  # now we have a subitem
             target = unicode(Iri(scheme='wiki.local', path=link_page))
             text = link_page
         else:
@@ -406,9 +406,9 @@
         """Handles objects included in the page."""
 
         if object_page is not None:
-            att = 'attachment:' # moin 1.9 needed this for an attached file
+            att = 'attachment:'  # moin 1.9 needed this for an attached file
             if object_page.startswith(att):
-                object_page = '/' + object_page[len(att):] # now we have a subitem
+                object_page = '/' + object_page[len(att):]  # now we have a subitem
             target = Iri(scheme='wiki.local', path=object_page)
             text = object_page
 
--- a/MoinMoin/converter/docbook_in.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/docbook_in.py	Mon Feb 11 04:49:04 2013 +0100
@@ -32,6 +32,7 @@
 class NameSpaceError(Exception):
     pass
 
+
 class Converter(object):
     """
     Converter application/docbook+xml -> x.moin.document
@@ -43,7 +44,7 @@
 
     # DocBook elements which are completely ignored by our converter
     # We even do not process children of these elements
-    ignored_tags = set([# Info elements
+    ignored_tags = set([  # Info elements
                        'abstract', 'artpagenums', 'annotation',
                        'artpagenums', 'author', 'authorgroup',
                        'authorinitials', 'bibliocoverage', 'biblioid',
@@ -383,15 +384,15 @@
         for child in element:
             if isinstance(child, ET.Element):
                 if child.tag.name in self.media_tags:
-                    #XXX: Check the spec to be sure that object tag have only one child.
-                    #TODO: Better way to do it
+                    # XXX: Check the spec to be sure that object tag have only one child.
+                    # TODO: Better way to do it
                     prefered_format, data_tag, mimetype = self.media_tags[child.tag.name]
                     object_element = child
                     for grand_child in child:
                         if isinstance(grand_child, ET.Element):
                             object_data.append(grand_child)
                 if child.tag.name == 'caption':
-                    caption = self.do_children(child, depth+1)[0]
+                    caption = self.do_children(child, depth + 1)[0]
                 if child.tag.name == 'textobject':
                     text_object = child
         return self.visit_data_element(object_element, depth, object_data,
@@ -410,7 +411,7 @@
             if not text_object:
                 return
             else:
-                children = self.do_children(child, depth+1)[0]
+                children = self.do_children(child, depth + 1)[0]
                 return self.new(moin_page.p, attrib={},
                                 children=children)
         # We try to determine the best object to show
@@ -430,7 +431,7 @@
         # If we could not find any suitable object, we return
         # the text replacement.
         if not object_to_show:
-            children = self.do_children(child, depth+1)[0]
+            children = self.do_children(child, depth + 1)[0]
             return self.new(moin_page.p, attrib={},
                             children=children)
 
@@ -488,9 +489,9 @@
         for child in element:
             if isinstance(child, ET.Element):
                 if child.tag.name == "attribution":
-                    source = self.do_children(child, depth+1)
+                    source = self.do_children(child, depth + 1)
                 else:
-                    children.extend(self.do_children(child, depth+1))
+                    children.extend(self.do_children(child, depth + 1))
             else:
                 children.append(child)
         attrib = {}
@@ -555,7 +556,7 @@
             #XXX: Improve error
             raise SyntaxError("para child missing for formalpara element")
 
-        children = self.do_children(para_element, depth+1)[0]
+        children = self.do_children(para_element, depth + 1)[0]
         attrib = {}
         attrib[html('title')] = title_element[0]
         return self.new(moin_page.p, attrib=attrib, children=children)
--- a/MoinMoin/converter/everything.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/everything.py	Mon Feb 11 04:49:04 2013 +0100
@@ -25,7 +25,8 @@
     def __call__(self, rev, contenttype=None, arguments=None):
         item_name = rev.item.name
         attrib = {
-            xlink.href: Iri(scheme='wiki', authority='', path='/'+item_name, query='do=get&rev={0}'.format(rev.revid)),
+            xlink.href: Iri(scheme='wiki', authority='', path='/' + item_name,
+                            query='do=get&rev={0}'.format(rev.revid)),
         }
         a = moin_page.a(attrib=attrib, children=[u"Download {0}.".format(item_name)])
         body = moin_page.body(children=(a, ))
--- a/MoinMoin/converter/html_in.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/html_in.py	Mon Feb 11 04:49:04 2013 +0100
@@ -42,7 +42,7 @@
     list_tags = set(['ul', 'dir', 'ol'])
 
     # HTML tags which can be convert without attributes in a different DOM tag
-    simple_tags = {# Emphasis
+    simple_tags = {  # Emphasis
                    'em': moin_page.emphasis, 'i': moin_page.emphasis,
                    # Strong
                    'b': moin_page.strong, 'strong': moin_page.strong,
--- a/MoinMoin/converter/html_out.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/html_out.py	Mon Feb 11 04:49:04 2013 +0100
@@ -34,6 +34,7 @@
         return re.sub(r'\+get/\+[0-9a-fA-F]+/', '', href)
     return href
 
+
 def mark_item_as_transclusion(elem, href):
     """
     Return elem after adding a "moin-transclusion" class and a "data-href" attribute with
@@ -86,7 +87,7 @@
     visit_style = Attribute('style')
     visit_title = Attribute('title')
     visit_id = Attribute('id')
-    visit_type = Attribute('type') # IE8 needs <object... type="image/svg+xml" ...> to display svg images
+    visit_type = Attribute('type')  # IE8 needs <object... type="image/svg+xml" ...> to display svg images
 
     def __init__(self, element):
         self.element = element
@@ -371,7 +372,7 @@
 
         if obj_type == "img":
             # Images have alt text
-            alt = ''.join(unicode(e) for e in elem) # XXX handle non-text e
+            alt = ''.join(unicode(e) for e in elem)  # XXX handle non-text e
             if alt:
                 attrib[html.alt] = alt
             new_elem = html.img(attrib=attrib)
@@ -401,7 +402,8 @@
 
                     if item[0].tag.name in ('object', 'a'):
                         # png, jpg, gif are objects here, will be changed to img when they are processed
-                        # transclusion is a single inline element "My pet {{bird.jpg}} flys." or "[[SomePage|{{Logo.png}}]]"
+                        # transclusion is a single inline element "My pet {{bird.jpg}} flys." or
+                        # "[[SomePage|{{Logo.png}}]]"
                         return self.new_copy(html.span, item, attribs)
 
                     elif item[0].tag.name == 'p':
@@ -725,11 +727,15 @@
         prefixed_id = '%s-%s' % (self._id.get_id('note-placement'), id)
 
         elem_ref = ET.XML("""
-<html:sup xmlns:html="{0}" html:id="note-{1}-ref" html:class="moin-footnote"><html:a html:href="#note-{2}">{3}</html:a></html:sup>
+<html:sup xmlns:html="{0}" html:id="note-{1}-ref" html:class="moin-footnote">
+<html:a html:href="#note-{2}">{3}</html:a>
+</html:sup>
 """.format(html, prefixed_id, prefixed_id, id))
 
         elem_note = ET.XML("""
-<html:p xmlns:html="{0}" html:id="note-{1}"><html:sup><html:a html:href="#note-{2}-ref">{3}</html:a></html:sup></html:p>
+<html:p xmlns:html="{0}" html:id="note-{1}">
+<html:sup><html:a html:href="#note-{2}-ref">{3}</html:a></html:sup>
+</html:p>
 """.format(html, prefixed_id, prefixed_id, id))
 
         elem_note.extend(body)
--- a/MoinMoin/converter/image_in.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/image_in.py	Mon Feb 11 04:49:04 2013 +0100
@@ -29,7 +29,8 @@
         item_name = rev.item.name
         attrib = {
             moin_page.type_: unicode(self.input_type),
-            xlink.href: Iri(scheme='wiki', authority='', path='/'+item_name, query='do=get&rev={0}'.format(rev.revid)),
+            xlink.href: Iri(scheme='wiki', authority='', path='/' + item_name,
+                            query='do=get&rev={0}'.format(rev.revid)),
         }
         obj = moin_page.object_(attrib=attrib, children=[item_name, ])
         body = moin_page.body(children=(obj, ))
--- a/MoinMoin/converter/include.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/include.py	Mon Feb 11 04:49:04 2013 +0100
@@ -85,7 +85,9 @@
 from __future__ import absolute_import, division
 
 from emeraldtree import ElementTree as ET
-import re, types, copy
+import re
+import types
+import copy
 
 from MoinMoin import log
 logging = log.getLogger(__name__)
@@ -106,14 +108,14 @@
 # elements generated by moin wiki markup that cannot have block children
 NO_BLOCK_CHILDREN = [
         'p',
-        'span', # /*comment*/, ~+big+~, ~-small-~ via classes comment, moin-big, moin-small
-        'emphasis', # ''italic''
-        'strong', # '''bold'''
-        'del', # --(stroke)--
-        'ins', # __underline__
-        # 'sub', # ,,subscript,, # no markup allowed within subscripts
-        # 'sup', # ^superscript^ # no markup allowed within superscripts
-        'a', # [[SomeItem|{{logo.png}}]]
+        'span',  # /*comment*/, ~+big+~, ~-small-~ via classes comment, moin-big, moin-small
+        'emphasis',  # ''italic''
+        'strong',  # '''bold'''
+        'del',  # --(stroke)--
+        'ins',  # __underline__
+        # 'sub',  # ,,subscript,, # no markup allowed within subscripts
+        # 'sup',  # ^superscript^ # no markup allowed within superscripts
+        'a',  # [[SomeItem|{{logo.png}}]]
         ]
 
 
@@ -181,6 +183,7 @@
                 data = None
             self.append(self.Entry(''.join(name), None))
 
+
 class Converter(object):
     tag_a = moin_page.a
     tag_div = moin_page.div
@@ -198,7 +201,8 @@
             return cls()
 
     def recurse(self, elem, page_href):
-        # on first call, elem.tag.name=='page'. Descendants (body, div, p, include, page, etc.) are processed by recursing through DOM
+        # on first call, elem.tag.name=='page'.
+        # Descendants (body, div, p, include, page, etc.) are processed by recursing through DOM
 
         # stack is used to detect transclusion loops
         page_href_new = elem.get(self.tag_page_href)
@@ -215,7 +219,8 @@
         try:
             if elem.tag == self.tag_xi_include:
                 # we have already recursed several levels and found a transclusion: "{{SomePage}}" or similar
-                # process the transclusion and add it to the DOM.  Subsequent recursions will traverse through the transclusion's elements.
+                # process the transclusion and add it to the DOM.  Subsequent recursions will traverse through
+                # the transclusion's elements.
                 href = elem.get(self.tag_xi_href)
                 xpointer = elem.get(self.tag_xi_xpointer)
 
@@ -352,7 +357,8 @@
                 #  end of processing for transclusion; the "result" will get inserted into the DOM below
                 return result
 
-            # Traverse the DOM by calling self.recurse with each child of the current elem.  Starting elem.tag.name=='page'.
+            # Traverse the DOM by calling self.recurse with each child of the current elem.
+            # Starting elem.tag.name=='page'.
             container = []
             i = 0
             while i < len(elem):
@@ -370,7 +376,8 @@
                                 # the transcluded item is empty, insert an empty span into DOM
                                 attrib = Attributes(ret).convert()
                                 elem[i] = ET.Element(moin_page.span, attrib=attrib)
-                            elif isinstance(body[0], ET.Node) and (len(body) > 1 or body[0].tag.name not in ('p', 'object', 'a')):
+                            elif (isinstance(body[0], ET.Node) and
+                                  (len(body) > 1 or body[0].tag.name not in ('p', 'object', 'a'))):
                                 # Complex case: "some text {{BlockItem}} more text" or "\n{{BlockItem}}\n" where
                                 # the BlockItem body contains multiple p's, a table, preformatted text, etc.
                                 # These block elements cannot be made a child of the current elem, so we create
@@ -379,30 +386,34 @@
                                 before = copy.deepcopy(elem)
                                 after = copy.deepcopy(elem)
                                 before[:] = elem[0:i]
-                                after[:] = elem[i+1:]
+                                after[:] = elem[i + 1:]
                                 if len(before):
                                     # there are siblings before transclude, save them in container
                                     container.append(before)
                                 new_trans_ptr = len(container)
-                                # get attributes from page node; we expect {class: "moin-transclusion"; data-href: "http://some.org/somepage"}
+                                # get attributes from page node;
+                                # we expect {class: "moin-transclusion"; data-href: "http://some.org/somepage"}
                                 attrib = Attributes(ret).convert()
                                 # make new div node to hold transclusion, copy children, and save in container
                                 div = ET.Element(moin_page.div, attrib=attrib, children=body[:])
-                                container.append(div) # new_trans_ptr is index to this
+                                container.append(div)  # new_trans_ptr is index to this
                                 if len(after):
                                     container.append(after)
                                 if elem.tag.name == 'a':
-                                    # invalid input [[MyPage|{{BlockItem}}]], best option is to retain A-tag and fail html validation
+                                    # invalid input [[MyPage|{{BlockItem}}]],
+                                    # best option is to retain A-tag and fail html validation
                                     # TODO: error may not be obvious to user - add error message
                                     elem[i] = div
                                 else:
-                                    # move up 1 level in recursion where elem becomes the child and is usually replaced by container
+                                    # move up 1 level in recursion where elem becomes the child and
+                                    # is usually replaced by container
                                     return [container, new_trans_ptr]
                             else:
                                 # default action for odd things like circular transclusion error messages
                                 elem[i] = ret
                         elif isinstance(ret, types.ListType):
-                            # a container has been returned. Note: there are two places where a container may be returned
+                            # a container has been returned.
+                            # Note: there are two places where a container may be returned
                             ret_container, trans_ptr = ret
                             # trans_ptr points to the transclusion within ret_container.
                             # Here the transclusion will always contain a block level element
@@ -413,25 +424,29 @@
                                 before = copy.deepcopy(elem)
                                 after = copy.deepcopy(elem)
                                 before[:] = elem[0:i] + ret_container[0:trans_ptr]
-                                after[:] = ret_container[trans_ptr+1:] + elem[i+1:]
+                                after[:] = ret_container[trans_ptr + 1:] + elem[i + 1:]
                                 if len(before):
                                     container.append(before)
                                 new_trans_ptr = len(container)
                                 # child may have classes like "comment" that must be added to transcluded element
                                 classes = child.attrib.get(moin_page.class_, '').split()
-                                classes += ret_container[trans_ptr].attrib.get(html.class_, '').split() # this must be html, not moin_page
-                                ret_container[trans_ptr].attrib[html.class_] = ' '.join(classes) # this must be html, not moin_page
-                                container.append(ret_container[trans_ptr]) # the transclusion
+                                # this must be html, not moin_page:
+                                classes += ret_container[trans_ptr].attrib.get(html.class_, '').split()
+                                # this must be html, not moin_page:
+                                ret_container[trans_ptr].attrib[html.class_] = ' '.join(classes)
+                                container.append(ret_container[trans_ptr])  # the transclusion
                                 if len(after):
                                     container.append(after)
                                 return [container, new_trans_ptr]
                             else:
-                                # elem is a block element, replace child element with the container generated in lower recursion
-                                elem[i:i+1] = ret_container # elem[i] is the child
+                                # elem is a block element,
+                                # replace child element with the container generated in lower recursion
+                                elem[i:i + 1] = ret_container  # elem[i] is the child
                                 # avoid duplicate recursion over nodes already processed
-                                i += len(ret_container) -1
+                                i += len(ret_container) - 1
                         else:
-                            # default action for any ret not fitting special cases above, e.g. tranclusion is within a table cell
+                            # default action for any ret not fitting special cases above,
+                            # e.g. tranclusion is within a table cell
                             elem[i] = ret
                 # we are finished with this child, advance to next sibling
                 i += 1
--- a/MoinMoin/converter/link.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/link.py	Mon Feb 11 04:49:04 2013 +0100
@@ -53,7 +53,7 @@
         """
         Traverses the tree and handles each element appropriately
         """
-        new_page_href=elem.get(__tag_page_href)
+        new_page_href = elem.get(__tag_page_href)
         if new_page_href:
             page = Iri(new_page_href)
 
@@ -129,10 +129,10 @@
                     k, v = kv, ''
                 if k == 'do':
                     do = v
-                    continue # we remove do=xxx from qs
+                    continue  # we remove do=xxx from qs
                 if k == 'rev':
                     rev = v
-                    continue # we remove rev=n from qs
+                    continue  # we remove rev=n from qs
                 result.append(u'{0}={1}'.format(k, v))
         if result:
             query = separator.join(result)
--- a/MoinMoin/converter/markdown_in.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/markdown_in.py	Mon Feb 11 04:49:04 2013 +0100
@@ -25,6 +25,7 @@
 from markdown import Markdown
 import markdown.util as md_util
 
+
 def postproc_text(markdown, text):
     """
     Removes HTML or XML character references and entities from a text string.
@@ -58,10 +59,11 @@
                 text = unichr(htmlentitydefs.name2codepoint[text[1:-1]])
             except KeyError:
                 pass
-        return text # leave as is
+        return text  # leave as is
 
     return re.sub("&#?\w+;", fixup, text)
 
+
 class Converter(object):
     # {{{ html conversion
 
@@ -72,7 +74,7 @@
     list_tags = set(['ul', 'dir', 'ol'])
 
     # HTML tags which can be convert without attributes in a different DOM tag
-    simple_tags = {# Emphasis
+    simple_tags = {  # Emphasis
                    'em': moin_page.emphasis, 'i': moin_page.emphasis,
                    # Strong
                    'b': moin_page.strong, 'strong': moin_page.strong,
--- a/MoinMoin/converter/mediawiki_in.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/mediawiki_in.py	Mon Feb 11 04:49:04 2013 +0100
@@ -336,7 +336,7 @@
                 # TODO: definition list doesn't work,
                 #       if definition of the term on the next line
                 splited_text = text.split(':')
-                list_definition_text=splited_text.pop(0)
+                list_definition_text = splited_text.pop(0)
                 text = ':'.join(splited_text)
 
                 self.parse_inline(list_definition_text, new_stack, self.inline_re)
@@ -483,7 +483,8 @@
         )
     """
 
-    def inline_footnote_repl(self, stack, footnote, footnote_begin=None, footnote_text=None, footnote_end=None, footnote_start=None):
+    def inline_footnote_repl(self, stack, footnote,
+                             footnote_begin=None, footnote_text=None, footnote_end=None, footnote_start=None):
         #stack.top_check('emphasis'):
         if footnote_begin is not None:
             stack.push(moin_page.note(attrib={moin_page.note_class: 'footnote'}))
@@ -924,7 +925,8 @@
                                     close_tag = self.Preprocessor_tag()
                                     while tag_name != close_tag.tag_name:
                                         close_tag = tags.pop()
-                                        tmp_line = '<{0}>{1}{2}</{3}>'.format(close_tag.tag, ''.join(close_tag.text), tmp_line, close_tag.tag_name)
+                                        tmp_line = '<{0}>{1}{2}</{3}>'.format(
+                                            close_tag.tag, ''.join(close_tag.text), tmp_line, close_tag.tag_name)
                                         if not len(tags):
                                             post_line.append(tmp_line)
                                         else:
--- a/MoinMoin/converter/moinwiki19_in.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/moinwiki19_in.py	Mon Feb 11 04:49:04 2013 +0100
@@ -44,7 +44,7 @@
           )
           \:
           (?P<freelink_interwiki_page>
-           (?=\S*[%(u)s%(l)s0..9]\S* )  # make sure there is something non-blank with at least one alphanum letter following
+           (?=\S*[%(u)s%(l)s0..9]\S* )  # make sure there is something non-blank with at >= 1 alphanum letter following
            [^\s"\'}\]|:,.\)?!]+  # we take all until we hit some blank or punctuation char ...
           )
           |
--- a/MoinMoin/converter/moinwiki_in.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/moinwiki_in.py	Mon Feb 11 04:49:04 2013 +0100
@@ -718,14 +718,14 @@
                 # assume local language uses ":" inside of words, set link_item and continue
                 link_item = '{0}:{1}'.format(link_interwiki_site, link_interwiki_item)
         if link_args:
-            link_args = parse_arguments(link_args) # XXX needs different parsing
+            link_args = parse_arguments(link_args)  # XXX needs different parsing
             query = url_encode(link_args.keyword, charset=CHARSET, encode_keys=True)
         else:
             query = None
         if link_item is not None:
-            att = 'attachment:' # moin 1.9 needed this for an attached file
+            att = 'attachment:'  # moin 1.9 needed this for an attached file
             if link_item.startswith(att):
-                link_item = '/' + link_item[len(att):] # now we have a subitem
+                link_item = '/' + link_item[len(att):]  # now we have a subitem
             if '#' in link_item:
                 path, fragment = link_item.rsplit('#', 1)
             else:
@@ -830,14 +830,14 @@
                            object_text=None, object_args=None):
         """Handles objects included in the page."""
         if object_args:
-            args = parse_arguments(object_args).keyword # XXX needs different parsing
+            args = parse_arguments(object_args).keyword  # XXX needs different parsing
         else:
             args = {}
         if object_item is not None:
             query = url_encode(args, charset=CHARSET, encode_keys=True)
-            att = 'attachment:' # moin 1.9 needed this for an attached file
+            att = 'attachment:'  # moin 1.9 needed this for an attached file
             if object_item.startswith(att):
-                object_item = '/' + object_item[len(att):] # now we have a subitem
+                object_item = '/' + object_item[len(att):]  # now we have a subitem
             target = Iri(scheme='wiki.local', path=object_item, query=query, fragment=None)
             text = object_item
 
@@ -950,7 +950,8 @@
                     cell_markup = cell_markup.split('<')[1]
                     msg1 = _('Error:')
                     msg2 = _('is invalid within')
-                    cell_text = '[ {0} "{1}" {2} <{3}>&nbsp;]<<BR>>{4}'.format(msg1, error, msg2, cell_markup, cell_text)
+                    cell_text = '[ {0} "{1}" {2} <{3}>&nbsp;]<<BR>>{4}'.format(
+                        msg1, error, msg2, cell_markup, cell_text)
                     if no_errors:
                         add_attr_to_style(element.attrib, 'background-color: pink; color: black;')
                     no_errors = False
--- a/MoinMoin/converter/moinwiki_out.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/moinwiki_out.py	Mon Feb 11 04:49:04 2013 +0100
@@ -29,8 +29,8 @@
     a_open = u'[['
     a_separator = u'|'
     a_close = u']]'
-    verbatim_open = u'{' # * 3
-    verbatim_close = u'}'# * 3
+    verbatim_open = u'{'  # * 3
+    verbatim_close = u'}'  # * 3
     monospace = u'`'
     strong = u"'''"
     emphasis = u"''"
@@ -182,7 +182,7 @@
         args = u''
         if len(href) > 1:
             # With normal
-            args = u','.join([u'&'+s for s in findall(r'(?:^|;|,|&|)(\w+=\w+)(?:,|&|$|)', href[1])])
+            args = u','.join([u'&' + s for s in findall(r'(?:^|;|,|&|)(\w+=\w+)(?:,|&|$|)', href[1])])
         href = href[0].split(u'wiki.local:')[-1]
         args = u','.join(s for s in [args, params] if s)
 
@@ -204,7 +204,8 @@
         for s in findall(r'}+', text):
             if max_subpage_lvl <= len(s):
                 max_subpage_lvl = len(s) + 1
-        ret = u'{0}\n{1}\n{2}\n'.format(Moinwiki.verbatim_open * max_subpage_lvl, text, Moinwiki.verbatim_close * max_subpage_lvl)
+        ret = u'{0}\n{1}\n{2}\n'.format(
+            Moinwiki.verbatim_open * max_subpage_lvl, text, Moinwiki.verbatim_close * max_subpage_lvl)
         return ret
 
     def open_moinpage_code(self, elem):
@@ -268,7 +269,8 @@
         if self.list_item_labels[-1] == u'' or self.list_item_labels[-1] == Moinwiki.definition_list_marker:
             self.list_item_labels[-1] = Moinwiki.definition_list_marker
             self.list_item_label = self.list_item_labels[-1] + u' '
-            ret = u' ' * (len(u''.join(self.list_item_labels[:-1])) + len(self.list_item_labels[:-1]))# self.list_level
+            ret = u' ' * (len(u''.join(self.list_item_labels[:-1])) +
+                          len(self.list_item_labels[:-1]))  # self.list_level
             if self.last_closed:
                 ret = u'\n{0}'.format(ret)
         childrens_output = self.open_children(elem)
@@ -278,7 +280,8 @@
         ret = u''
         if self.last_closed:
             ret = u'\n'
-        ret += u' ' * (len(u''.join(self.list_item_labels[:-1])) + len(self.list_item_labels[:-1])) + self.list_item_label
+        ret += u' ' * (len(u''.join(self.list_item_labels[:-1])) +
+                       len(self.list_item_labels[:-1])) + self.list_item_label
         return ret + self.open_children(elem)
 
     def open_moinpage_note(self, elem):
@@ -300,7 +303,7 @@
         href = href.split(u'?')
         args = u''
         if len(href) > 1:
-            args =u' '.join([s for s in findall(r'(?:^|;|,|&|)(\w+=\w+)(?:,|&|$)', href[1]) if s[:3] != u'do='])
+            args = u' '.join([s for s in findall(r'(?:^|;|,|&|)(\w+=\w+)(?:,|&|$)', href[1]) if s[:3] != u'do='])
         href = href[0].split(u'wiki.local:')[-1]
         # TODO: add '|' to Moinwiki class and rewrite this using % formatting
         ret = Moinwiki.object_open
@@ -354,7 +357,10 @@
             for s in findall(r'}+', childrens_output):
                 if max_subpage_lvl <= len(s):
                     max_subpage_lvl = len(s) + 1
-            return u'{0}{1}{2}{3}\n'.format(Moinwiki.verbatim_open * max_subpage_lvl, ret, childrens_output, Moinwiki.verbatim_close * max_subpage_lvl)
+            return u'{0}{1}{2}{3}\n'.format(
+                Moinwiki.verbatim_open * max_subpage_lvl,
+                ret, childrens_output,
+                Moinwiki.verbatim_close * max_subpage_lvl)
 
         self.status.append('text')
         childrens_output = self.open_children(elem)
@@ -377,7 +383,9 @@
         if len(type) == 2:
             if type[0] == "x-moin/macro":
                 if len(elem) and iter(elem).next().tag.name == "arguments":
-                    return u"<<{0}({1})>>\n".format(type[1].split(u'=')[1], u','.join([u''.join(c.itertext()) for c in iter(elem).next() if c.tag.name == u"argument"]))
+                    return u"<<{0}({1})>>\n".format(
+                        type[1].split(u'=')[1],
+                        u','.join([u''.join(c.itertext()) for c in iter(elem).next() if c.tag.name == u"argument"]))
                 else:
                     return u"<<{0}()>>\n".format(type[1].split(u'=')[1])
             elif type[0] == "x-moin/format":
@@ -502,7 +510,7 @@
         if table_cellstyle:
             attrib.append(u'style="{0}"'.format(table_cellstyle))
         if number_rows_spanned:
-            attrib.append(u'|'+unicode(number_rows_spanned))
+            attrib.append(u'|' + unicode(number_rows_spanned))
 
         attrib = u' '.join(attrib)
 
--- a/MoinMoin/converter/nonexistent_in.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/nonexistent_in.py	Mon Feb 11 04:49:04 2013 +0100
@@ -27,7 +27,7 @@
     def __call__(self, rev, contenttype=None, arguments=None):
         item_name = rev.item.name
         attrib = {
-            xlink.href: Iri(scheme='wiki', authority='', path='/'+item_name, query='do=modify'),
+            xlink.href: Iri(scheme='wiki', authority='', path='/' + item_name, query='do=modify'),
         }
         a = moin_page.a(attrib=attrib, children=[_("%(item_name)s does not exist. Create it?", item_name=item_name)])
         body = moin_page.body(children=(a, ))
--- a/MoinMoin/converter/pdf_in.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/pdf_in.py	Mon Feb 11 04:49:04 2013 +0100
@@ -20,7 +20,8 @@
 
 
 LAPARAMS = LAParams(
-    # value is specified not as an actual length, but as a proportion of the length to the size of each character in question.
+    # value is specified not as an actual length, but as a proportion of the length to the
+    # size of each character in question.
     # two text chunks whose distance is closer than the char_margin is considered
     # continuous and get grouped into one.
     char_margin=0.3,
--- a/MoinMoin/converter/pygments_in.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/pygments_in.py	Mon Feb 11 04:49:04 2013 +0100
@@ -97,7 +97,8 @@
             """
             if lexer is None and contenttype is not None:
                 ct = Type(contenttype)
-                mimetype = '{0}/{1}'.format(ct.type, ct.subtype) # pygments can't process parameters (like e.g. ...;charset=utf-8)
+                # pygments can't process parameters (like e.g. ...;charset=utf-8):
+                mimetype = '{0}/{1}'.format(ct.type, ct.subtype)
                 try:
                     lexer = pygments.lexers.get_lexer_for_mimetype(mimetype)
                 except pygments.util.ClassNotFound:
--- a/MoinMoin/converter/rst_in.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/rst_in.py	Mon Feb 11 04:49:04 2013 +0100
@@ -235,10 +235,10 @@
         new_element = moin_page.table_cell()
         if 'morerows' in node.attributes:
             new_element.set(moin_page.number_rows_spanned,
-                            repr(int(node['morerows'])+1))
+                            repr(int(node['morerows']) + 1))
         if 'morecols' in node.attributes:
             new_element.set(moin_page.number_cols_spanned,
-                            repr(int(node['morecols'])+1))
+                            repr(int(node['morecols']) + 1))
         self.open_moin_page_node(new_element)
 
     def depart_entry(self, node):
@@ -400,7 +400,9 @@
             for name, value in named_args:
                 args.append(moin_page.argument(attrib={moin_page.name: name}, children=[value]))
             arguments = moin_page.arguments(children=args)
-            self.open_moin_page_node(moin_page.part(children=[arguments], attrib={moin_page.content_type: "x-moin/format;name={0}".format(parser.split(' ')[0])}))
+            self.open_moin_page_node(moin_page.part(children=[arguments],
+                                                    attrib={moin_page.content_type:
+                                                                "x-moin/format;name={0}".format(parser.split(' ')[0])}))
         else:
             self.open_moin_page_node(moin_page.blockcode())
 
@@ -430,7 +432,7 @@
 
     def visit_reference(self, node):
         refuri = node.get('refuri', u'')
-        if refuri.startswith(u'<<') and refuri.endswith(u'>>'): # moin macro
+        if refuri.startswith(u'<<') and refuri.endswith(u'>>'):  # moin macro
             macro_name = refuri[2:-2].split(u'(')[0]
             if macro_name == u"TableOfContents":
                 arguments = refuri[2:-2].split(u'(')[1][:-1].split(u',')
@@ -761,12 +763,21 @@
             try:
                 docutils_tree = core.publish_doctree(source=input)
             except utils.SystemMessage as inst:
-                string_numb = re.match(re.compile(r'<string>\:([0-9]*)\:\s*\(.*?\)\s*(.*)', re.X | re.U | re.M | re.S), str(inst))
+                string_numb = re.match(re.compile(r'<string>\:([0-9]*)\:\s*\(.*?\)\s*(.*)',
+                                                  re.X | re.U | re.M | re.S), str(inst))
                 if string_numb:
                     str_num = string_numb.group(1)
                     input = input.split('\n')
                     if str_num:
-                        input = ['.. error::\n ::\n\n  Parse error on line number {0}:\n\n  {1}\n\n  Go back and try fix that.\n\n'.format(str_num, string_numb.group(2).replace('\n', '\n  '))]
+                        input = [('.. error::\n'
+                                  ' ::\n'
+                                  '\n'
+                                  '  Parse error on line number {0}:\n'
+                                  '\n'
+                                  '  {1}\n'
+                                  '\n'
+                                  '  Go back and try fix that.\n'
+                                  '\n').format(str_num, string_numb.group(2).replace('\n', '\n  '))]
                         continue
                 else:
                     input = ['.. error::\n ::\n\n  {0}\n\n'.format(str(inst).replace('\n', '\n  '))]
--- a/MoinMoin/converter/rst_out.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/rst_out.py	Mon Feb 11 04:49:04 2013 +0100
@@ -92,8 +92,8 @@
         if cs < 1 or rs < 1:
             return
         self.table[-1].append((cs, rs, cell))
-        for i in range(cs-1):
-            self.table[-1].append((cs-i-1, rs, Cell('')))
+        for i in range(cs - 1):
+            self.table[-1].append((cs - i - 1, rs, Cell('')))
         self.j += cs
         if self.i > 0:
             if len(self.table[-2]) > self.j:
@@ -166,7 +166,7 @@
             line = [u'+']
             row = self.table[0]
             for col in range(len(cols)):
-                line.append(u'-'*cols[col])
+                line.append(u'-' * cols[col])
                 if self.table[0][col][0] > 1:
                     line.append(u'-')
                 else:
@@ -192,11 +192,11 @@
                 line = [u'+']
                 for col in range(len(cols)):
                     if self.table[row][col][1] > 1:
-                        line.append(u' '*cols[col])
+                        line.append(u' ' * cols[col])
                     elif row == self.header_count - 1:
-                        line.append(u'='*cols[col])
+                        line.append(u'=' * cols[col])
                     else:
-                        line.append(u'-'*cols[col])
+                        line.append(u'-' * cols[col])
                     if self.table[row][col][0] > 1:
                         if row + 1 < len(rows)\
                                 and self.table[row + 1][col][0] > 1\
@@ -334,7 +334,8 @@
                         childrens_output.append(u'\n\n')
                 elif self.status[-1] == "list":
                     child =\
-                        re.sub(r"\n(.)", lambda m: u"\n{0}{1}".format(u' '*(len(u''.join(self.list_item_labels)) + len(self.list_item_labels)), m.group(1)), child)
+                        re.sub(r"\n(.)", lambda m: u"\n{0}{1}".format(u' ' *
+                            (len(u''.join(self.list_item_labels)) + len(self.list_item_labels)), m.group(1)), child)
                     if self.last_closed == "p":
                         childrens_output.append(u'\n'
                                 + u' '
@@ -346,7 +347,8 @@
                         childrens_output.append(u'\n')
                 elif self.status[-2] == "list":
                     child =\
-                        re.sub(r"\n(.)", lambda m: u"\n{0}{1}".format(u' '*(len(u''.join(self.list_item_labels)) + len(self.list_item_labels)), m.group(1)), child)
+                        re.sub(r"\n(.)", lambda m: u"\n{0}{1}".format(u' ' *
+                            (len(u''.join(self.list_item_labels)) + len(self.list_item_labels)), m.group(1)), child)
                 childrens_output.append(child)
                 self.last_closed = 'text'
         self.delete_newlines = delete_newlines
@@ -408,7 +410,8 @@
                 if i:
                     self.output[-1] = self.output[-1][:i]
             """
-        return u"::\n\n  {0}{1}\n\n".format(u' ' * (len(u''.join(self.list_item_labels)) + len(self.list_item_labels)), text)
+        return u"::\n\n  {0}{1}\n\n".format(u' ' *
+                    (len(u''.join(self.list_item_labels)) + len(self.list_item_labels)), text)
 
     def open_moinpage_code(self, elem):
         ret = u"{0}{1}{2}".format(ReST.monospace, u''.join(elem.itertext()), ReST.monospace)
@@ -510,8 +513,7 @@
         href = href.split(u'?')
         args = u''
         if len(href) > 1:
-            args =[s for s in re.findall(r'(?:^|;|,|&|)(\w+=\w+)(?:,|&|$)',
-                                            href[1]) if s[:3] != u'do=']
+            args = [s for s in re.findall(r'(?:^|;|,|&|)(\w+=\w+)(?:,|&|$)', href[1]) if s[:3] != u'do=']
         href = href[0]
         alt = elem.get(moin_page.alt, u'')
         if not alt:
@@ -520,7 +522,8 @@
             ret = u'|{0}|'.format(alt)
         args_text = u''
         if args:
-            args_text = u"\n  {0}".format(u'\n  '.join(u':{0}: {1}'.format(arg.split(u'=')[0], arg.split(u'=')[1]) for arg in args))
+            args_text = u"\n  {0}".format(u'\n  '.join(u':{0}: {1}'.format(
+                arg.split(u'=')[0], arg.split(u'=')[1]) for arg in args))
         self.objects.append(u".. {0} image:: {1}{2}".format(ret, href, args_text))
         return ret
 
@@ -586,7 +589,8 @@
         if len(type) == 2:
             if type[0] == u"x-moin/macro":
                 if len(elem) and iter(elem).next().tag.name == "arguments":
-                    alt = u"<<{0}({1})>>".format(type[1].split(u'=')[1], u','.join([u''.join(c.itertext()) for c in iter(elem).next() if c.tag.name == "argument"]))
+                    alt = u"<<{0}({1})>>".format(type[1].split(u'=')[1], u','.join(
+                            [u''.join(c.itertext()) for c in iter(elem).next() if c.tag.name == "argument"]))
                 else:
                     alt = u"<<{0}()>>".format(type[1].split(u'=')[1])
 
@@ -656,7 +660,8 @@
         table = repr(self.tablec)
         if self.status[-1] == "list":
             table =\
-                re.sub(r"\n(.)", lambda m: u"\n{0}{1}".format(u' '*(len(u''.join(self.list_item_labels)) + len(self.list_item_labels)), m.group(1)), u"\n" + table)
+                re.sub(r"\n(.)", lambda m: u"\n{0}{1}".format(u' ' *
+                        (len(u''.join(self.list_item_labels)) + len(self.list_item_labels)), m.group(1)), u"\n" + table)
             return table + ReST.p
         return table + ReST.linebreak
 
--- a/MoinMoin/converter/smiley.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/smiley.py	Mon Feb 11 04:49:04 2013 +0100
@@ -64,7 +64,7 @@
     ($|(?=\s))  # we require either ending of line or some space after a smiley
 """ % {'smiley': u'|'.join([re.escape(s) for s in smileys])}
 
-    smiley_re = re.compile(smiley_rule, re.UNICODE|re.VERBOSE)
+    smiley_re = re.compile(smiley_rule, re.UNICODE | re.VERBOSE)
 
     # We do not process any smiley conversion within these elements.
     tags_to_ignore = set(['code', 'blockcode', ])
--- a/MoinMoin/converter/xml_in.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/converter/xml_in.py	Mon Feb 11 04:49:04 2013 +0100
@@ -14,7 +14,8 @@
 
 from ._util import decode_data
 
-RX_STRIPXML = re.compile(u"<[^>]*?>", re.U|re.DOTALL|re.MULTILINE)
+RX_STRIPXML = re.compile(u"<[^>]*?>", re.U | re.DOTALL | re.MULTILINE)
+
 
 def strip_xml(text):
     text = RX_STRIPXML.sub(u" ", text)
--- a/MoinMoin/datastruct/backends/__init__.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/datastruct/backends/__init__.py	Mon Feb 11 04:49:04 2013 +0100
@@ -209,7 +209,8 @@
         else:
             groups = flaskg.groups
             for group_name in self.member_groups:
-                if group_name not in processed_groups and group_name in groups and groups[group_name].__contains__(member, processed_groups):
+                if (group_name not in processed_groups and group_name in groups and
+                        groups[group_name].__contains__(member, processed_groups)):
                     return True
 
         return False
@@ -250,7 +251,8 @@
                     yield group_name
 
     def __repr__(self):
-        return "<{0!r} name={1!r} members={2!r} member_groups={3!r}>".format(self.__class__, self.name, self.members, self.member_groups)
+        return "<{0!r} name={1!r} members={2!r} member_groups={3!r}>".format(
+            self.__class__, self.name, self.members, self.member_groups)
 
 
 class BaseDict(object, DictMixin):
--- a/MoinMoin/error.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/error.py	Mon Feb 11 04:49:04 2013 +0100
@@ -95,14 +95,17 @@
                 break
         return all
 
+
 class FatalError(CompositeError):
     """ Base class for fatal error we can't handle
 
     Do not use this class but its more specific sub classes.
     """
 
+
 class ConfigurationError(FatalError):
     """ Raise when fatal misconfiguration is found """
 
+
 class InternalError(FatalError):
     """ Raise when internal fatal error is found """
--- a/MoinMoin/forms.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/forms.py	Mon Feb 11 04:49:04 2013 +0100
@@ -9,10 +9,12 @@
 """
 
 
-import re, datetime
+import re
+import datetime
 import json
 
-from flatland import Element, Form, String, Integer, Boolean, Enum, Dict, JoinedString, List, Array, DateTime as _DateTime
+from flatland import (Element, Form, String, Integer, Boolean, Enum, Dict, JoinedString, List, Array,
+                      DateTime as _DateTime)
 from flatland.util import class_cloner, Unspecified
 from flatland.validation import Validator, Present, IsEmail, ValueBetween, URLValidator, Converted, ValueAtLeast
 from flatland.exc import AdaptationError
@@ -46,7 +48,7 @@
     def validate(self, element, state):
         try:
             json.loads(element.value)
-        except: # catch ANY exception that happens due to unserializing
+        except:  # catch ANY exception that happens due to unserializing
             return self.note_error(element, state, 'invalid_json_msg')
         return True
 
@@ -58,7 +60,8 @@
 
 YourOpenID = OpenID.with_properties(placeholder=L_("Your OpenID address"))
 
-Email = String.using(label=L_('E-Mail')).with_properties(widget=WIDGET_EMAIL, placeholder=L_("E-Mail address")).validated_by(IsEmail())
+Email = String.using(label=L_('E-Mail')).with_properties(widget=WIDGET_EMAIL,
+                                                         placeholder=L_("E-Mail address")).validated_by(IsEmail())
 
 YourEmail = Email.with_properties(placeholder=L_("Your E-Mail address"))
 
@@ -87,9 +90,11 @@
     def u(self):
         return self.separator.join(child.u for child in self)
 
-Tags = MyJoinedString.of(String).with_properties(widget=WIDGET_TEXT).using(label=L_('Tags'), optional=True, separator=', ', separator_regex=re.compile(r'\s*,\s*'))
+Tags = MyJoinedString.of(String).with_properties(widget=WIDGET_TEXT).using(label=L_('Tags'), optional=True,
+                                                            separator=', ', separator_regex=re.compile(r'\s*,\s*'))
 
-Names = MyJoinedString.of(String).with_properties(widget=WIDGET_TEXT).using(label=L_('Names'), optional=True, separator=', ', separator_regex=re.compile(r'\s*,\s*'))
+Names = MyJoinedString.of(String).with_properties(widget=WIDGET_TEXT).using(label=L_('Names'), optional=True,
+                                                            separator=', ', separator_regex=re.compile(r'\s*,\s*'))
 
 Search = Text.using(default=u'', optional=True).with_properties(widget=WIDGET_SEARCH, placeholder=L_("Search Query"))
 
@@ -137,7 +142,8 @@
             dt = utctimestamp(dt)
         return dt
 
-DateTime = (DateTimeUNIX.with_properties(widget=WIDGET_DATETIME, placeholder=_("YYYY-MM-DD HH:MM:SS (example: 2013-12-31 23:59:59)"))
+DateTime = (DateTimeUNIX.with_properties(widget=WIDGET_DATETIME,
+                                         placeholder=_("YYYY-MM-DD HH:MM:SS (example: 2013-12-31 23:59:59)"))
             .validated_by(Converted(incorrect=L_("Please use the following format: YYYY-MM-DD HH:MM:SS"))))
 
 File = FileStorage.with_properties(widget=WIDGET_FILE)
@@ -165,6 +171,7 @@
             return self.note_error(element, state, 'invalid_reference_msg')
         return True
 
+
 class Reference(Select.with_properties(empty_label=L_(u'(None)')).validated_by(ValidReference())):
     """
     A metadata property that points to another item selected out of the
--- a/MoinMoin/items/__init__.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/items/__init__.py	Mon Feb 11 04:49:04 2013 +0100
@@ -91,8 +91,10 @@
 
 item_registry = RegistryItem()
 
+
 def register(cls):
-    item_registry.register(RegistryItem.Entry(cls._factory, cls.itemtype, cls.display_name, cls.description, cls.order), cls.shown)
+    item_registry.register(RegistryItem.Entry(cls._factory, cls.itemtype, cls.display_name, cls.description, cls.order),
+                           cls.shown)
     return cls
 
 
@@ -114,8 +116,10 @@
     """ if we have no stored Item, we use this dummy """
     def __init__(self, name):
         self.name = name
+
     def list_revisions(self):
-        return [] # same as an empty Item
+        return []  # same as an empty Item
+
     def destroy_all_revisions(self):
         return True
 
@@ -140,12 +144,12 @@
     :itemtype and :contenttype are used when creating a DummyRev, where
     metadata is not available from the storage.
     """
-    if 1: # try:
+    if 1:  # try:
         if item is None:
             item = flaskg.storage[name]
         else:
             name = item.name
-    if not item: # except NoSuchItemError:
+    if not item:  # except NoSuchItemError:
         logging.debug("No such item: {0!r}".format(name))
         item = DummyItem(name)
         rev = DummyRev(item, itemtype, contenttype)
@@ -154,11 +158,11 @@
         logging.debug("Got item: {0!r}".format(name))
         try:
             rev = item.get_revision(rev_id)
-        except KeyError: # NoSuchRevisionError:
+        except KeyError:  # NoSuchRevisionError:
             try:
-                rev = item.get_revision(CURRENT) # fall back to current revision
+                rev = item.get_revision(CURRENT)  # fall back to current revision
                 # XXX add some message about invalid revision
-            except KeyError: # NoSuchRevisionError:
+            except KeyError:  # NoSuchRevisionError:
                 logging.debug("Item {0!r} has no revisions.".format(name))
                 rev = DummyRev(item, itemtype, contenttype)
                 logging.debug("Item {0!r}, created dummy revision with contenttype {1!r}".format(name, contenttype))
@@ -198,6 +202,7 @@
 
 UNKNOWN_ITEM_GROUP = "unknown items"
 
+
 def _build_contenttype_query(groups):
     """
     Build a Whoosh query from a list of contenttype groups.
@@ -214,6 +219,7 @@
 
 MixedIndexEntry = namedtuple('MixedIndexEntry', 'relname meta hassubitems')
 
+
 class Item(object):
     """ Highlevel (not storage) Item, wraps around a storage Revision"""
     # placeholder values for registry entry properties
@@ -247,7 +253,7 @@
         property.
         """
         rev = get_storage_revision(name, itemtype, contenttype, rev_id, item)
-        contenttype = rev.meta.get(CONTENTTYPE) or contenttype # use contenttype in case our metadata does not provide CONTENTTYPE
+        contenttype = rev.meta.get(CONTENTTYPE) or contenttype
         logging.debug("Item {0!r}, got contenttype {1!r} from revision meta".format(name, contenttype))
         #logging.debug("Item %r, rev meta dict: %r" % (name, dict(rev.meta)))
 
@@ -284,7 +290,7 @@
 
     def meta_filter(self, meta):
         """ kill metadata entries that we set automatically when saving """
-        kill_keys = [# shall not get copied from old rev to new rev
+        kill_keys = [  # shall not get copied from old rev to new rev
             SYSITEM_VERSION,
             NAME_OLD,
             # are automatically implanted when saving
@@ -337,7 +343,8 @@
                     else:  # rename
                         child_newname = new_prefix + child_oldname[old_prefixlen:]
                     item = Item.create(child_oldname)
-                    item._save(item.meta, item.content.data, name=child_newname, action=action, comment=comment, delete=delete)
+                    item._save(item.meta, item.content.data,
+                               name=child_newname, action=action, comment=comment, delete=delete)
 
     def rename(self, name, comment=u''):
         """
@@ -412,12 +419,12 @@
             currentrev = storage_item.get_revision(CURRENT)
             rev_id = currentrev.revid
             contenttype_current = currentrev.meta.get(CONTENTTYPE)
-        except KeyError: # XXX was: NoSuchRevisionError:
+        except KeyError:  # XXX was: NoSuchRevisionError:
             currentrev = None
             rev_id = None
             contenttype_current = None
 
-        meta = dict(meta) # we may get a read-only dict-like, copy it
+        meta = dict(meta)  # we may get a read-only dict-like, copy it
 
         # we store the previous (if different) and current item name into revision metadata
         # this is useful for rename history and backends that use item uids internally
@@ -427,7 +434,7 @@
         if oldname:
             if not isinstance(oldname, list):
                 oldname = [oldname]
-            if delete or name not in oldname: # this is a delete or rename
+            if delete or name not in oldname:  # this is a delete or rename
                 meta[NAME_OLD] = oldname[:]
                 try:
                     oldname.remove(self.name)
@@ -455,7 +462,7 @@
                 data = ''
 
         if isinstance(data, unicode):
-            data = data.encode(CHARSET) # XXX wrong! if contenttype gives a coding, we MUST use THAT.
+            data = data.encode(CHARSET)  # XXX wrong! if contenttype gives a coding, we MUST use THAT.
 
         if isinstance(data, str):
             data = StringIO(data)
@@ -633,8 +640,8 @@
 
     def do_show(self, revid):
         show_revision = revid != CURRENT
-        show_navigation = False # TODO
-        first_rev = last_rev = None # TODO
+        show_navigation = False  # TODO
+        first_rev = last_rev = None  # TODO
         return render_template(self.show_template,
                                item=self, item_name=self.name,
                                rev=self.rev,
--- a/MoinMoin/items/blog.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/items/blog.py	Mon Feb 11 04:49:04 2013 +0100
@@ -32,11 +32,13 @@
     supertags = (Tags.using(label=L_('Supertags (Categories)'))
                  .with_properties(placeholder=L_("Ordered comma separated list of tags")))
 
+
 class BlogEntryMetaForm(BaseMetaForm):
     summary = (OptionalText.using(label=L_("Title"))
                .with_properties(placeholder=L_("One-line title of the blog entry")))
     ptime = DateTime.using(label=L_('Publication time (UTC)'), optional=True)
 
+
 @register
 class Blog(Default):
     itemtype = ITEMTYPE_BLOG
@@ -89,6 +91,7 @@
                                tag=tag,
                               )
 
+
 @register
 class BlogEntry(Default):
     itemtype = ITEMTYPE_BLOG_ENTRY
--- a/MoinMoin/items/content.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/items/content.py	Mon Feb 11 04:49:04 2013 +0100
@@ -17,7 +17,9 @@
     Each class in this module corresponds to a contenttype value.
 """
 
-import os, re, base64
+import os
+import re
+import base64
 import tarfile
 import zipfile
 import tempfile
@@ -43,7 +45,7 @@
     from PIL import Image as PILImage
     from PIL.ImageChops import difference as PILdiff
 except ImportError:
-    PIL = None
+    PIL = PILImage = PILdiff = None
 
 from MoinMoin import log
 logging = log.getLogger(__name__)
@@ -73,7 +75,8 @@
 
 
 class RegistryContent(RegistryBase):
-    class Entry(namedtuple('Entry', 'factory content_type default_contenttype_params display_name ingroup_order priority')):
+    class Entry(namedtuple('Entry',
+                           'factory content_type default_contenttype_params display_name ingroup_order priority')):
         def __call__(self, content_type, *args, **kw):
             if self.content_type.issupertype(Type(content_type)):
                 return self.factory(content_type, *args, **kw)
@@ -114,8 +117,11 @@
     GROUP_OTHER
 ])
 
+
 def register(cls):
-    content_registry.register(RegistryContent.Entry(cls._factory, Type(cls.contenttype), cls.default_contenttype_params, cls.display_name, cls.ingroup_order, RegistryContent.PRIORITY_MIDDLE), cls.group)
+    content_registry.register(RegistryContent.Entry(cls._factory, Type(cls.contenttype),
+                                                    cls.default_contenttype_params, cls.display_name,
+                                                    cls.ingroup_order, RegistryContent.PRIORITY_MIDDLE), cls.group)
     return cls
 
 
@@ -168,7 +174,7 @@
         return self.item.name
 
     def get_data(self):
-        return '' # TODO create a better method for binary stuff
+        return ''  # TODO create a better method for binary stuff
     data = property(fget=get_data)
 
     @timed('conv_in_dom')
@@ -243,7 +249,8 @@
             # we really want to make sure that invalid data or a malfunctioning
             # converter does not crash the item view (otherwise a user might
             # not be able to fix it from the UI).
-            import time, uuid
+            import time
+            import uuid
             error_id = uuid.uuid4()
             logging.exception("An exception happened in _render_data (error_id = %s ):" % error_id)
             rendered_data = render_template('crash.html',
@@ -316,7 +323,7 @@
             if data_file:
                 data = data_file.stream
                 # this is likely a guess by the browser, based on the filename
-                contenttype_guessed = data_file.content_type # comes from form multipart data
+                contenttype_guessed = data_file.content_type  # comes from form multipart data
                 return data, contenttype_guessed
             else:
                 return None, None
@@ -342,7 +349,7 @@
 
     def do_get(self, force_attachment=False, mimetype=None):
         hash = self.rev.meta.get(HASH_ALGORITHM)
-        if is_resource_modified(request.environ, hash): # use hash as etag
+        if is_resource_modified(request.environ, hash):  # use hash as etag
             return self._do_get_modified(hash, force_attachment=force_attachment, mimetype=mimetype)
         else:
             return Response(status=304)
@@ -352,7 +359,7 @@
         return self._do_get(hash, member, force_attachment=force_attachment, mimetype=mimetype)
 
     def _do_get(self, hash, member=None, force_attachment=False, mimetype=None):
-        if member: # content = file contained within a archive item revision
+        if member:  # content = file contained within a archive item revision
             path, filename = os.path.split(member)
             mt = MimeType(filename=filename)
             content_length = None
@@ -360,7 +367,7 @@
             # force attachment download, so it uses attachment_filename
             # otherwise it will use the itemname from the URL for saving
             force_attachment = True
-        else: # content = item revision
+        else:  # content = item revision
             rev = self.rev
             filename = rev.item.name
             try:
@@ -379,7 +386,7 @@
         return send_file(file=file_to_send,
                          mimetype=content_type,
                          as_attachment=as_attachment, attachment_filename=filename,
-                         cache_timeout=10, # wiki data can change rapidly
+                         cache_timeout=10,  # wiki data can change rapidly
                          add_etags=True, etag=hash, conditional=True)
 
 
@@ -445,7 +452,7 @@
         if isinstance(content, str):
             if content_length is None:
                 content_length = len(content)
-            content = StringIO(content) # we need a file obj
+            content = StringIO(content)  # we need a file obj
         elif not hasattr(content, 'read'):
             logging.error("unsupported content object: {0!r}".format(content))
             raise StorageError("unsupported content object: {0!r}".format(content))
@@ -636,12 +643,12 @@
         try:
             # if we have EXIF data, we can transpose (e.g. rotate left),
             # so the rendered image is correctly oriented:
-            transpose_op = transpose_op or 1 # or self.exif['Orientation']
+            transpose_op = transpose_op or 1  # or self.exif['Orientation']
         except KeyError:
-            transpose_op = 1 # no change
+            transpose_op = 1  # no change
 
         if size is not None:
-            image = image.copy() # create copy first as thumbnail works in-place
+            image = image.copy()  # create copy first as thumbnail works in-place
             image.thumbnail(size, PILImage.ANTIALIAS)
 
         transpose_func = {
@@ -726,7 +733,7 @@
         c = app.cache.get(cid)
         if c is None:
             if PIL is None:
-                abort(404) # TODO render user friendly error image
+                abort(404)  # TODO render user friendly error image
 
             content_type = newrev.meta[CONTENTTYPE]
             if content_type == 'image/jpeg':
@@ -752,7 +759,7 @@
                 app.cache.set(cid, (headers, data))
             except (IOError, ValueError) as err:
                 logging.exception("error during PILdiff: {0}".format(err.message))
-                abort(404) # TODO render user friendly error image
+                abort(404)  # TODO render user friendly error image
         else:
             # XXX TODO check ACL behaviour
             headers, data = c
@@ -979,7 +986,7 @@
         return send_file(file=file_to_send,
                          mimetype=content_type,
                          as_attachment=as_attachment, attachment_filename=None,
-                         cache_timeout=10, # wiki data can change rapidly
+                         cache_timeout=10,  # wiki data can change rapidly
                          add_etags=False, etag=None, conditional=True)
 
 
@@ -1072,10 +1079,10 @@
         filecontent = file_upload.stream
         content_length = None
         if ext in ['.svg', '.draw', ]:  # handle AWD (svg) and TWD (draw)
-            filecontent = filecontent.read() # read file completely into memory
+            filecontent = filecontent.read()  # read file completely into memory
             filecontent = filecontent.replace("\r", "")
         elif ext == '.map':
-            filecontent = filecontent.read() # read file completely into memory
+            filecontent = filecontent.read()  # read file completely into memory
             filecontent = filecontent.strip()
         elif ext == '.png':
             #content_length = file_upload.content_length
@@ -1122,11 +1129,12 @@
     class ModifyForm(Draw.ModifyForm):
         template = "modify_anywikidraw.html"
         help = ""
+
         def _load(self, item):
             super(AnyWikiDraw.ModifyForm, self)._load(item)
             try:
                 drawing_exists = 'drawing.svg' in item.list_members()
-            except tarfile.TarError: # item doesn't exist yet
+            except tarfile.TarError:  # item doesn't exist yet
                 drawing_exists = False
             self.drawing_exists = drawing_exists
 
--- a/MoinMoin/items/ticket.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/items/ticket.py	Mon Feb 11 04:49:04 2013 +0100
@@ -19,7 +19,8 @@
 
 from MoinMoin.i18n import L_
 from MoinMoin.themes import render_template
-from MoinMoin.forms import Form, OptionalText, OptionalMultilineText, Submit, SmallNatural, Tags, Reference, BackReference
+from MoinMoin.forms import (Form, OptionalText, OptionalMultilineText, Submit, SmallNatural, Tags,
+                            Reference, BackReference)
 from MoinMoin.storage.middleware.protecting import AccessDenied
 from MoinMoin.constants.keys import ITEMTYPE, CONTENTTYPE, ITEMID, CURRENT
 from MoinMoin.constants.contenttypes import CONTENTTYPE_USER
@@ -36,6 +37,7 @@
 OptionalTicketReference = Reference.to(TICKET_QUERY).using(optional=True)
 OptionalUserReference = Reference.to(USER_QUERY).using(optional=True).with_properties(empty_label='(Nobody)')
 
+
 class TicketMetaForm(Form):
     summary = OptionalText.using(label=L_("Summary")).with_properties(placeholder=L_("One-line summary of the item"))
     effort = Rating.using(label=L_("Effort"))
@@ -47,6 +49,7 @@
     superseded_by = OptionalTicketReference.using(label=L_("Superseded By"))
     depends_on = OptionalTicketReference.using(label=L_("Depends On"))
 
+
 class TicketBackRefForm(Form):
     supersedes = BackReference.using(label=L_("Supersedes"))
     required_by = BackReference.using(label=L_("Required By"))
@@ -58,6 +61,7 @@
         self['required_by'].set(Term('depends_on', id_))
         self['subscribers'].set(Term('subscribed_items', id_))
 
+
 class TicketForm(BaseModifyForm):
     meta = TicketMetaForm
     backrefs = TicketBackRefForm
--- a/MoinMoin/log.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/log.py	Mon Feb 11 04:49:04 2013 +0100
@@ -108,8 +108,8 @@
     # for warnings, we just want to use the logging system, not stderr or other files
     msg = "{0}:{1}: {2}: {3}".format(filename, lineno, category.__name__, message)
     logger = getLogger(__name__)
-    logger.warning(msg) # Note: the warning will look like coming from here,
-                        # but msg contains info about where it really comes from
+    logger.warning(msg)  # Note: the warning will look like coming from here,
+                         # but msg contains info about where it really comes from
 
 
 def load_config(conf_fname=None):
@@ -125,7 +125,7 @@
             l = getLogger(__name__)
             l.info('using logging configuration read from "{0}"'.format(conf_fname))
             warnings.showwarning = _log_warning
-        except Exception as err: # XXX be more precise
+        except Exception as err:  # XXX be more precise
             err_msg = str(err)
     if not configured:
         # load builtin fallback logging config
@@ -151,6 +151,6 @@
         load_config()
     logger = logging.getLogger(name)
     for levelnumber, levelname in logging._levelNames.items():
-        if isinstance(levelnumber, int): # that list has also the reverse mapping...
+        if isinstance(levelnumber, int):  # that list has also the reverse mapping...
             setattr(logger, levelname, levelnumber)
     return logger
--- a/MoinMoin/macro/Anchor.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/macro/Anchor.py	Mon Feb 11 04:49:04 2013 +0100
@@ -9,6 +9,7 @@
 from MoinMoin.util.tree import moin_page
 from MoinMoin.macro._base import MacroInlineBase
 
+
 class Macro(MacroInlineBase):
     def macro(self, content, arguments, page_url, alternative):
         if not arguments:
--- a/MoinMoin/macro/Date.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/macro/Date.py	Mon Feb 11 04:49:04 2013 +0100
@@ -14,6 +14,7 @@
 
 from MoinMoin.macro._base import MacroInlineBase
 
+
 class MacroDateTimeBase(MacroInlineBase):
     def parse_time(self, args):
         """ parse a time specification argument for usage by Date and DateTime macro
@@ -29,8 +30,8 @@
             try:
                 year, month, day = int(args[0:4]), int(args[5:7]), int(args[8:10])
                 hour, minute, second = int(args[11:13]), int(args[14:16]), int(args[17:19])
-                tz = args[19:] # +HHMM, -HHMM or Z or nothing (then we assume Z)
-                tzoffset = 0 # we assume UTC no matter if there is a Z
+                tz = args[19:]  # +HHMM, -HHMM or Z or nothing (then we assume Z)
+                tzoffset = 0  # we assume UTC no matter if there is a Z
                 if tz:
                     sign = tz[0]
                     if sign in '+-':
@@ -46,7 +47,7 @@
             try:
                 tm = time.mktime(tm) - time.timezone - tzoffset
             except (OverflowError, ValueError):
-                tm = 0 # incorrect, but we avoid an ugly backtrace
+                tm = 0  # incorrect, but we avoid an ugly backtrace
         else:
             # try raw seconds since epoch in UTC
             try:
@@ -55,10 +56,11 @@
                 raise ValueError("Bad timestamp {0!r}: {1}".format(args, err))
         return tm
 
+
 class Macro(MacroDateTimeBase):
     def macro(self, content, arguments, page_url, alternative):
         if arguments is None:
-            tm = time.time() # always UTC
+            tm = time.time()  # always UTC
         else:
             # XXX looks like args are split at ':' -> <Arguments([u'2010-12-31T23', u'59', u'00'], {})>
             stamp = arguments[0]
--- a/MoinMoin/macro/DateTime.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/macro/DateTime.py	Mon Feb 11 04:49:04 2013 +0100
@@ -13,10 +13,11 @@
 
 from MoinMoin.macro.Date import MacroDateTimeBase
 
+
 class Macro(MacroDateTimeBase):
     def macro(self, content, arguments, page_url, alternative):
         if arguments is None:
-            tm = time.time() # always UTC
+            tm = time.time()  # always UTC
         else:
             stamp = arguments[0]
             tm = self.parse_time(stamp)
--- a/MoinMoin/macro/GetText.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/macro/GetText.py	Mon Feb 11 04:49:04 2013 +0100
@@ -15,6 +15,7 @@
 from MoinMoin.i18n import _, L_, N_
 from MoinMoin.macro._base import MacroInlineBase
 
+
 class Macro(MacroInlineBase):
     """ Return a translation of args, or args as is """
     def macro(self, content, arguments, page_url, alternative):
--- a/MoinMoin/macro/GetVal.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/macro/GetVal.py	Mon Feb 11 04:49:04 2013 +0100
@@ -10,6 +10,7 @@
 
 from MoinMoin.macro._base import MacroInlineBase
 
+
 class Macro(MacroInlineBase):
     def macro(self, content, arguments, page_url, alternative):
         try:
--- a/MoinMoin/macro/MailTo.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/macro/MailTo.py	Mon Feb 11 04:49:04 2013 +0100
@@ -12,6 +12,7 @@
 from MoinMoin.util.tree import moin_page, xlink
 from MoinMoin.macro._base import MacroInlineBase
 
+
 class Macro(MacroInlineBase):
     def macro(self, content, arguments, page_url, alternative):
         # TODO new arg parsing is not compatible, splits at blanks
--- a/MoinMoin/macro/PagenameList.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/macro/PagenameList.py	Mon Feb 11 04:49:04 2013 +0100
@@ -14,6 +14,7 @@
 
 from MoinMoin.macro._base import MacroPageLinkListBase
 
+
 class Macro(MacroPageLinkListBase):
     def macro(self, content, arguments, page_url, alternative):
         # needle=u'', regex=False
--- a/MoinMoin/macro/RandomItem.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/macro/RandomItem.py	Mon Feb 11 04:49:04 2013 +0100
@@ -58,5 +58,5 @@
             result.append(moin_page.a(attrib={xlink.href: link}, children=[name]))
             result.append(", ")
 
-        del result[-1] # kill last comma
+        del result[-1]  # kill last comma
         return result
--- a/MoinMoin/macro/Verbatim.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/macro/Verbatim.py	Mon Feb 11 04:49:04 2013 +0100
@@ -8,6 +8,7 @@
 
 from MoinMoin.macro._base import MacroInlineBase
 
+
 class Macro(MacroInlineBase):
     def macro(self, text=u''):
         return text
--- a/MoinMoin/macro/_base.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/macro/_base.py	Mon Feb 11 04:49:04 2013 +0100
@@ -9,6 +9,7 @@
 from MoinMoin.util import iri
 from MoinMoin.util.tree import moin_page, xlink
 
+
 class MacroBase(object):
     """
     Macro base class.
@@ -23,6 +24,7 @@
     def __call__(self, content, arguments, page_url, alternative, context_block):
         raise NotImplementedError
 
+
 class MacroBlockBase(MacroBase):
     """
     Macro base class for block element macros.
@@ -38,6 +40,7 @@
     def macro(self, content, arguments, page_url, alternative):
         raise NotImplementedError
 
+
 class MacroInlineBase(MacroBase):
     """
     Macro base class for inline element macros.
@@ -50,6 +53,7 @@
             return moin_page.p(children=(ret, ))
         return ret
 
+
 class MacroInlineOnlyBase(MacroBase):
     """
     Macro base class for strict inline element macros.
@@ -61,6 +65,7 @@
         if not context_block:
             return self.macro(content, arguments, page_url, alternative)
 
+
 class MacroPageLinkListBase(MacroBlockBase):
     def create_pagelink_list(self, pagenames, ordered=False):
         """ creates an ET with a list of pagelinks from a list of pagenames """
@@ -74,6 +79,7 @@
             page_list.append(item)
         return page_list
 
+
 class MacroNumberPageLinkListBase(MacroBlockBase):
     def create_number_pagelink_list(self, num_pagenames, ordered=False):
         """ creates an ET with a list of pagelinks from a list of pagenames """
@@ -88,6 +94,7 @@
             num_page_list.append(item)
         return num_page_list
 
+
 class MacroDefinitionListBase(MacroBlockBase):
     def create_definition_list(self, items):
         """ creates an ET with a definition list made from items """
--- a/MoinMoin/mail/sendmail.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/mail/sendmail.py	Mon Feb 11 04:49:04 2013 +0100
@@ -8,7 +8,8 @@
 """
 
 
-import os, re
+import os
+import re
 from email.Header import Header
 
 from MoinMoin import log
@@ -79,14 +80,16 @@
     :rtype: tuple
     :returns: (is_ok, Description of error or OK message)
     """
-    import smtplib, socket
+    import smtplib
+    import socket
     from email.Message import Message
     from email.Charset import Charset, QP
     from email.Utils import formatdate, make_msgid
 
     cfg = app.cfg
     if not cfg.mail_enabled:
-        return (0, _("Contact administrator: cannot send password recovery e-mail because mail configuration is incomplete."))
+        return (0, _("Contact administrator: cannot send password recovery e-mail "
+                     "because mail configuration is incomplete."))
     mail_from = mail_from or cfg.mail_from
 
     logging.debug("send mail, from: {0!r}, subj: {1!r}".format(mail_from, subject))
@@ -145,7 +148,7 @@
             try:
                 #server.set_debuglevel(1)
                 if cfg.mail_username is not None and cfg.mail_password is not None:
-                    try: # try to do tls
+                    try:  # try to do TLS
                         server.ehlo()
                         if server.has_extn('starttls'):
                             server.starttls()
@@ -213,6 +216,7 @@
 
     return address
 
+
 def decodeSpamSafeEmail(address):
     """ Decode obfuscated email address to standard email address
 
--- a/MoinMoin/script/__init__.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/script/__init__.py	Mon Feb 11 04:49:04 2013 +0100
@@ -18,8 +18,10 @@
 
     manager = Manager(create_app)
     manager.add_option('-c', '--config', dest='config', required=False, default=wiki_config)
-    manager.add_option('-i', '--index-create', action='store_true', dest='create_index', required=False, default=False)
-    manager.add_option('-s', '--storage-create', action='store_true', dest='create_storage', required=False, default=False)
+    manager.add_option('-i', '--index-create', action='store_true', dest='create_index',
+                       required=False, default=False)
+    manager.add_option('-s', '--storage-create', action='store_true', dest='create_storage',
+                       required=False, default=False)
     manager.add_command("moin", Server(host='127.0.0.1', port=8080))
 
     from MoinMoin.script.maint import index
--- a/MoinMoin/script/account/disable.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/script/account/disable.py	Mon Feb 11 04:49:04 2013 +0100
@@ -40,12 +40,12 @@
             return
 
         print " {0:<20} {1:!r<25} {2:<35}".format(u.itemid, u.name, u.email),
-        if not u.disabled: # only disable once
+        if not u.disabled:  # only disable once
             u.disabled = 1
             u.name = u"{0}-{1}".format(u.name, u.id)
             if u.email:
                 u.email = u"{0}-{1}".format(u.email, u.id)
-            u.subscribed_items = [] # avoid using email
+            u.subscribed_items = []  # avoid using email
             u.save()
             print "- disabled."
         else:
--- a/MoinMoin/script/account/resetpw.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/script/account/resetpw.py	Mon Feb 11 04:49:04 2013 +0100
@@ -18,9 +18,11 @@
 class Fault(Exception):
     """something went wrong"""
 
+
 class NoSuchUser(Fault):
     """raised if no such user exists"""
 
+
 class MailFailed(Fault):
     """raised if e-mail sending failed"""
 
--- a/MoinMoin/script/maint/modified_systemitems.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/script/maint/modified_systemitems.py	Mon Feb 11 04:49:04 2013 +0100
@@ -14,6 +14,7 @@
 
 from MoinMoin.constants.keys import IS_SYSITEM, SYSITEM_VERSION
 
+
 class Modified_SystemItems(Command):
     description = 'This command can be used to list system items that has been edited in this wiki.'
 
--- a/MoinMoin/script/maint/modify_item.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/script/maint/modify_item.py	Mon Feb 11 04:49:04 2013 +0100
@@ -54,7 +54,7 @@
             meta = mf.read()
         meta = meta.decode('utf-8')
         meta = json.loads(meta)
-        to_kill = [SIZE, HASH_ALGORITHM, # gets re-computed automatically
+        to_kill = [SIZE, HASH_ALGORITHM,  # gets re-computed automatically
                    DATAID,
                   ]
         for key in to_kill:
--- a/MoinMoin/script/maint/serialization.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/script/maint/serialization.py	Mon Feb 11 04:49:04 2013 +0100
@@ -15,6 +15,7 @@
 from MoinMoin import log
 logging = log.getLogger(__name__)
 
+
 def open_file(filename, mode):
     if filename is None:
         # Guess the IO stream from the mode:
@@ -27,7 +28,8 @@
 
         # On Windows force the stream to be in binary mode if it's needed.
         if sys.platform == "win32" and "b" in mode:
-            import os, msvcrt
+            import os
+            import msvcrt
             msvcrt.setmode(stream.fileno(), os.O_BINARY)
 
         f = stream
@@ -35,6 +37,7 @@
         f = open(filename, mode)
     return f
 
+
 class Serialize(Command):
     description = 'Serialize the backend into a file.'
 
--- a/MoinMoin/script/migration/moin19/import19.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/script/migration/moin19/import19.py	Mon Feb 11 04:49:04 2013 +0100
@@ -33,7 +33,7 @@
                                      USERID, MTIME, EXTRA, COMMENT, TAGS, SIZE, HASH_ALGORITHM, ITEMID, REVID)
 from MoinMoin.constants.contenttypes import CONTENTTYPE_USER
 
-UID_OLD = 'old_user_id' # dynamic field *_id, so we don't have to change schema
+UID_OLD = 'old_user_id'  # dynamic field *_id, so we don't have to change schema
 
 from MoinMoin.storage.error import NoSuchRevisionError
 from MoinMoin.util.mimetype import MimeType
@@ -73,9 +73,9 @@
 
     def run(self, data_dir=None):
         indexer = app.storage
-        backend = indexer.backend # backend without indexing
+        backend = indexer.backend  # backend without indexing
         print "Users..."
-        for rev in UserBackend(os.path.join(data_dir, 'user')): # assumes user/ below data_dir
+        for rev in UserBackend(os.path.join(data_dir, 'user')):  # assumes user/ below data_dir
             backend.store(rev.meta, rev.data)
 
         print "Pages/Attachments..."
@@ -86,7 +86,8 @@
         indexer.rebuild()
 
         print "Fix userids..."
-        userid_map = dict([(rev.meta[UID_OLD], rev.meta[ITEMID]) for rev in indexer.documents(contenttype=CONTENTTYPE_USER)])
+        userid_map = dict([(rev.meta[UID_OLD], rev.meta[ITEMID])
+                           for rev in indexer.documents(contenttype=CONTENTTYPE_USER)])
         for mountpoint, revid in backend:
             meta, data = backend.retrieve(mountpoint, revid)
             if USERID in meta:
@@ -98,7 +99,7 @@
                     del meta[USERID]
                 backend.store(meta, data)
             elif meta.get(CONTENTTYPE) == CONTENTTYPE_USER:
-                meta.pop(UID_OLD, None) # not needed any more
+                meta.pop(UID_OLD, None)  # not needed any more
                 backend.store(meta, data)
 
         print "Rebuilding the index..."
@@ -167,11 +168,11 @@
             self.current = int(f.read().strip())
         editlogpath = os.path.join(self.path, 'edit-log')
         self.editlog = EditLog(editlogpath)
-        self.acl = None # TODO
+        self.acl = None  # TODO
         self.itemid = make_uuid()
         if backend.deleted_mode == DELETED_MODE_KILL:
             revpath = os.path.join(self.path, 'revisions', '{0:08d}'.format(self.current))
-            PageRevision(self, self.current, revpath) # will raise exception if killing is requested
+            PageRevision(self, self.current, revpath)  # will raise exception if killing is requested
 
     def iter_revisions(self):
         revisionspath = os.path.join(self.path, 'revisions')
@@ -196,7 +197,8 @@
         for fname in fnames:
             attachname = fname.decode('utf-8')
             try:
-                yield AttachmentRevision(self.name, attachname, os.path.join(attachmentspath, fname), self.editlog, self.acl)
+                yield AttachmentRevision(self.name, attachname, os.path.join(attachmentspath, fname),
+                                         self.editlog, self.acl)
             except Exception as err:
                 logging.exception("AttachmentRevision {0!r}/{1!r} raised exception:".format(self.name, attachname))
 
@@ -219,13 +221,13 @@
                 raise KillRequested('deleted_mode wants killing/ignoring')
             # handle deleted revisions (for all revnos with 0<=revno<=current) here
             # we prepare some values for the case we don't find a better value in edit-log:
-            meta = {MTIME: -1, # fake, will get 0 in the end
-                    NAME: item_name, # will get overwritten with name from edit-log
-                                     # if we have an entry there
+            meta = {MTIME: -1,  # fake, will get 0 in the end
+                    NAME: item_name,  # will get overwritten with name from edit-log
+                                      # if we have an entry there
                    }
             try:
-                revpath = os.path.join(item.path, 'revisions', '{0:08d}'.format(revno-1))
-                previous_meta = PageRevision(item, revno-1, revpath).meta
+                revpath = os.path.join(item.path, 'revisions', '{0:08d}'.format(revno - 1))
+                previous_meta = PageRevision(item, revno - 1, revpath).meta
                 # if this page revision is deleted, we have no on-page metadata.
                 # but some metadata is required, thus we have to copy it from the
                 # (non-deleted) revision revno-1:
@@ -233,24 +235,25 @@
                     if key in previous_meta:
                         meta[key] = previous_meta[key]
             except NoSuchRevisionError:
-                pass # should not happen
-            meta[MTIME] += 1 # it is now either 0 or prev rev mtime + 1
+                pass  # should not happen
+            meta[MTIME] += 1  # it is now either 0 or prev rev mtime + 1
             data = u''
             try:
                 editlog_data = editlog.find_rev(revno)
             except KeyError:
                 if 0 <= revno <= item._fs_current:
-                    editlog_data = { # make something up
+                    editlog_data = {  # make something up
                         ACTION: u'SAVE/DELETE',
                     }
                 else:
-                    raise NoSuchRevisionError('Item {0!r} has no revision {1} (not even a deleted one)!'.format(item.name, revno))
+                    raise NoSuchRevisionError('Item {0!r} has no revision {1} (not even a deleted one)!'.format(
+                                              item.name, revno))
         else:
             try:
                 editlog_data = editlog.find_rev(revno)
             except KeyError:
                 if 1 <= revno <= item.current:
-                    editlog_data = { # make something up
+                    editlog_data = {  # make something up
                         NAME: item.name,
                         MTIME: int(os.path.getmtime(path)),
                         ACTION: u'SAVE',
@@ -325,7 +328,7 @@
         try:
             meta = editlog.find_attach(attach_name)
         except KeyError:
-            meta = { # make something up
+            meta = {  # make something up
                 MTIME: int(os.path.getmtime(attpath)),
                 ACTION: u'SAVE',
             }
@@ -357,14 +360,14 @@
         keys = (MTIME, '__rev', ACTION, NAME, ADDRESS, HOSTNAME, USERID, EXTRA, COMMENT)
         result = dict(zip(keys, fields))
         # do some conversions/cleanups/fallbacks:
-        result[MTIME] = int(long(result[MTIME] or 0) / 1000000) # convert usecs to secs
-        result['__rev'] = int(result['__rev']) - 1 # old storage is 1-based, we want 0-based
+        result[MTIME] = int(long(result[MTIME] or 0) / 1000000)  # convert usecs to secs
+        result['__rev'] = int(result['__rev']) - 1  # old storage is 1-based, we want 0-based
         result[NAME] = unquoteWikiname(result[NAME])
         action = result[ACTION]
         extra = result[EXTRA]
         if extra:
             if action.startswith('ATT'):
-                result[NAME] += u'/' + extra # append filename to pagename
+                result[NAME] += u'/' + extra  # append filename to pagename
                 # keep EXTRA for find_attach
             elif action == 'SAVE/RENAME':
                 if extra:
@@ -391,7 +394,7 @@
             self.to_begin()
             raise KeyError
         del meta['__rev']
-        meta = dict([(k, v) for k, v in meta.items() if v]) # remove keys with empty values
+        meta = dict([(k, v) for k, v in meta.items() if v])  # remove keys with empty values
         if meta.get(ACTION) == u'SAVENEW':
             # replace SAVENEW with just SAVE
             meta[ACTION] = u'SAVE'
@@ -399,7 +402,7 @@
 
     def find_attach(self, attachname):
         """ Find metadata for some attachment name in the edit-log. """
-        for meta in self.reverse(): # use reverse iteration to get the latest upload's data
+        for meta in self.reverse():  # use reverse iteration to get the latest upload's data
             if (meta['__rev'] == 99999998 and  # 99999999-1 because of 0-based
                 meta[ACTION] == 'ATTNEW' and
                 meta[EXTRA] == attachname):
@@ -408,9 +411,9 @@
             self.to_end()
             raise KeyError
         del meta['__rev']
-        del meta[EXTRA] # we have full name in NAME
+        del meta[EXTRA]  # we have full name in NAME
         meta[ACTION] = u'SAVE'
-        meta = dict([(k, v) for k, v in meta.items() if v]) # remove keys with empty values
+        meta = dict([(k, v) for k, v in meta.items() if v])  # remove keys with empty values
         return meta
 
 
@@ -425,7 +428,7 @@
             result.append("{0}{1}:{2}".format(
                           modifier,
                           u','.join(entries),
-                          u','.join(rights) # iterator has removed invalid rights
+                          u','.join(rights)  # iterator has removed invalid rights
                          ))
     result = u' '.join(result)
     logging.debug("regenerate_acl {0!r} -> {1!r}".format(acl_string, result))
@@ -444,6 +447,7 @@
     items = [item for item in items if item]
     return tuple(items)
 
+
 def _decode_dict(line):
     """
     Decode dict of key:value pairs from user data file
@@ -497,7 +501,7 @@
 
     def _process_usermeta(self, metadata):
         # stuff we want to have stored as boolean:
-        bool_defaults = [ # taken from cfg.checkbox_defaults
+        bool_defaults = [  # taken from cfg.checkbox_defaults
             ('show_comments', 'False'),
             ('edit_on_doubleclick', 'True'),
             ('scroll_page_after_edit', 'True'),
@@ -525,36 +529,36 @@
         metadata['subscribed_items'] = metadata.get('subscribed_pages', [])
 
         # convert bookmarks from usecs (and str) to secs (int)
-        metadata['bookmarks'] = [(interwiki, int(long(bookmark)/1000000))
+        metadata['bookmarks'] = [(interwiki, int(long(bookmark) / 1000000))
                                  for interwiki, bookmark in metadata.get('bookmarks', {}).items()]
 
         # stuff we want to get rid of:
-        kill = ['aliasname', # renamed to display_name
-                'real_language', # crap (use 'language')
-                'wikiname_add_spaces', # crap magic (you get it like it is)
-                'recoverpass_key', # user can recover again if needed
-                'editor_default', # not used any more
-                'editor_ui', # not used any more
-                'external_target', # ancient, not used any more
-                'passwd', # ancient, not used any more (use enc_password)
-                'show_emoticons', # ancient, not used any more
-                'show_fancy_diff', # kind of diff display now depends on mimetype
-                'show_fancy_links', # not used any more (now link rendering depends on theme)
-                'show_toolbar', # not used any more
-                'show_topbottom', # crap
-                'show_nonexist_qm', # crap, can be done by css
-                'show_page_trail', # theme decides whether to show trail
-                'remember_last_visit', # we show trail, user can click there
-                'remember_me', # don't keep sessions open for a long time
-                'subscribed_pages', # renamed to subscribed_items
-                'edit_cols', # not used any more
-                'jid', # no jabber support
-                'tz_offset', # we have real timezone now
-                'date_fmt', # not used any more
-                'datetime_fmt', # not used any more
-                'last_saved', # renamed to MTIME
-                'email_subscribed_events', # XXX no support yet
-                'jabber_subscribed_events', # XXX no support yet
+        kill = ['aliasname',  # renamed to display_name
+                'real_language',  # crap (use 'language')
+                'wikiname_add_spaces',  # crap magic (you get it like it is)
+                'recoverpass_key',  # user can recover again if needed
+                'editor_default',  # not used any more
+                'editor_ui',  # not used any more
+                'external_target',  # ancient, not used any more
+                'passwd',  # ancient, not used any more (use enc_password)
+                'show_emoticons',  # ancient, not used any more
+                'show_fancy_diff',  # kind of diff display now depends on mimetype
+                'show_fancy_links',  # not used any more (now link rendering depends on theme)
+                'show_toolbar',  # not used any more
+                'show_topbottom',  # crap
+                'show_nonexist_qm',  # crap, can be done by css
+                'show_page_trail',  # theme decides whether to show trail
+                'remember_last_visit',  # we show trail, user can click there
+                'remember_me',  # don't keep sessions open for a long time
+                'subscribed_pages',  # renamed to subscribed_items
+                'edit_cols',  # not used any more
+                'jid',  # no jabber support
+                'tz_offset',  # we have real timezone now
+                'date_fmt',  # not used any more
+                'datetime_fmt',  # not used any more
+                'last_saved',  # renamed to MTIME
+                'email_subscribed_events',  # XXX no support yet
+                'jabber_subscribed_events',  # XXX no support yet
                ]
         for key in kill:
             if key in metadata:
@@ -563,7 +567,7 @@
         # finally, remove some empty values (that have empty defaults anyway or
         # make no sense when empty):
         empty_kill = ['aliasname', 'display_name', 'bookmarks', 'enc_password',
-                      'language', 'css_url', 'email', ] # XXX check subscribed_items, quicklinks
+                      'language', 'css_url', 'email', ]  # XXX check subscribed_items, quicklinks
         for key in empty_kill:
             if key in metadata and metadata[key] in [u'', tuple(), {}, [], ]:
                 del metadata[key]
--- a/MoinMoin/search/__init__.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/search/__init__.py	Mon Feb 11 04:49:04 2013 +0100
@@ -11,6 +11,7 @@
 from flatland import Form, String, Boolean
 from flatland.validation import Validator
 
+
 class ValidSearch(Validator):
     """Validator for a valid search form
     """
@@ -24,6 +25,7 @@
             return self.note_error(element, state, 'too_short_query_msg')
         return True
 
+
 class SearchForm(Form):
     q = Search
     history = InlineCheckbox.using(label=L_('search all revisions'))
--- a/MoinMoin/search/analyzers.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/search/analyzers.py	Mon Feb 11 04:49:04 2013 +0100
@@ -32,7 +32,7 @@
         :param positions: Whether to record token positions in the token.
         """
         assert isinstance(value, unicode), "{0!r} is not unicode".format(value)
-        if u'/' not in value: # Add '/' if user forgot do this
+        if u'/' not in value:  # Add '/' if user forgot do this
             value += u'/'
         pos = start_pos
         tk = Token()
--- a/MoinMoin/security/__init__.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/security/__init__.py	Mon Feb 11 04:49:04 2013 +0100
@@ -174,7 +174,7 @@
         useful in the wiki configuration though.
     """
 
-    special_users = ["All", "Known", "Trusted"] # order is important
+    special_users = ["All", "Known", "Trusted"]  # order is important
 
     def __init__(self, lines=[], default='', valid=None):
         """ Initialize an ACL, starting from <nothing>.
@@ -184,7 +184,7 @@
         self.default = default
         assert isinstance(lines, (list, tuple))
         if lines:
-            self.acl = [] # [ ('User', {"read": 0, ...}), ... ]
+            self.acl = []  # [ ('User', {"read": 0, ...}), ... ]
             self.acl_lines = []
             for line in lines:
                 self._addLine(line)
@@ -242,7 +242,7 @@
         allowed = None
         for entry, rightsdict in self.acl:
             if entry in self.special_users:
-                handler = getattr(self, "_special_"+entry, None)
+                handler = getattr(self, "_special_" + entry, None)
                 allowed = handler(name, dowhat, rightsdict)
             elif entry in groups:
                 this_group = groups[entry]
@@ -253,12 +253,13 @@
                         if special in this_group:
                             handler = getattr(self, "_special_" + special, None)
                             allowed = handler(name, dowhat, rightsdict)
-                            break # order of self.special_users is important
-            elif entry == name:  # XXX TODO maybe change this to "entry in names" to check users with multiple names in one go
+                            break  # order of self.special_users is important
+            elif entry == name:  # XXX TODO maybe change this to "entry in names"
+                                 # to check users with multiple names in one go
                 allowed = rightsdict.get(dowhat)
             if allowed is not None:
                 return allowed
-        return allowed # should be None
+        return allowed  # should be None
 
     def _special_All(self, name, dowhat, rightsdict):
         return rightsdict.get(dowhat)
@@ -268,7 +269,7 @@
             that means that there is a valid user account present.
             works for subscription emails.
         """
-        if user.search_users(name_exact=name): # is a user with this name known?
+        if user.search_users(name_exact=name):  # is a user with this name known?
             return rightsdict.get(dowhat)
         return None
 
--- a/MoinMoin/security/textcha.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/security/textcha.py	Mon Feb 11 04:49:04 2013 +0100
@@ -41,8 +41,9 @@
 
 from MoinMoin.i18n import _, L_, N_
 
-SHA1_LEN = 40 # length of hexdigest
-TIMESTAMP_LEN = 10 # length of timestamp
+SHA1_LEN = 40  # length of hexdigest
+TIMESTAMP_LEN = 10  # length of timestamp
+
 
 class TextCha(object):
     """ Text CAPTCHA support """
@@ -112,12 +113,13 @@
 
             try:
                 self.answer_regex = self.textchas[self.question]
-                self.answer_re = re.compile(self.answer_regex, re.U|re.I)
+                self.answer_re = re.compile(self.answer_regex, re.U | re.I)
             except KeyError:
                 # this question does not exist, thus there is no answer
                 self.answer_regex = ur"[Invalid question]"
                 self.answer_re = None
-                logging.warning(u"TextCha: Non-existing question '{0}' for {1}. May be invalid or user may be trying to cheat.".format(self.question, self.user_info))
+                logging.warning(u"TextCha: Non-existing question '{0}' for {1}. "
+                                u"May be invalid or user may be trying to cheat.".format(self.question, self.user_info))
             except re.error:
                 logging.error(u"TextCha: Invalid regex in answer for question '{0}'".format(self.question))
                 self.init_qa()
@@ -137,7 +139,7 @@
                     # ...
                 }
         """
-        return not not self.textchas # we don't want to return the dict
+        return not not self.textchas  # we don't want to return the dict
 
     def amend_form(self):
         """ Amend the form by doing the following:
@@ -147,11 +149,13 @@
         """
         if self.is_enabled():
             if self.question:
-                self.form['textcha_question'].set("{0} {1}{2}".format(self.question, int(self.timestamp), self.signature))
+                self.form['textcha_question'].set("{0} {1}{2}".format(
+                    self.question, int(self.timestamp), self.signature))
         else:
             self.form['textcha_question'].optional = True
             self.form['textcha'].optional = True
 
+
 class TextChaValid(Validator):
     """Validator for TextChas
     """
@@ -172,6 +176,7 @@
 
         return True
 
+
 class TextChaizedForm(Form):
     """a form providing TextCha support"""
     textcha_question = String
--- a/MoinMoin/security/ticket.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/security/ticket.py	Mon Feb 11 04:49:04 2013 +0100
@@ -10,7 +10,8 @@
 
 
 import time
-import hmac, hashlib
+import hmac
+import hashlib
 
 from MoinMoin import log
 logging = log.getLogger(__name__)
@@ -62,5 +63,6 @@
         logging.debug("checkTicket: too old ticket, timestamp {0!r}".format(timestamp))
         return False
     ourticket = createTicket(timestamp_str, **kw)
-    logging.debug("checkTicket: returning {0!r}, got {1!r}, expected {2!r}".format(ticket == ourticket, ticket, ourticket))
+    logging.debug("checkTicket: returning {0!r}, got {1!r}, expected {2!r}".format(
+        ticket == ourticket, ticket, ourticket))
     return ticket == ourticket
--- a/MoinMoin/signalling/log.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/signalling/log.py	Mon Feb 11 04:49:04 2013 +0100
@@ -17,6 +17,7 @@
     wiki_name = app.cfg.interwikiname
     logging.info(u"item {0}:{1} displayed".format(wiki_name, item_name))
 
+
 @item_modified.connect_via(ANY)
 def log_item_modified(app, item_name):
     wiki_name = app.cfg.interwikiname
--- a/MoinMoin/storage/__init__.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/storage/__init__.py	Mon Feb 11 04:49:04 2013 +0100
@@ -50,6 +50,7 @@
     acl_mapping = sorted(acl_mapping, key=lambda x: len(x[0]), reverse=True)
     return namespace_mapping, dict(backend_mapping), acl_mapping
 
+
 def create_simple_mapping(uri='stores:fs:instance',
                           content_acl=None, user_profile_acl=None):
     """
--- a/MoinMoin/storage/backends/fileserver.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/storage/backends/fileserver.py	Mon Feb 11 04:49:04 2013 +0100
@@ -76,7 +76,7 @@
         st = os.stat(path)
         root = self.path
         assert path.startswith(root)
-        relpath = path[len(root)+1:]
+        relpath = path[len(root) + 1:]
         # we always want to give NAME_SEP-separated names (not backslash):
         if os.sep == NAME_SEP:
             itemname = relpath
@@ -104,10 +104,10 @@
             raise
         meta = {}
         meta[NAME] = itemname
-        meta[MTIME] = int(st.st_mtime) # use int, not float
+        meta[MTIME] = int(st.st_mtime)  # use int, not float
         meta[REVID] = unicode(self._encode('%s.%d' % (meta[NAME], meta[MTIME])))
         meta[ITEMID] = meta[REVID]
-        meta[HASH_ALGORITHM] = u'' # XXX crap, but sendfile needs it for etag
+        meta[HASH_ALGORITHM] = u''  # XXX crap, but sendfile needs it for etag
         if stat.S_ISDIR(st.st_mode):
             # directory
             # we create a virtual wiki page listing links to subitems:
@@ -116,7 +116,7 @@
         elif stat.S_ISREG(st.st_mode):
             # normal file
             ct = unicode(MimeType(filename=itemname).content_type())
-            size = int(st.st_size) # use int instead of long
+            size = int(st.st_size)  # use int instead of long
         else:
             # symlink, device file, etc.
             ct = u'application/octet-stream'
@@ -169,7 +169,7 @@
         # update() method can efficiently update the index).
         for dirpath, dirnames, filenames in os.walk(self.path):
             key, mtime = self._mkkey(dirpath)
-            if 1: # key:
+            if 1:  # key:
                 yield self._encode('%s.%d' % (key, mtime))
             for filename in filenames:
                 yield self._encode('%s.%d' % self._mkkey(os.path.join(dirpath, filename)))
--- a/MoinMoin/storage/backends/stores.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/storage/backends/stores.py	Mon Feb 11 04:49:04 2013 +0100
@@ -136,12 +136,14 @@
             size_expected = meta.get(SIZE)
             size_real = tfw.size
             if size_expected is not None and size_expected != size_real:
-                raise ValueError("computed data size ({0}) does not match data size declared in metadata ({1})".format(size_real, size_expected))
+                raise ValueError("computed data size ({0}) does not match data size declared in metadata ({1})".format(
+                                 size_real, size_expected))
             meta[SIZE] = size_real
             hash_expected = meta.get(HASH_ALGORITHM)
             hash_real = tfw.hash.hexdigest()
             if hash_expected is not None and hash_expected != hash_real:
-                raise ValueError("computed data hash ({0}) does not match data hash declared in metadata ({1})".format(hash_real, hash_expected))
+                raise ValueError("computed data hash ({0}) does not match data hash declared in metadata ({1})".format(
+                                 hash_real, hash_expected))
             meta[HASH_ALGORITHM] = hash_real
         else:
             dataid = meta[DATAID]
@@ -153,7 +155,7 @@
                 # if we do not store if we already have the dataid in the store,
                 # deserialization does not work as the fpos does not advance to the next record,
                 # because we do not read from the source file. Remove the check?
-                while data.read(64*1024):
+                while data.read(64 * 1024):
                     pass
 
         # if something goes wrong below, the data shall be purged by a garbage collection
--- a/MoinMoin/storage/error.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/storage/error.py	Mon Feb 11 04:49:04 2013 +0100
@@ -16,26 +16,31 @@
     General class for exceptions on the storage layer.
     """
 
+
 class BackendError(StorageError):
     """
     Raised if the backend couldn't commit the action.
     """
 
+
 class NoSuchItemError(BackendError):
     """
     Raised if the requested item does not exist.
     """
 
+
 class ItemAlreadyExistsError(BackendError):
     """
     Raised if the Item you are trying to create already exists.
     """
 
+
 class NoSuchRevisionError(BackendError):
     """
     Raised if the requested revision of an item does not exist.
     """
 
+
 class RevisionAlreadyExistsError(BackendError):
     """
     Raised if the Revision you are trying to create already exists.
--- a/MoinMoin/storage/middleware/indexing.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/storage/middleware/indexing.py	Mon Feb 11 04:49:04 2013 +0100
@@ -154,6 +154,7 @@
 from MoinMoin.converter import default_registry
 from MoinMoin.util.iri import Iri
 
+
 def convert_to_indexable(meta, data, item_name=None, is_new=False):
     """
     Convert revision data to a indexable content.
@@ -173,14 +174,18 @@
             self.meta = meta
             self.data = data
             self.revid = meta.get(REVID)
+
             class PseudoItem(object):
                 def __init__(self, name):
                     self.name = name
             self.item = PseudoItem(item_name)
+
         def read(self, *args, **kw):
             return self.data.read(*args, **kw)
+
         def seek(self, *args, **kw):
             return self.data.seek(*args, **kw)
+
         def tell(self, *args, **kw):
             return self.data.tell(*args, **kw)
 
@@ -228,8 +233,9 @@
             return doc
         # no way
         raise TypeError("No converter for {0} --> {1}".format(input_contenttype, output_contenttype))
-    except Exception as e: # catch all exceptions, we don't want to break an indexing run
-        logging.exception("Exception happened in conversion of item {0!r} rev {1} contenttype {2}:".format(item_name, meta.get(REVID, 'new'), meta.get(CONTENTTYPE, '')))
+    except Exception as e:  # catch all exceptions, we don't want to break an indexing run
+        logging.exception("Exception happened in conversion of item {0!r} rev {1} contenttype {2}:".format(
+                          item_name, meta.get(REVID, 'new'), meta.get(CONTENTTYPE, '')))
         doc = u'ERROR [{0!s}]'.format(e)
         return doc
 
@@ -436,7 +442,7 @@
             index_dir, index_dir_tmp = params[0], params_tmp[0]
             os.rename(index_dir_tmp, index_dir)
 
-    def index_revision(self, meta, content, backend_name, async=False): # True
+    def index_revision(self, meta, content, backend_name, async=False):  # True
         """
         Index a single revision, add it to all-revs and latest-revs index.
 
@@ -450,7 +456,7 @@
         else:
             writer = self.ix[ALL_REVS].writer()
         with writer as writer:
-            writer.update_document(**doc) # update, because store_revision() may give us an existing revid
+            writer.update_document(**doc)  # update, because store_revision() may give us an existing revid
         doc = backend_to_index(meta, content, self.schemas[LATEST_REVS], self.wikiname, backend_name)
         if async:
             writer = AsyncWriter(self.ix[LATEST_REVS])
@@ -484,7 +490,7 @@
                 latest_backends_revids = self._find_latest_backends_revids(self.ix[ALL_REVS], Term(ITEMID, itemid))
                 if latest_backends_revids:
                     # we have a latest revision, just update the document in the index:
-                    assert len(latest_backends_revids) == 1 # this item must have only one latest revision
+                    assert len(latest_backends_revids) == 1  # this item must have only one latest revision
                     latest_backend_revid = latest_backends_revids[0]
                     # we must fetch from backend because schema for LATEST_REVS is different than for ALL_REVS
                     # (and we can't be sure we have all fields stored, too)
@@ -494,7 +500,8 @@
                     with self.ix[ALL_REVS].searcher() as searcher:
                         doc = searcher.document(revid=latest_backend_revid[1])
                         content = doc[CONTENT]
-                    doc = backend_to_index(meta, content, self.schemas[LATEST_REVS], self.wikiname, backend_name=latest_backend_revid[0])
+                    doc = backend_to_index(meta, content, self.schemas[LATEST_REVS], self.wikiname,
+                                           backend_name=latest_backend_revid[0])
                     writer.update_document(**doc)
                 else:
                     # this is no revision left in this item that could be the new "latest rev", just kill the rev
@@ -554,7 +561,7 @@
         index = storage.open_index(ALL_REVS)
         try:
             # build an index of all we have (so we know what we have)
-            all_revids = self.backend # the backend is an iterator over all revids
+            all_revids = self.backend  # the backend is an iterator over all revids
             self._modify_index(index, self.schemas[ALL_REVS], self.wikiname, all_revids, 'add', procs, limitmb)
             latest_backends_revids = self._find_latest_backends_revids(index)
         finally:
@@ -562,7 +569,8 @@
         # now build the index of the latest revisions:
         index = storage.open_index(LATEST_REVS)
         try:
-            self._modify_index(index, self.schemas[LATEST_REVS], self.wikiname, latest_backends_revids, 'add', procs, limitmb)
+            self._modify_index(index, self.schemas[LATEST_REVS], self.wikiname, latest_backends_revids, 'add',
+                               procs, limitmb)
         finally:
             index.close()
 
@@ -589,7 +597,7 @@
             backend_revids = set(revids_backends)
             with index_all.searcher() as searcher:
                 ix_revids_backends = dict((doc[REVID], doc[BACKENDNAME]) for doc in searcher.all_stored_fields())
-            revids_backends.update(ix_revids_backends) # this is needed for stuff that was deleted from storage
+            revids_backends.update(ix_revids_backends)  # this is needed for stuff that was deleted from storage
             ix_revids = set(ix_revids_backends)
             add_revids = backend_revids - ix_revids
             del_revids = ix_revids - backend_revids
@@ -667,6 +675,7 @@
         else:
             raise ValueError("default_fields list must at least contain one field name")
         qp.add_plugin(RegexPlugin())
+
         def userid_pseudo_field_factory(fieldname):
             """generate a translator function, that searches for the userid
                in the given fieldname when provided with the username
@@ -685,7 +694,7 @@
             # username:JoeDoe searches for revisions modified by JoeDoe
             username=userid_pseudo_field_factory(keys.USERID),
             # assigned:JoeDoe searches for tickets assigned to JoeDoe
-            assigned=userid_pseudo_field_factory('assigned_to'), # XXX should be keys.ASSIGNED_TO
+            assigned=userid_pseudo_field_factory('assigned_to'),  # XXX should be keys.ASSIGNED_TO
         )))
         return qp
 
@@ -822,6 +831,7 @@
 
     def _get_itemid(self):
         return self._current.get(ITEMID)
+
     def _set_itemid(self, value):
         self._current[ITEMID] = value
     itemid = property(_get_itemid, _set_itemid)
@@ -982,8 +992,8 @@
         return meta, data, content
 
     def store_revision(self, meta, data, overwrite=False,
-                       trusted=False, # True for loading a serialized representation or other trusted sources
-                       name=None, # TODO name we decoded from URL path
+                       trusted=False,  # True for loading a serialized representation or other trusted sources
+                       name=None,  # TODO name we decoded from URL path
                        action=u'SAVE',
                        remote_addr=None,
                        userid=None,
@@ -1027,7 +1037,7 @@
                  keys.USERID: userid,
                  keys.WIKINAME: wikiname,
                  keys.NAMESPACE: None,
-                 keys.ITEMID: self.itemid, # real itemid or None
+                 keys.ITEMID: self.itemid,  # real itemid or None
                  'contenttype_current': contenttype_current,
                  'contenttype_guessed': contenttype_guessed,
                  'acl_parent': acl_parent,
@@ -1051,7 +1061,8 @@
         # just update the meta dict with the validated stuff:
         meta.update(dict(m.value.items()))
         # we do not want None / empty values:
-        meta = dict([(k, v) for k, v in meta.items() if v not in [None, ]]) # XXX do not kick out empty lists before fixing NAME processing
+        # XXX do not kick out empty lists before fixing NAME processing:
+        meta = dict([(k, v) for k, v in meta.items() if v not in [None, ]])
 
         if self.itemid is None:
             self.itemid = meta[ITEMID]
@@ -1147,7 +1158,7 @@
                 return
 
     def _load(self):
-        meta, data = self.backend.retrieve(self.backend_name, self.revid) # raises KeyError if rev does not exist
+        meta, data = self.backend.retrieve(self.backend_name, self.revid)  # raises KeyError if rev does not exist
         self.meta = Meta(self, self._doc, meta)
         self._data = data
         return meta, data
@@ -1174,6 +1185,7 @@
 
 from collections import Mapping
 
+
 class Meta(Mapping):
     def __init__(self, revision, doc, meta=None):
         self.revision = revision
@@ -1215,7 +1227,7 @@
         return cmp(self[MTIME], other[MTIME])
 
     def __len__(self):
-        return 0 # XXX
+        return 0  # XXX
 
     def __repr__(self):
         return "Meta _doc: {0!r} _meta: {1!r}".format(self._doc, self._meta)
--- a/MoinMoin/storage/middleware/routing.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/storage/middleware/routing.py	Mon Feb 11 04:49:04 2013 +0100
@@ -80,7 +80,7 @@
         # Note: yields enough information so we can retrieve the revision from
         #       the right backend later (this is more than just the revid).
         for backend_name, backend in self.backends.items():
-            for revid in backend: # TODO maybe directly yield the backend?
+            for revid in backend:  # TODO maybe directly yield the backend?
                 yield (backend_name, revid)
 
     def retrieve(self, backend_name, revid):
@@ -115,7 +115,7 @@
                 raise ValueError('can not determine namespace: empty NAME list, no NAMESPACE metadata present')
         else:
             if namespace:
-                namespace += u':' # needed for _get_backend
+                namespace += u':'  # needed for _get_backend
             backend_name, _, _ = self._get_backend([namespace])
         backend = self.backends[backend_name]
 
--- a/MoinMoin/storage/middleware/serialization.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/storage/middleware/serialization.py	Mon Feb 11 04:49:04 2013 +0100
@@ -44,6 +44,7 @@
                 break
             yield block
 
+
 def serialize_iter(backend):
     for revid in backend:
         if isinstance(revid, tuple):
@@ -57,6 +58,7 @@
     for data in serialize_rev(None, None):
         yield data
 
+
 def deserialize(src, backend):
     while True:
         meta_size_bytes = src.read(4)
--- a/MoinMoin/storage/middleware/validation.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/storage/middleware/validation.py	Mon Feb 11 04:49:04 2013 +0100
@@ -102,7 +102,7 @@
         return False
     if v != v.strip():
         return False
-    if v.startswith(u'+'): # used for views, like /+meta/<itemname>
+    if v.startswith(u'+'):  # used for views, like /+meta/<itemname>
         return False
     if v.endswith(u'/'):
         return False
@@ -225,7 +225,7 @@
         if element.value is None:
             return False
         return True
-    else: # untrusted
+    else:  # untrusted
         v = element.value
         if not isinstance(v, unicode):
             return False
@@ -338,7 +338,8 @@
     String.named(keys.DATAID).validated_by(uuid_validator).using(optional=True),
     # markup items may have this:
     List.named(keys.ITEMLINKS).of(String.named('itemlink').validated_by(wikiname_validator)).using(optional=True),
-    List.named(keys.ITEMTRANSCLUSIONS).of(String.named('itemtransclusion').validated_by(wikiname_validator)).using(optional=True),
+    List.named(keys.ITEMTRANSCLUSIONS).of(String.named('itemtransclusion').validated_by(wikiname_validator)).using(
+        optional=True),
     # TODO: CONTENT validation? can we do it here?
     *common_meta
 )
--- a/MoinMoin/storage/stores/__init__.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/storage/stores/__init__.py	Mon Feb 11 04:49:04 2013 +0100
@@ -18,6 +18,7 @@
 
 from MoinMoin.util.StringIOClosing import StringIO
 
+
 class StoreBase(Mapping):
     """
     A simple read-only key/value store.
@@ -142,6 +143,7 @@
               file pointer position after we return.
         """
 
+
 class FileMutableStoreMixin(object):
     """
     mix this into a BytesMutableStore to get a FileMutableStore, like shown here:
--- a/MoinMoin/storage/stores/kc.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/storage/stores/kc.py	Mon Feb 11 04:49:04 2013 +0100
@@ -17,7 +17,8 @@
 
 from __future__ import absolute_import, division
 
-import os, errno
+import os
+import errno
 
 from kyotocabinet import *
 
@@ -33,7 +34,7 @@
     def from_uri(cls, uri):
         return cls(uri)
 
-    def __init__(self, path, mode=DB.OWRITER|DB.OAUTOTRAN, db_opts=DB.GCONCURRENT):
+    def __init__(self, path, mode=DB.OWRITER | DB.OAUTOTRAN, db_opts=DB.GCONCURRENT):
         """
         Store params for .open(). Please refer to kyotocabinet-python-legacy docs for more information.
 
@@ -56,7 +57,7 @@
         except OSError as e:
             if e.errno != errno.EEXIST:
                 raise
-        self.open(mode=self.mode|DB.OCREATE)
+        self.open(mode=self.mode | DB.OCREATE)
         self.close()
 
     def destroy(self):
--- a/MoinMoin/storage/stores/kt.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/storage/stores/kt.py	Mon Feb 11 04:49:04 2013 +0100
@@ -142,7 +142,7 @@
         response = self.client.getresponse()
         if response.status != 200:
             return None
-        return response # XXX can we do that?
+        return response  # XXX can we do that?
 
     def set(self, key, value, xt=None):
         if isinstance(key, unicode):
@@ -152,7 +152,7 @@
         if xt is not None:
             xt = int(time.time()) + xt
             headers["X-Kt-Xt"] = str(xt)
-        value = value.read() # XXX reads value file into memory
+        value = value.read()  # XXX reads value file into memory
         self.client.request("PUT", key, value, headers)
         response = self.client.getresponse()
         body = response.read()
--- a/MoinMoin/storage/stores/mongodb.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/storage/stores/mongodb.py	Mon Feb 11 04:49:04 2013 +0100
@@ -10,7 +10,8 @@
 
 from __future__ import absolute_import, division
 
-import pymongo, gridfs
+import pymongo
+import gridfs
 
 from . import MutableStoreBase, BytesMutableStoreBase, FileMutableStoreBase
 
@@ -21,7 +22,7 @@
     """
     @classmethod
     def from_uri(cls, uri):
-        params = uri.split('::') # moin_uri -> mongodb_uri::collection_name
+        params = uri.split('::')  # moin_uri -> mongodb_uri::collection_name
         return cls(*params)
 
     def __init__(self, uri='mongodb://127.0.0.1/moin_db', collection_name='moin_coll'):
--- a/MoinMoin/storage/stores/sqla.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/storage/stores/sqla.py	Mon Feb 11 04:49:04 2013 +0100
@@ -17,7 +17,7 @@
                BytesMutableStoreMixin, FileMutableStoreMixin)
 
 KEY_LEN = 128
-VALUE_LEN = 1024 * 1024 # 1MB binary data
+VALUE_LEN = 1024 * 1024  # 1MB binary data
 
 
 class BytesStore(BytesMutableStoreBase):
@@ -32,8 +32,8 @@
         :param cls: Class to create
         :param uri: The database uri that we pass on to SQLAlchemy.
         """
-        params = uri.split("::") # using "::" to support windows pathnames that
-                                 # may include ":" after the drive letter.
+        params = uri.split("::")  # using "::" to support windows pathnames that
+                                  # may include ":" after the drive letter.
         return cls(*params)
 
     def __init__(self, db_uri=None, table_name='store', verbose=False):
--- a/MoinMoin/storage/stores/sqlite.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/storage/stores/sqlite.py	Mon Feb 11 04:49:04 2013 +0100
@@ -35,8 +35,8 @@
                     db_name::table_name::compression_level
                     where table_name and compression level are optional
         """
-        params = uri.split("::") # using "::" to support windows pathnames that
-                                 # may include ":" after the drive letter.
+        params = uri.split("::")  # using "::" to support windows pathnames that
+                                  # may include ":" after the drive letter.
         if len(params) == 3:
             params[2] = int(params[2])
         return cls(*params)
@@ -69,7 +69,7 @@
 
     def open(self):
         self.conn = connect(self.db_name)
-        self.conn.row_factory = Row # make column access by ['colname'] possible
+        self.conn.row_factory = Row  # make column access by ['colname'] possible
 
     def close(self):
         pass
--- a/MoinMoin/themes/__init__.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/themes/__init__.py	Mon Feb 11 04:49:04 2013 +0100
@@ -41,7 +41,8 @@
     try:
         return get_theme(theme_name)
     except KeyError:
-        logging.warning("Theme {0!r} was not found; using default of {1!r} instead.".format(theme_name, app.cfg.theme_default))
+        logging.warning("Theme {0!r} was not found; using default of {1!r} instead.".format(
+            theme_name, app.cfg.theme_default))
         theme_name = app.cfg.theme_default
         return get_theme(theme_name)
 
@@ -50,6 +51,7 @@
 def render_template(template, **context):
     return render_theme_template(get_current_theme(), template, **context)
 
+
 def themed_error(e):
     item_name = request.view_args.get('item_name', u'')
     if e.code == 403:
@@ -72,11 +74,11 @@
         self.cfg = cfg
         self.user = flaskg.user
         self.storage = flaskg.storage
-        self.ui_lang = 'en' # XXX
-        self.ui_dir = 'ltr' # XXX
-        self.content_lang = flaskg.content_lang # XXX
-        self.content_dir = 'ltr' # XXX
-        self.meta_items = [] # list of (name, content) for html head <meta>
+        self.ui_lang = 'en'  # XXX
+        self.ui_dir = 'ltr'  # XXX
+        self.content_lang = flaskg.content_lang  # XXX
+        self.content_dir = 'ltr'  # XXX
+        self.meta_items = []  # list of (name, content) for html head <meta>
 
     def location_breadcrumbs(self, item_name):
         """
@@ -235,12 +237,12 @@
                                 item_url, item_name = line.split(' ', 1)
                                 sisteritems[item_name.decode('utf-8')] = item_url
                             except:
-                                pass # ignore invalid lines
+                                pass  # ignore invalid lines
                         f.close()
                         app.cache.set(cid, sisteritems)
                         logging.info("Site: {0!r} Status: Updated. Pages: {1}".format(sistername, len(sisteritems)))
                     except IOError as err:
-                        (title, code, msg, headers) = err.args # code e.g. 304
+                        (title, code, msg, headers) = err.args  # code e.g. 304
                         logging.warning("Site: {0!r} Status: Not updated.".format(sistername))
                         logging.exception("exception was:")
                 if current in sisteritems:
@@ -327,6 +329,7 @@
         result['email'] = email
     return result
 
+
 def shorten_item_name(name, length=25):
     """
     Shorten item names
@@ -349,6 +352,7 @@
             name = u'{0}...{1}'.format(name[:half + left], name[-half:])
     return name
 
+
 def shorten_id(name, length=7):
     """
     Shorten IDs to specified length
@@ -374,6 +378,7 @@
     'application/x-svgdraw': 'drawing',
 }
 
+
 def contenttype_to_class(contenttype):
     """
     Convert a contenttype string to a css class.
--- a/MoinMoin/user.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/user.py	Mon Feb 11 04:49:04 2013 +0100
@@ -158,9 +158,9 @@
     :rtype: unicode
     :returns: user name that can be used in acl lines
     """
-    username_allowedchars = "'@.-_" # ' for names like O'Brian or email addresses.
-                                    # "," and ":" must not be allowed (ACL delimiters).
-                                    # We also allow _ in usernames for nicer URLs.
+    username_allowedchars = "'@.-_"  # ' for names like O'Brian or email addresses.
+                                     # "," and ":" must not be allowed (ACL delimiters).
+                                     # We also allow _ in usernames for nicer URLs.
     # Strip non alpha numeric characters (except username_allowedchars), keep white space
     name = ''.join([c for c in name if c.isalnum() or c.isspace() or c in username_allowedchars])
 
@@ -204,7 +204,7 @@
             return self._meta[name]
         except KeyError:
             v = self._defaults[name]
-            if isinstance(v, (list, dict, set)): # mutable
+            if isinstance(v, (list, dict, set)):  # mutable
                 self._meta[name] = v
             return v
 
@@ -376,8 +376,8 @@
 
         :param changed: bool, set this to True if you updated the user profile values
         """
-        if not self.valid and not self.disabled or changed: # do we need to save/update?
-            self.save() # yes, create/update user profile
+        if not self.valid and not self.disabled or changed:  # do we need to save/update?
+            self.save()  # yes, create/update user profile
 
     def exists(self):
         """ Do we have a user profile for this user?
@@ -439,7 +439,8 @@
         try:
             password_correct, recomputed_hash = pwd_context.verify_and_update(password, pw_hash)
         except (ValueError, TypeError) as err:
-            logging.error('in user profile %r, verifying the passlib pw hash raised an Exception [%s]' % (self.name, str(err)))
+            logging.error('in user profile %r, verifying the passlib pw hash raised an Exception [%s]' % (
+                self.name, str(err)))
         else:
             if recomputed_hash is not None:
                 data[ENC_PASSWORD] = recomputed_hash
@@ -479,13 +480,13 @@
             self.valid = True
 
         if not exists:
-            pass # XXX UserCreatedEvent
+            pass  # XXX UserCreatedEvent
         else:
-            pass # XXX UserChangedEvent
+            pass  # XXX UserChangedEvent
 
     def getText(self, text):
         """ translate a text to the language of this user """
-        return text # FIXME, was: self._request.getText(text, lang=self.language)
+        return text  # FIXME, was: self._request.getText(text, lang=self.language)
 
     # Bookmarks --------------------------------------------------------------
 
@@ -664,9 +665,9 @@
         item_name = getInterwikiName(item_name)
         trail_in_session = session.get('trail', [])
         trail = trail_in_session[:]
-        trail = [i for i in trail if i != item_name] # avoid dupes
-        trail.append(item_name) # append current item name at end
-        trail = trail[-self._cfg.trail_size:] # limit trail length
+        trail = [i for i in trail if i != item_name]  # avoid dupes
+        trail.append(item_name)  # append current item name at end
+        trail = trail[-self._cfg.trail_size:]  # limit trail length
         if trail != trail_in_session:
             session['trail'] = trail
 
--- a/MoinMoin/util/__init__.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/util/__init__.py	Mon Feb 11 04:49:04 2013 +0100
@@ -36,6 +36,7 @@
     '"': '&quot;'
 }
 
+
 def TranslateCDATA(text):
     """
         Convert a string to a CDATA-encoded one
@@ -46,6 +47,7 @@
     new_string, num_subst = re.subn(g_xmlIllegalCharPattern, lambda m: '&#x%02X;' % ord(m.group()), new_string)
     return new_string
 
+
 def TranslateText(text):
     """
         Convert a string to a PCDATA-encoded one (do minimal encoding)
@@ -68,23 +70,25 @@
     numbers = sorted(numbers[:])
     numbers.append(999999)
     pattern = ','
-    for i in range(len(numbers)-1):
+    for i in range(len(numbers) - 1):
         if pattern[-1] == ',':
             pattern = pattern + str(numbers[i])
-            if numbers[i] + 1 == numbers[i+1]:
+            if numbers[i] + 1 == numbers[i + 1]:
                 pattern = pattern + '-'
             else:
                 pattern = pattern + ','
-        elif numbers[i] + 1 != numbers[i+1]:
+        elif numbers[i] + 1 != numbers[i + 1]:
             pattern = pattern + str(numbers[i]) + ','
 
     if pattern[-1] in ',-':
         return pattern[1:-1]
     return pattern[1:]
 
+
 def getPageContent(results, offset, results_per_page):
     """ Selects the content to show on a single page
-        :param results: the whole result, from which results for one page will be selected (generally a generator but could be a list also),
+        :param results: the whole result, from which results for one page will be selected (generally a generator
+               but could be a list also),
         :param offset: after skipping how many results, the selection of results for that page will be done (int),
         :param results_per_page: number of results to be shown on a single page (int)
 
--- a/MoinMoin/util/clock.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/util/clock.py	Mon Feb 11 04:49:04 2013 +0100
@@ -15,6 +15,7 @@
 
 from flask import g as flaskg
 
+
 class Clock(object):
     """
     Helper class for measuring the time needed to run code.
@@ -41,7 +42,7 @@
     def stop(self, timer):
         if timer in self.timers:
             value = time.time() - self.timers[timer].pop()
-            logging.info('timer {0}({1}): {2:.2f}ms'.format(timer, len(self.timers[timer]), value*1000))
+            logging.info('timer {0}({1}): {2:.2f}ms'.format(timer, len(self.timers[timer]), value * 1000))
             if not self.timers[timer]:
                 del self.timers[timer]
             return value
@@ -54,6 +55,7 @@
 def add_timing(f, name=None):
     if name is None:
         name = f.__name__
+
     @wraps(f)
     def wrapper(*args, **kw):
         flaskg.clock.start(name)
@@ -62,5 +64,6 @@
         return retval
     return wrapper
 
+
 def timed(name=None):
     return partial(add_timing, name=name)
--- a/MoinMoin/util/crypto.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/util/crypto.py	Mon Feb 11 04:49:04 2013 +0100
@@ -76,7 +76,7 @@
     return unicode(key), token
 
 
-def valid_token(key, token, timeout=2*60*60):
+def valid_token(key, token, timeout=2 * 60 * 60):
     """
     check if token is valid with respect to the secret key,
     the token must not be older than timeout seconds.
--- a/MoinMoin/util/diff3.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/util/diff3.py	Mon Feb 11 04:49:04 2013 +0100
@@ -10,12 +10,14 @@
                    '=========================\n',
                    '>>>>>>>>>>>>>>>>>>>>>>>>>\n')
 
+
 def text_merge(old, other, new, allow_conflicts=1, *markers):
     """ do line by line diff3 merge with three strings """
     result = merge(old.splitlines(1), other.splitlines(1), new.splitlines(1),
                    allow_conflicts, *markers)
     return ''.join(result)
 
+
 def merge(old, other, new, allow_conflicts=1, *markers):
     """ do line by line diff3 merge
         input must be lists containing single lines
@@ -36,7 +38,7 @@
             other_nr += 1
             new_nr += 1
         else:
-            if allow_conflicts == 2: # experimental addition to the algorithm
+            if allow_conflicts == 2:  # experimental addition to the algorithm
                 if other[other_nr] == new[new_nr]:
                     result.append(new[new_nr])
                     other_nr += 1
@@ -101,11 +103,11 @@
         result.extend(other[other_nr:])
     # new deleted lines
     elif (new_nr == new_len and (old_len - old_nr == other_len - other_nr) and
-          match(old, other, old_nr, other_nr, old_len-old_nr) == old_len - old_nr):
+          match(old, other, old_nr, other_nr, old_len - old_nr) == old_len - old_nr):
         pass
     # other deleted lines
-    elif (other_nr == other_len and (old_len - old_nr == new_len-new_nr) and
-          match(old, new, old_nr, new_nr, old_len-old_nr) == old_len - old_nr):
+    elif (other_nr == other_len and (old_len - old_nr == new_len - new_nr) and
+          match(old, new, old_nr, new_nr, old_len - old_nr) == old_len - old_nr):
         pass
     # conflict
     else:
@@ -121,6 +123,7 @@
             result.append(marker3)
     return result
 
+
 def tripple_match(old, other, new, other_match, new_match):
     """find next matching pattern unchanged in both other and new
        return the position in all three lists
@@ -132,7 +135,7 @@
             match_len = match(old, other, other_match[0], other_match[1],
                               difference)
             if match_len == difference:
-                return (new_match[0], other_match[1]+difference, new_match[1])
+                return (new_match[0], other_match[1] + difference, new_match[1])
             else:
                 other_match = find_match(old, other,
                                          other_match[0] + match_len,
@@ -154,6 +157,7 @@
         else:
             return (new_match[0], other_match[1], new_match[1])
 
+
 def match(list1, list2, nr1, nr2, maxcount=3):
     """ return the number matching items after the given positions
         maximum maxcount lines are are processed
@@ -169,6 +173,7 @@
             break
     return i
 
+
 def find_match(list1, list2, nr1, nr2, mincount=3):
     """searches next matching pattern with lenght mincount
        if no pattern is found len of the both lists is returned
@@ -214,6 +219,7 @@
     else:
         return (len1, len2)
 
+
 def main():
 
     text0 = """AAA 001
--- a/MoinMoin/util/diff_html.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/util/diff_html.py	Mon Feb 11 04:49:04 2013 +0100
@@ -13,6 +13,7 @@
 
 from MoinMoin.i18n import _, L_, N_
 
+
 def indent(line):
     eol = ''
     while line and line[0] == '\n':
@@ -52,7 +53,7 @@
         if lastmatch == match[0:2]:
             lastmatch = (match[0] + match[2], match[1] + match[2])
             continue
-        llineno, rlineno = lastmatch[0]+1, lastmatch[1]+1
+        llineno, rlineno = lastmatch[0] + 1, lastmatch[1] + 1
         leftpane = u''
         rightpane = u''
         linecount = max(match[0] - lastmatch[0], match[1] - lastmatch[1])
--- a/MoinMoin/util/diff_text.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/util/diff_text.py	Mon Feb 11 04:49:04 2013 +0100
@@ -8,6 +8,7 @@
 
 import difflib
 
+
 def diff(oldlines, newlines, **kw):
     """
     Find changes between oldlines and newlines.
@@ -54,12 +55,12 @@
             lcount_new = lcount_new + 1
         elif marker in ['-', '+']:
             if (count == i) and count > 3:
-                lines[:i-3] = []
+                lines[:i - 3] = []
                 i = 4
                 count = 0
             elif count > 6:
                 # remove lines and insert new hunk indicator
-                lines[i-count+3:i-3] = ['@@ -{0:d}, +{1:d} @@\n'.format(lcount_old, lcount_new)]
+                lines[i - count + 3:i - 3] = ['@@ -{0:d}, +{1:d} @@\n'.format(lcount_old, lcount_new)]
                 i = i - count + 8
                 count = 0
             else:
@@ -70,10 +71,10 @@
             else:
                 lcount_new = lcount_new + 1
         elif marker == '?':
-            lines[i:i+1] = []
+            lines[i:i + 1] = []
 
     # remove unchanged lines a the end
     if count > 3:
-        lines[-count+3:] = []
+        lines[-count + 3:] = []
 
     return lines
--- a/MoinMoin/util/filesys.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/util/filesys.py	Mon Feb 11 04:49:04 2013 +0100
@@ -7,12 +7,17 @@
 """
 
 
-import sys, os, shutil, time, errno
+import sys
+import os
+import shutil
+import time
+import errno
 from stat import S_ISDIR, ST_MODE, S_IMODE
 
 from MoinMoin import log
 logging = log.getLogger(__name__)
 
+
 #############################################################################
 ### Misc Helpers
 #############################################################################
@@ -31,6 +36,7 @@
 
 rename_overwrite = rename
 
+
 def rename_no_overwrite(oldname, newname, delete_old=False):
     """ Multiplatform rename
 
@@ -66,7 +72,9 @@
 
 def touch(name):
     if sys.platform == 'win32':
-        import win32file, win32con, pywintypes
+        import win32file
+        import win32con
+        import pywintypes
 
         access = win32file.GENERIC_WRITE
         share = (win32file.FILE_SHARE_DELETE |
@@ -104,7 +112,8 @@
                     if retry > max_retries:
                         raise
                     if err.errno == errno.EACCES:
-                        logging.warning('{0}({1!r}, {2!r}) -> access denied. retrying...'.format(fn.__name__, args, kwargs))
+                        logging.warning('{0}({1!r}, {2!r}) -> access denied. retrying...'.format(
+                            fn.__name__, args, kwargs))
                         time.sleep(0.01)
                         continue
                     raise
@@ -191,7 +200,7 @@
             st = os.stat(src)
             mode = S_IMODE(st[ST_MODE])
             if hasattr(os, 'chmod'):
-                os.chmod(dst, mode) # KEEP THIS ONE!
+                os.chmod(dst, mode)  # KEEP THIS ONE!
     else:
         shutil.copystat(src, dst)
 
--- a/MoinMoin/util/forms.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/util/forms.py	Mon Feb 11 04:49:04 2013 +0100
@@ -13,6 +13,7 @@
 
 from MoinMoin.i18n import _, L_, N_
 
+
 def label_filter(tagname, attributes, contents, context, bind):
     """Provide a translated, generated fallback for field labels."""
     if bind is not None and not contents:
@@ -20,6 +21,7 @@
     return contents
 label_filter.tags = set(['label'])
 
+
 def button_filter(tagname, attributes, contents, context, bind):
     """Show translated text in clickable buttons and submits."""
     if bind is None:
@@ -33,6 +35,7 @@
     return contents
 button_filter.tags = set(['input', 'button'])
 
+
 def required_filter(tagname, attributes, contents, context, bind):
     if (bind is not None and not bind.optional):
         attributes[u'class'] = u'required'
@@ -41,6 +44,7 @@
     return contents
 required_filter.tags = set(['input', 'label'])
 
+
 def autofocus_filter(tagname, attributes, contents, context, bind):
     if bind is not None:
         autofocus = bind.properties.get('autofocus')
@@ -49,6 +53,7 @@
     return contents
 autofocus_filter.tags = set(['input', 'textarea', ])
 
+
 def placeholder_filter(tagname, attributes, contents, context, bind):
     if bind is not None:
         placeholder = bind.properties.get('placeholder')
@@ -57,6 +62,7 @@
     return contents
 placeholder_filter.tags = set(['input', 'textarea', ])
 
+
 def error_filter_factory(class_='moin-error'):
     """Returns an HTML generation filter annotating field CSS class on error.
 
--- a/MoinMoin/util/interwiki.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/util/interwiki.py	Mon Feb 11 04:49:04 2013 +0100
@@ -88,10 +88,11 @@
                 # just want e.g. +show/42/FooBar to append it to the other wiki's
                 # base URL.
                 i = local_url.index('/%2B')
-                path = local_url[i+1:]
+                path = local_url[i + 1:]
                 url = wiki_base_url + path
     return url
 
+
 def _split_namespace(namespaces, url):
     """
     Find the longest namespace in the set.
@@ -120,6 +121,7 @@
         url = url[length:]
     return namespace, url
 
+
 def split_interwiki(wikiurl):
     """ Split a interwiki name, into wikiname and pagename, e.g:
 
@@ -162,6 +164,7 @@
             item_name = u':{0}'.format(item_name)
         return u'Self', namespace, item_name
 
+
 def join_wiki(wikiurl, wikitail, namespace):
     """
     Add a (url_quoted) page name to an interwiki url.
@@ -189,6 +192,7 @@
         wikiurl = wikiurl.replace('$NAMESPACE', namespace)
     return wikiurl
 
+
 def getInterwikiName(item_name):
     """
     Get the (fully qualified) interwiki name of a local item name.
--- a/MoinMoin/util/iri.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/util/iri.py	Mon Feb 11 04:49:04 2013 +0100
@@ -231,8 +231,10 @@
 
     def __del_scheme(self):
         self._scheme = None
+
     def __get_scheme(self):
         return self._scheme
+
     def __set_scheme(self, value):
         self._scheme = unicode(value).lower()
     scheme = property(__get_scheme, __set_scheme, __del_scheme,
@@ -240,8 +242,10 @@
 
     def __del_authority(self):
         self._authority = None
+
     def __get_authority(self):
         return self._authority
+
     def __set_authority(self, value):
         if value.__class__ is not IriAuthority:
             value = IriAuthority(value, False)
@@ -251,8 +255,10 @@
 
     def __del_path(self):
         self._path = None
+
     def __get_path(self):
         return self._path
+
     def __set_path(self, value):
         if value.__class__ is not IriPath:
             value = IriPath(value, False)
@@ -262,8 +268,10 @@
 
     def __del_query(self):
         self._query = None
+
     def __get_query(self):
         return self._query
+
     def __set_query(self, value):
         self._query = IriQuery(value, False)
     query = property(__get_query, __set_query, __del_query,
@@ -271,8 +279,10 @@
 
     def __del_fragment(self):
         self._fragment = None
+
     def __get_fragment(self):
         return self._fragment
+
     def __set_fragment(self, value):
         self._fragment = IriFragment(value, False)
     fragment = property(__get_fragment, __set_fragment, __del_fragment,
@@ -283,8 +293,12 @@
     __slots__ = '_quoted'
 
     # Rules for quoting parts of the IRI.
-    quote_rules_iri = u"""((?:%[0-9a-fA-F]{2})+)|([^-!$&'*+.0123456789=ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz|\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)"""
-    quote_rules_uri = u"""((?:%[0-9a-fA-F]{2})+)|([^-!$&'*+.0123456789=ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz|]+)"""
+    quote_rules_iri = (u"""((?:%[0-9a-fA-F]{2})+)|"""
+                       u"""([^-!$&'*+.0123456789=ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz|"""
+                       u"""\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)""")
+    quote_rules_uri = (u"""((?:%[0-9a-fA-F]{2})+)|"""
+                       u"""([^-!$&'*+.0123456789=ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz|"""
+                       u"""]+)""")
     quote_filter = frozenset()
 
     _quote_re_iri = re.compile(quote_rules_iri)
@@ -547,16 +561,20 @@
 
     def __del_userinfo(self):
         self._userinfo = None
+
     def __get_userinfo(self):
         return self._userinfo
+
     def __set_userinfo(self, value):
         self._userinfo = IriAuthorityUserinfo(value, False)
     userinfo = property(__get_userinfo, __set_userinfo, __del_userinfo)
 
     def __del_host(self):
         self._host = None
+
     def __get_host(self):
         return self._host
+
     def __set_host(self, value):
         self._host = IriAuthorityHost(value, False)
     host = property(__get_host, __set_host, __del_host)
@@ -692,11 +710,14 @@
         """
         return u'/'.join((i.urlquoted for i in self._list))
 
+
 class IriPathSegment(_Value):
     quote_filter = frozenset('@:/')
 
+
 class IriQuery(_Value):
     quote_filter = frozenset('@:/?')
 
+
 class IriFragment(_Value):
     quote_filter = frozenset('@:/?')
--- a/MoinMoin/util/mime.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/util/mime.py	Mon Feb 11 04:49:04 2013 +0100
@@ -8,6 +8,7 @@
 
 from collections import namedtuple
 
+
 class Type(namedtuple('Type', 'type subtype parameters')):
     """
     :ivar type: Type part
@@ -18,7 +19,8 @@
     :type parameters: dict
     """
 
-    __token_allowed = s = frozenset(r"""!#$%&'*+-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz{|}~""")
+    __token_allowed = s = frozenset(r"""!#$%&'*+-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"""
+                                    r"""^_`abcdefghijklmnopqrstuvwxyz{|}~""")
 
     def __new__(cls, _type=None, type=None, subtype=None, parameters=None):
         """
--- a/MoinMoin/util/mimetype.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/util/mimetype.py	Mon Feb 11 04:49:04 2013 +0100
@@ -74,7 +74,7 @@
     ('application', 'javascript'): ('text', 'javascript'),
 }
 
-MIMETYPES_spoil_mapping = {} # inverse mapping of above
+MIMETYPES_spoil_mapping = {}  # inverse mapping of above
 for _key, _value in MIMETYPES_sanitize_mapping.items():
     MIMETYPES_spoil_mapping[_value] = _key
 
@@ -83,9 +83,9 @@
     """ represents a mimetype like text/plain """
 
     def __init__(self, mimestr=None, filename=None):
-        self.major = self.minor = None # sanitized mime type and subtype
-        self.params = {} # parameters like "charset" or others
-        self.charset = None # this stays None until we know for sure!
+        self.major = self.minor = None  # sanitized mime type and subtype
+        self.params = {}  # parameters like "charset" or others
+        self.charset = None  # this stays None until we know for sure!
         self.raw_mimestr = mimestr
         self.filename = filename
         if mimestr:
@@ -108,14 +108,14 @@
         mimetype, parameters = parameters[0], parameters[1:]
         mimetype = mimetype.split('/')
         if len(mimetype) >= 2:
-            major, minor = mimetype[:2] # we just ignore more than 2 parts
+            major, minor = mimetype[:2]  # we just ignore more than 2 parts
         else:
             major, minor = self.parse_format(mimetype[0])
         self.major = major.lower()
         self.minor = minor.lower()
         for param in parameters:
             key, value = param.split('=')
-            if value[0] == '"' and value[-1] == '"': # remove quotes
+            if value[0] == '"' and value[-1] == '"':  # remove quotes
                 value = value[1:-1]
             self.params[key.lower()] = value
         if 'charset' in self.params:
--- a/MoinMoin/util/monkeypatch.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/util/monkeypatch.py	Mon Feb 11 04:49:04 2013 +0100
@@ -17,6 +17,7 @@
 import werkzeug.serving
 from werkzeug._internal import _log
 
+
 class BaseRequestHandler(werkzeug.serving.BaseRequestHandler):
     def log(self, type, message, *args):
         _log(type, "{0} {1}\n".format(self.address_string(),
--- a/MoinMoin/util/paramparser.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/util/paramparser.py	Mon Feb 11 04:49:04 2013 +0100
@@ -12,11 +12,13 @@
 class BracketError(Exception):
     pass
 
+
 class BracketUnexpectedCloseError(BracketError):
     def __init__(self, bracket):
         self.bracket = bracket
         BracketError.__init__(self, "Unexpected closing bracket {0}".format(bracket))
 
+
 class BracketMissingCloseError(BracketError):
     def __init__(self, bracket):
         self.bracket = bracket
@@ -116,8 +118,8 @@
     quoted = None       # we're inside quotes, indicates quote character used
     skipquote = 0       # next quote is a quoted quote
     noquote = False     # no quotes expected because word didn't start with one
-    seplimit_reached = False # number of separators exhausted
-    separator_count = 0 # number of separators encountered
+    seplimit_reached = False  # number of separators exhausted
+    separator_count = 0  # number of separators encountered
     SPACE = [' ', '\t', ]
     nextitemsep = [separator]   # used for skipping trailing space
     SPACE = [' ', '\t', ]
@@ -162,7 +164,7 @@
         char = args[idx]
         next = None
         if idx + 1 < max:
-            next = args[idx+1]
+            next = args[idx + 1]
         if skipquote:
             skipquote -= 1
         if not separator is None and not quoted and char in SPACE:
@@ -202,7 +204,7 @@
             quoted = char
         elif char == quoted and not skipquote:
             if next == quoted:
-                skipquote = 2 # will be decremented right away
+                skipquote = 2  # will be decremented right away
             else:
                 quoted = None
         elif not quoted and char in opening:
--- a/MoinMoin/util/plugins.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/util/plugins.py	Mon Feb 11 04:49:04 2013 +0100
@@ -11,7 +11,8 @@
 """
 
 
-import os, sys
+import os
+import sys
 import imp
 import hashlib
 
@@ -23,9 +24,11 @@
 class PluginError(Exception):
     """ Base class for plugin errors """
 
+
 class PluginMissingError(PluginError):
     """ Raised when a plugin is not found """
 
+
 class PluginAttributeError(PluginError):
     """ Raised when plugin does not contain an attribtue """
 
--- a/MoinMoin/util/profile.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/util/profile.py	Mon Feb 11 04:49:04 2013 +0100
@@ -38,7 +38,9 @@
 """
 
 
-import os, time, gc
+import os
+import time
+import gc
 
 
 class Profiler:
@@ -62,9 +64,9 @@
         self.requestsPerSample = requestsPerSample
         self.collect = collect
         self.pid = os.getpid()
-        self.count = 0 # count between somples
-        self.requests = 0 # requests added
-        self.data = {'collect': 'NA'} # Sample data
+        self.count = 0  # count between somples
+        self.requests = 0  # requests added
+        self.data = {'collect': 'NA'}  # Sample data
 
     def addRequest(self):
         """ Add a request to the profile
--- a/MoinMoin/util/pysupport.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/util/pysupport.py	Mon Feb 11 04:49:04 2013 +0100
@@ -6,7 +6,8 @@
 MoinMoin - Supporting functions for Python magic
 """
 
-import os, sys
+import os
+import sys
 import re
 import imp
 
--- a/MoinMoin/util/thread_monitor.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/util/thread_monitor.py	Mon Feb 11 04:49:04 2013 +0100
@@ -23,7 +23,7 @@
 class Monitor(object):
     def __init__(self):
         self.enabled = False
-        assert hasattr(sys, "_current_frames") # make sure we have py >= 2.5
+        assert hasattr(sys, "_current_frames")  # make sure we have py >= 2.5
 
     def activate_hook(self):
         """ Activates the thread monitor hook. Note that this might interfere
--- a/MoinMoin/util/version.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/util/version.py	Mon Feb 11 04:49:04 2013 +0100
@@ -10,6 +10,7 @@
 
 import re
 
+
 class Version(tuple):
     """
     Version objects store versions like 1.2.3a4 in a structured
--- a/MoinMoin/wikiutil.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/MoinMoin/wikiutil.py	Mon Feb 11 04:49:04 2013 +0100
@@ -39,6 +39,7 @@
 CHILD_PREFIX = "/"
 CHILD_PREFIX_LEN = len(CHILD_PREFIX)
 
+
 #############################################################################
 ### Data validation / cleanup
 #############################################################################
@@ -157,6 +158,7 @@
             itemname = itemname[CHILD_PREFIX_LEN:]
     return itemname
 
+
 def RelItemName(context, itemname):
     """
     Return the relative item name for some context.
@@ -176,7 +178,7 @@
     else:
         # some kind of sister/aunt
         context_frags = context.split('/')   # A, B, C, D, E
-        itemname_frags = itemname.split('/') # A, B, C, F
+        itemname_frags = itemname.split('/')  # A, B, C, F
         # first throw away common parents:
         common = 0
         for cf, pf in zip(context_frags, itemname_frags):
@@ -184,8 +186,8 @@
                 common += 1
             else:
                 break
-        context_frags = context_frags[common:] # D, E
-        itemname_frags = itemname_frags[common:] # F
+        context_frags = context_frags[common:]  # D, E
+        itemname_frags = itemname_frags[common:]  # F
         go_up = len(context_frags)
         return PARENT_PREFIX * go_up + '/'.join(itemname_frags)
 
@@ -229,10 +231,10 @@
     :returns: group letter or None
     """
     c = name[0]
-    if u'\uAC00' <= c <= u'\uD7AF': # Hangul Syllables
+    if u'\uAC00' <= c <= u'\uD7AF':  # Hangul Syllables
         return unichr(0xac00 + (int(ord(c) - 0xac00) / 588) * 588)
     else:
-        return c.upper() # we put lower and upper case words into the same index group
+        return c.upper()  # we put lower and upper case words into the same index group
 
 
 def is_URL(arg, schemes=URI_SCHEMES):
@@ -255,6 +257,7 @@
     """ Returns true if there is a conflict marker in the text. """
     return "/!\\ '''Edit conflict" in text
 
+
 def anchor_name_from_text(text):
     """
     Generate an anchor name from the given text.
@@ -270,6 +273,7 @@
         return 'A{0}'.format(res)
     return res
 
+
 def split_anchor(pagename):
     """
     Split a pagename that (optionally) has an anchor into the real pagename
--- a/_ui_tests/conftest.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/_ui_tests/conftest.py	Mon Feb 11 04:49:04 2013 +0100
@@ -12,6 +12,7 @@
 sys.path.append(os.path.dirname(__file__))
 import driver_register
 
+
 def pytest_runtest_makereport(item, call):
     """
     Entry point for event which occurs after each test has run
--- a/_ui_tests/driver_register.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/_ui_tests/driver_register.py	Mon Feb 11 04:49:04 2013 +0100
@@ -9,6 +9,7 @@
 
 driver = None
 
+
 def register_driver(driver_):
     """
     set the driver global variable to driver_
@@ -16,6 +17,7 @@
     global driver
     driver = driver_
 
+
 def get_driver():
     """
     get the value of the driver global variable
--- a/_ui_tests/test_subitems.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/_ui_tests/test_subitems.py	Mon Feb 11 04:49:04 2013 +0100
@@ -2,6 +2,7 @@
 # License: GNU GPL v3 (or any later version), see LICENSE.txt for details.
 
 """Functional test: create subitem"""
+
 import config
 import utils
 
--- a/_ui_tests/utils.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/_ui_tests/utils.py	Mon Feb 11 04:49:04 2013 +0100
@@ -3,9 +3,11 @@
 # License: GNU GPL v3 (or any later version), see LICENSE.txt for details.
 
 """Functions to facilitate functional testing"""
-import pytest
 
 import random
+import urllib
+
+import pytest
 
 try:
     from selenium import webdriver
@@ -13,7 +15,6 @@
     pytest.skip('selenium needs to be installed for this test')
 
 import config
-import urllib
 
 try:
     f = urllib.urlopen(config.BASE_URL)
@@ -31,7 +32,7 @@
     profile = webdriver.FirefoxProfile()
     profile.set_preference("intl.accept_languages", "en")
     driver = webdriver.Firefox(firefox_profile=profile)
-    driver_register.register_driver(driver) # register with
+    driver_register.register_driver(driver)  # register with
     # driver_register, which is needed so that printscreen on test
     # failure works
     driver.implicitly_wait(20)
@@ -42,7 +43,7 @@
     """
     generates a random string containing numbers, of length 'length'
     """
-    word = unicode(random.randint(10**(length-1), 10**length))
+    word = unicode(random.randint(10 ** (length - 1), 10 ** length))
     return word
 
 
--- a/contrib/pep8/DeleteTrailingSpaces.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/contrib/pep8/DeleteTrailingSpaces.py	Mon Feb 11 04:49:04 2013 +0100
@@ -12,7 +12,8 @@
 from anywhere within the contrib path.
 """
 
-import sys, os
+import sys
+import os
 import warnings
 warnings.simplefilter("once")
 
--- a/contrib/wsgi/profiler.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/contrib/wsgi/profiler.py	Mon Feb 11 04:49:04 2013 +0100
@@ -23,6 +23,7 @@
 from MoinMoin import log
 logging = log.getLogger(__name__)
 
+
 class ProfilerMiddleware(object):
     """ Abstract base class for profiling middlewares.
 
@@ -62,6 +63,7 @@
         """ Override in subclasses to clean up when server/script shuts down. """
         pass
 
+
 class CProfileMiddleware(ProfilerMiddleware):
     """ A profiler based on the the cProfile module from the standard lib. """
     def __init__(self, app, filename):
@@ -74,6 +76,7 @@
     def shutdown(self):
         self._profile.dump_stats(self._filename)
 
+
 class HotshotMiddleware(ProfilerMiddleware):
     """ A profiler based on the more recent hotshot module from the stdlib. """
     def __init__(self, app, *args, **kwargs):
@@ -85,6 +88,7 @@
     def shutdown(self):
         self._profile.close()
 
+
 class PycallgraphMiddleware(ProfilerMiddleware):
     """ A call graphing middleware utilizing the pycallgraph 3rd party
     module (available at http://pycallgraph.slowchop.com/). """
--- a/contrib/wsgi/proxy.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/contrib/wsgi/proxy.py	Mon Feb 11 04:49:04 2013 +0100
@@ -8,6 +8,7 @@
     @license: GNU GPL, see COPYING for details.
 """
 
+
 class ProxyTrust(object):
     """
     Middleware that rewrites the remote address according to trusted
--- a/contrib/wsgi/raw_wsgi_bench.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/contrib/wsgi/raw_wsgi_bench.py	Mon Feb 11 04:49:04 2013 +0100
@@ -5,7 +5,10 @@
     @copyright: 2008 MoinMoin:FlorianKrupicka
     @license: GNU GPL, see COPYING for details.
 """
-import time, itertools, sys, os
+import time
+import itertools
+import sys
+import os
 
 from werkzeug.test import Client
 
--- a/setup.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/setup.py	Mon Feb 11 04:49:04 2013 +0100
@@ -3,7 +3,8 @@
 # Copyright: 2001-2012 MoinMoin:ThomasWaldmann
 # License: GNU GPL v2 (or any later version), see LICENSE.txt for details.
 
-import sys, os
+import sys
+import os
 
 from MoinMoin import project, version
 
@@ -80,29 +81,29 @@
         'https://bitbucket.org/thomaswaldmann/emeraldtree/get/tip.tar.gz#egg=emeraldtree-0.9.2',
     ],
     install_requires=[
-        'blinker>=1.1', # event signalling (e.g. for change notification trigger)
-        'docutils>=0.8.1', # reST markup processing
-        'Markdown>=2.1.1', # Markdown markup processing
-        'Flask>=0.8', # micro framework
-        'Flask-Babel>=0.7', # i18n support
-        'Flask-Cache>=0.3.4', # caching support
-        'Flask-Script>=0.3.3', # scripting support
-        'Flask-Themes>=0.1.3.1', # theme support
-        'emeraldtree>=0.9.2', # xml processing
-        'flatland==dev', # repo checkout at revision 269:6c5d262d7eff works
-        'Jinja2>=2.6', # template engine
-        'pygments>=1.4', # src code / text file highlighting
-        'Werkzeug>=0.8.1', # wsgi toolkit
-        'pytest>=2.1, <2.3', # pytest is needed by unit tests
-                             # note: currently 2.3.x is not compatible with our test code,
-                             # likely due to the fixtures changes.
-        'pytest-pep8<1.0.3', # coding style checker
-                             # note: pytest-pep8 1.0.3 needs pytest 2.3
-        'whoosh>=2.4.0', # needed for indexed search
-        'sphinx>=1.1', # needed to build the docs
-        'pdfminer', # pdf -> text/plain conversion
-        'passlib>=1.6.0', # strong password hashing (1.6 needed for consteq)
-        'XStatic>=0.0.2', # support for static file pypi packages
+        'blinker>=1.1',  # event signalling (e.g. for change notification trigger)
+        'docutils>=0.8.1',  # reST markup processing
+        'Markdown>=2.1.1',  # Markdown markup processing
+        'Flask>=0.8',  # micro framework
+        'Flask-Babel>=0.7',  # i18n support
+        'Flask-Cache>=0.3.4',  # caching support
+        'Flask-Script>=0.3.3',  # scripting support
+        'Flask-Themes>=0.1.3.1',  # theme support
+        'emeraldtree>=0.9.2',  # xml processing
+        'flatland==dev',  # repo checkout at revision 269:6c5d262d7eff works
+        'Jinja2>=2.6',  # template engine
+        'pygments>=1.4',  # src code / text file highlighting
+        'Werkzeug>=0.8.1',  # wsgi toolkit
+        'pytest>=2.1, <2.3',  # pytest is needed by unit tests
+                              # note: currently 2.3.x is not compatible with our test code,
+                              # likely due to the fixtures changes.
+        'pytest-pep8<1.0.3',  # coding style checker
+                              # note: pytest-pep8 1.0.3 needs pytest 2.3
+        'whoosh>=2.4.0',  # needed for indexed search
+        'sphinx>=1.1',  # needed to build the docs
+        'pdfminer',  # pdf -> text/plain conversion
+        'passlib>=1.6.0',  # strong password hashing (1.6 needed for consteq)
+        'XStatic>=0.0.2',  # support for static file pypi packages
         'XStatic-CKEditor>=3.6.1.2',
         'XStatic-jQuery>=1.8.2',
         'XStatic-jQuery-File-Upload>=4.4.2',
@@ -115,14 +116,14 @@
     # optional features and their list of requirements
     extras_require={
         #'featurename': ["req1", "req2", ],
-        'pil': ["PIL"], # used by image get for scaling/rotating/etc.
-                        # PIL is a binary dependency and some features of it
-                        # require special libs/header to be installed before
-                        # it can be compiled successfully
-        'ldap': ["python-ldap>=2.0.0"], # used by ldap auth
-        'openid': ["python-openid>=2.2.4"], # used by openid rp auth
-        'sqla': ["sqlalchemy>=0.7.1"], # used by sqla store
-        'mongodb': ["pymongo"], # used by mongodb store
+        'pil': ["PIL"],  # used by image get for scaling/rotating/etc.
+                         # PIL is a binary dependency and some features of it
+                         # require special libs/header to be installed before
+                         # it can be compiled successfully
+        'ldap': ["python-ldap>=2.0.0"],  # used by ldap auth
+        'openid': ["python-openid>=2.2.4"],  # used by openid rp auth
+        'sqla': ["sqlalchemy>=0.7.1"],  # used by sqla store
+        'mongodb': ["pymongo"],  # used by mongodb store
     },
     entry_points=dict(
         console_scripts=['moin = MoinMoin.script:main'],
--- a/wikiconfig.py	Sun Feb 10 23:54:13 2013 +0100
+++ b/wikiconfig.py	Mon Feb 11 04:49:04 2013 +0100
@@ -25,7 +25,7 @@
     #          intermap.txt
     # If that's not true, feel free to adjust the pathes.
     instance_dir = os.path.join(wikiconfig_dir, 'wiki')
-    data_dir = os.path.join(instance_dir, 'data') # Note: this used to have a trailing / in the past
+    data_dir = os.path.join(instance_dir, 'data')  # Note: this used to have a trailing / in the past
     index_storage = 'FileStorage', (os.path.join(instance_dir, "index"), ), {}
 
     # This provides a simple default setup for your backend configuration.
@@ -76,7 +76,7 @@
         serve_files.update([(xs.name, xs.base_dir)])
 
 
-MOINCFG = Config # Flask only likes uppercase stuff
+MOINCFG = Config  # Flask only likes uppercase stuff
 # Flask settings - see the flask documentation about their meaning
 SECRET_KEY = 'you need to change this so it is really secret'
 #DEBUG = False # use True for development only, not for public sites!