Commits

Thomas Waldmann committed 791bded

fix lots of pep8 issues, mainly E12x

  • Participants
  • Parent commits e317d66

Comments (0)

Files changed (81)

File MoinMoin/_tests/ldap_testbase.py

 
 class Slapd(object):
     """ Manage a slapd process for testing purposes """
-    def __init__(self,
-                 config=None,  # config filename for -f
-                 executable=SLAPD_EXECUTABLE,
-                 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
-                ):
+    def __init__(
+        self,
+        config=None,  # config filename for -f
+        executable=SLAPD_EXECUTABLE,
+        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
+    ):
         self.executable = executable
         self.config = config
         self.debug_flags = debug_flags
 #set_tas_spins 0
 """
 
-    def __init__(self,
-                 basedn,
-                 rootdn, rootpw,
-                 instance=0,  # use different values when running multiple LdapEnvironments
-                 schema_dir='/etc/ldap/schema',  # directory with schemas
-                 coding='utf-8',  # coding used for config files
-                 timeout=10,  # how long to wait for slapd starting [s]
-                ):
+    def __init__(
+        self,
+        basedn,
+        rootdn, rootpw,
+        instance=0,  # use different values when running multiple LdapEnvironments
+        schema_dir='/etc/ldap/schema',  # directory with schemas
+        coding='utf-8',  # coding used for config files
+        timeout=10,  # how long to wait for slapd starting [s]
+    ):
         self.basedn = basedn
         self.rootdn = rootdn
         self.rootpw = rootpw
             started = self.ldap_env.start_slapd()
             if not started:
                 pytest.skip("Failed to start {0} process, please see your syslog / log files"
-                             " (and check if stopping apparmor helps, in case you use it).".format(SLAPD_EXECUTABLE))
+                            " (and check if stopping apparmor helps, in case you use it).".format(SLAPD_EXECUTABLE))
             self.ldap_env.load_directory(ldif_content=self.ldif_content)
 
         def teardown_class(self):

File MoinMoin/_tests/test_test_environ.py

 
 
 CONTENT_ACL = dict(
-        before="+All:write",  # need to write to sys pages
-        default="All:read,write,admin,create,destroy",
-        after="Me:create",
-        hierarchic=False,
+    before="+All:write",  # need to write to sys pages
+    default="All:read,write,admin,create,destroy",
+    after="Me:create",
+    hierarchic=False,
 )
 
 

File MoinMoin/_tests/test_user.py

             u' User Name',
             u'User Name ',
             u'User   Name',
-            )
+        )
         for test in cases:
             assert not user.isValidName(test)
 
             u'ניר סופר',  # Hebrew
             u'CamelCase',  # Good old camel case
             u'가각간갇갈 갉갊감 갬갯걀갼'  # Hangul (gibberish)
-            )
+        )
         for test in cases:
             assert user.isValidName(test)
 

File MoinMoin/_tests/test_wikiutil.py

 
 class TestCleanInput(object):
     def testCleanInput(self):
-        tests = [(u"", u""),  # empty
-                 (u"aaa\r\n\tbbb", u"aaa   bbb"),  # ws chars -> blanks
-                 (u"aaa\x00\x01bbb", u"aaabbb"),  # strip weird chars
-                 (u"a" * 500, u""),  # too long
-                ]
+        tests = [
+            (u"", u""),  # empty
+            (u"aaa\r\n\tbbb", u"aaa   bbb"),  # ws chars -> blanks
+            (u"aaa\x00\x01bbb", u"aaabbb"),  # strip weird chars
+            (u"a" * 500, u""),  # too long
+        ]
         for instr, outstr in tests:
             assert wikiutil.clean_input(instr) == outstr
 
             (u'a/', u'a'),
             (u'a/////b/////c', u'a/b/c'),
             (u'a b/////c d/////e f', u'a b/c d/e f'),
-            )
+        )
         for test, expected in cases:
             result = wikiutil.normalize_pagename(test, app.cfg)
             assert result == expected
             (u'a   b  /  c    d  /  e   f', u'a b/c d/e f'),
             # All 30 unicode spaces
             (CHARS_SPACES, u''),
-            )
+        )
         for test, expected in cases:
             result = wikiutil.normalize_pagename(test, app.cfg)
             assert result == expected
             (u'a  ', u'a'),
             (u'a  b  c', u'a b c'),
             (u'a  b  /  c  d  /  e  f', u'a b/c d/e f'),
-            )
+        )
         for test, expected in cases:
             result = wikiutil.normalize_pagename(test, app.cfg)
             assert result == expected
             (u'Name,:Group', u'NameGroup'),
             # remove than normalize spaces
             (u'Name ! @ # $ % ^ & * ( ) + Group', u'Name Group'),
-            )
+        )
         for test, expected in cases:
             # validate we are testing valid group names
             if wikiutil.isGroupItem(test):
 
 def testfile_headers():
     test_headers = [
-                #test_file, content_type
-                ('imagefile.gif', 'image/gif'),
-                ('testfile.txt', 'text/plain'),
-                ('pdffile.pdf', 'application/pdf'),
-                ('docfile.doc', 'application/msword'),
-                (None, 'application/octet-stream')
-                ]
+        # test_file, content_type
+        ('imagefile.gif', 'image/gif'),
+        ('testfile.txt', 'text/plain'),
+        ('pdffile.pdf', 'application/pdf'),
+        ('docfile.doc', 'application/msword'),
+        (None, 'application/octet-stream'),
+    ]
 
     for test_file, content_type in test_headers:
         result = wikiutil.file_headers(test_file, None, 10)

File MoinMoin/app.py

 
 
 def create_app_ext(flask_config_file=None, flask_config_dict=None,
-                   moin_config_class=None, warn_default=True, **kwargs
-                  ):
+                   moin_config_class=None, warn_default=True, **kwargs):
     """
     Factory for moin wsgi apps
 

File MoinMoin/apps/admin/views.py

                           email=rev.meta[EMAIL],
                           disabled=False,  # TODO: add to index
                           groups=[groupname for groupname in groups if rev.meta[NAME] in groups[groupname]],
-                     )
-                     for rev in revs]
+                     ) for rev in revs]
     return render_template('admin/userbrowser.html', user_accounts=user_accounts, title_name=_(u"Users"))
 
 
 def highlighterhelp():
     """display a table with list of available Pygments lexers"""
     import pygments.lexers
-    headings = [_('Lexer description'),
-                _('Lexer names'),
-                _('File patterns'),
-                _('Mimetypes'),
-               ]
+    headings = [
+        _('Lexer description'),
+        _('Lexer names'),
+        _('File patterns'),
+        _('Mimetypes'),
+    ]
     lexers = pygments.lexers.get_all_lexers()
     rows = sorted([[desc, ' '.join(names), ' '.join(patterns), ' '.join(mimetypes), ]
                    for desc, names, patterns, mimetypes in lexers])
 @admin.route('/interwikihelp', methods=['GET', ])
 def interwikihelp():
     """display a table with list of known interwiki names / urls"""
-    headings = [_('InterWiki name'),
-                _('URL'),
-               ]
+    headings = [
+        _('InterWiki name'),
+        _('URL'),
+    ]
     rows = sorted(app.cfg.interwiki_map.items())
     return render_template('user/interwikihelp.html',
                            title_name=_(u"Interwiki Names"),
 @admin.route('/itemsize', methods=['GET', ])
 def itemsize():
     """display a table with item sizes"""
-    headings = [_('Size'),
-                _('Item name'),
-               ]
+    headings = [
+        _('Size'),
+        _('Item name'),
+    ]
     rows = [(rev.meta[SIZE], rev.name)
             for rev in flaskg.storage.documents(wikiname=app.cfg.interwikiname)]
     rows = sorted(rows, reverse=True)

File MoinMoin/apps/feed/views.py

                      author=author,
                      url=url_for_item(name, rev=this_revid, _external=True),
                      updated=datetime.fromtimestamp(rev.meta[MTIME]),
-                    )
+            )
         content = feed.to_string()
         # Hack to add XSLT stylesheet declaration since AtomFeed doesn't allow this
         content = content.split("\n")

File MoinMoin/apps/frontend/_tests/test_frontend.py

         self._test_view_post('frontend.ajaxdelete', status='200 OK', content_types=['application/json', ], data=['{', '}'], form=dict(
             comment='Test',
             itemnames='["DoesntExist"]',
-            ), viewopts=dict(item_name='DoesntExist'))
+        ), viewopts=dict(item_name='DoesntExist'))
 
     def test_ajaxdelete_no_item_name_route(self):
         self._test_view_post('frontend.ajaxdelete', status='200 OK', content_types=['application/json', ], data=['{', '}'], form=dict(
             comment='Test',
             itemnames='["DoesntExist"]',
-            ))
+        ))
 
     def test_ajaxdestroy_item_name_route(self):
         self._test_view_post('frontend.ajaxdestroy', status='200 OK', content_types=['application/json', ], data=['{', '}'], form=dict(
             comment='Test',
             itemnames='["DoesntExist"]',
-            ), viewopts=dict(item_name='DoesntExist'))
+        ), viewopts=dict(item_name='DoesntExist'))
 
     def test_ajaxdestroy_no_item_name_route(self):
         self._test_view_post('frontend.ajaxdestroy', status='200 OK', content_types=['application/json', ], data=['{', '}'], form=dict(
             comment='Test',
             itemnames='["DoesntExist"]',
-            ))
+        ))
 
     def test_ajaxmodify(self):
         self._test_view_post('frontend.ajaxmodify', status='404 NOT FOUND', viewopts=dict(item_name='DoesntExist'))
     def test_jfu_server(self):
         self._test_view_post('frontend.jfu_server', status='200 OK', data=['{', '}'], form=dict(
             data_file=FileStorage(StringIO("Hello, world"), filename='C:\\fakepath\\DoesntExist.txt', content_type='text/plain'),
-            ), viewopts=dict(item_name='WillBeCreated'), content_types=['application/json', ])
+        ), viewopts=dict(item_name='WillBeCreated'), content_types=['application/json', ])
 
     def test_show_item(self):
         self._test_view('frontend.show_item', status='404 NOT FOUND', viewopts=dict(item_name='DoesntExist'))
         """ helper to fill UserSettingsPasswordForm form
         """
         FormClass = views.UserSettingsPasswordForm
-        request_form = ImmutableMultiDict(
-           [
-              ('usersettings_password_password_current', current_password),
-              ('usersettings_password_password1', password1),
-              ('usersettings_password_password2', password2),
-              ('usersettings_password_submit', u'Save')
-           ]
-        )
+        request_form = ImmutableMultiDict([
+            ('usersettings_password_password_current', current_password),
+            ('usersettings_password_password1', password1),
+            ('usersettings_password_password2', password2),
+            ('usersettings_password_submit', u'Save')
+        ])
         form = FormClass.from_flat(request_form)
         return form
 

File MoinMoin/apps/frontend/views.py

                                            title_name=title_name,
                                            lookup_form=lookup_form,
                                            results=results,
-                                          )
+                    )
                     flaskg.clock.stop('lookup render')
                     if not num_results:
                         status = 404
     html = render_template('lookup.html',
                            title_name=title_name,
                            lookup_form=lookup_form,
-                          )
+    )
     return Response(html, status)
 
 
                                    query=query,
                                    medium_search_form=search_form,
                                    item_name=item_name,
-                                  )
+            )
             flaskg.clock.stop('search render')
     else:
         html = render_template('search.html',
                                query=query,
                                medium_search_form=search_form,
                                item_name=item_name,
-                              )
+        )
     return html
 
 
         status = 200
     content = render_template('dom.xml',
                               data_xml=Markup(item.content._render_data_xml()),
-                             )
+    )
     return Response(content, status, mimetype='text/xml')
 
 
     return render_template('highlight.html',
                            item=item, item_name=item.name,
                            data_text=Markup(item.content._render_data_highlight()),
-                          )
+    )
 
 
 @presenter('meta', add_trail=True)
                            meta_rendered=Markup(item._render_meta()),
                            show_revision=show_revision,
                            show_navigation=show_navigation,
-                          )
+    )
 
 
 @frontend.route('/+content/+<rev>/<itemname:item_name>')
                            item=item, item_name=item_name,
                            rev_id=rev,
                            form=form,
-                          )
+    )
 
 
 @frontend.route('/+rename/<itemname:item_name>', methods=['GET', 'POST'])
     return render_template(item.rename_template,
                            item=item, item_name=item_name,
                            form=form,
-                          )
+    )
 
 
 @frontend.route('/+delete/<itemname:item_name>', methods=['GET', 'POST'])
     return render_template(item.delete_template,
                            item=item, item_name=item_name,
                            form=form,
-                          )
+    )
 
 
 @frontend.route('/+ajaxdelete/<itemname:item_name>', methods=['POST'])
                            item=item, item_name=item_name,
                            rev_id=rev,
                            form=form,
-                          )
+    )
 
 
 @frontend.route('/+jfu-server/<itemname:item_name>', methods=['POST'])
                        size=size,
                        url=url_for('.show_item', item_name=item_name, rev=revid),
                        contenttype=contenttype_to_class(contenttype),
-                      )
+        )
     except AccessDenied:
         abort(403)
 
                            initials=initials,
                            startswith=startswith,
                            form=form,
-                          )
+    )
 
 
 @frontend.route('/+mychanges')
                            title_name=_(u'My Changes'),
                            headline=_(u'My Changes'),
                            item_names=my_changes
-                          )
+    )
 
 
 def _mychanges(userid):
                            item_name=item_name,
                            headline=_(u"Items which refer to '%(item_name)s'", item_name=item_name),
                            item_names=refs_here
-                          )
+    )
 
 
 def _backrefs(item_name):
                            item_name=item_name,  # XXX no item here
                            history_page=history_page,
                            bookmark_time=bookmark_time,
-                          )
+    )
 
 
 @frontend.route('/+history')
                            history=history,
                            current_timestamp=current_timestamp,
                            bookmark_time=bookmark_time,
-                          )
+    )
 
 
 def _compute_item_sets():
         # Try to unsubscribe
         if not u.unsubscribe(item_name):
             msg = _("Can't remove regular expression subscription!") + u' ' + \
-                  _("Edit the subscription regular expressions in your settings."), "error"
+                _("Edit the subscription regular expressions in your settings."), "error"
     else:
         # Try to subscribe
         if not u.subscribe(item_name):
                     else:
                         flash(_('An error occurred while sending the verification email: "%(message)s" '
                                 'Please contact an administrator to activate your account.',
-                            message=msg), "error")
+                                message=msg), "error")
                 else:
                     flash(_('Account created, please log in now.'), "info")
                 return redirect(url_for('.show_root'))
     return render_template(template,
                            title_name=title_name,
                            form=form,
-                          )
+    )
 
 
 @frontend.route('/+verifyemail', methods=['GET'])
     return render_template('lostpass.html',
                            title_name=title_name,
                            form=form,
-                          )
+    )
 
 
 class ValidPasswordRecovery(Validator):
     return render_template('recoverpass.html',
                            title_name=title_name,
                            form=form,
-                          )
+    )
 
 
 class ValidLogin(Validator):
                            title_name=title_name,
                            login_inputs=app.cfg.auth_login_inputs,
                            form=form,
-                          )
+    )
 
 
 @frontend.route('/+logout')
                 response['form'] = render_template('usersettings_ajax.html',
                                                    part=part,
                                                    form=form,
-                                                  )
+                )
                 return jsonify(**response)
             else:
                 # if it is not a XHR request but there is an redirect pending, we use a normal HTTP redirect
     return render_template('usersettings.html',
                            title_name=title_name,
                            form_objs=forms,
-                          )
+    )
 
 
 @frontend.route('/+bookmark')
                            last_rev_id=rev_ids[-1],
                            oldrev=oldrev,
                            newrev=newrev,
-                          )
+    )
 
 
 def _diff_raw(item, revid1, revid2):
     return render_template('sitemap.html',
                            item_name=item_name,  # XXX no item
                            sitemap=sitemap,
-                          )
+    )
 
 
 class NestedItemListBuilder(object):

File MoinMoin/auth/__init__.py

                  remove_blanks=False,  # Joe Doe -> JoeDoe
                  coding='utf-8',  # for decoding REMOTE_USER correctly
                  **kw
-                ):
+    ):
         super(GivenAuth, self).__init__(**kw)
         self.env_var = env_var
         self.user_name = user_name
               'openid': kw.get('login_openid'),
               'multistage': (stage and True) or None,
               'attended': True
-             }
+    }
     # add the other parameters from the form
     for param in kw.keys():
         params[param] = kw.get(param)

File MoinMoin/auth/_tests/test_ldap_login.py

             started = ldap_env.start_slapd()
             if not started:
                 pytest.skip("Failed to start {0} process, please see your syslog / log files"
-                             " (and check if stopping apparmor helps, in case you use it).".format(SLAPD_EXECUTABLE))
+                            " (and check if stopping apparmor helps, in case you use it).".format(SLAPD_EXECUTABLE))
             ldap_env.load_directory(ldif_content=self.ldif_content)
             self.ldap_envs.append(ldap_env)
 
             started = ldap_env.start_slapd()
             if not started:
                 pytest.skip("Failed to start {0} process, please see your syslog / log files"
-                             " (and check if stopping apparmor helps, in case you use it).".format(SLAPD_EXECUTABLE))
+                            " (and check if stopping apparmor helps, in case you use it).".format(SLAPD_EXECUTABLE))
             ldap_env.load_directory(ldif_content=self.ldif_content)
             self.ldap_envs.append(ldap_env)
 
         server_uri = 'ldap://127.0.0.1:3891'
         base_dn = 'ou=testing,dc=example,dc=org'
         ldap_auth1 = LDAPAuth(server_uri=server_uri, base_dn=base_dn,
-                             name="ldap1", autocreate=True,
-                             timeout=1)
+                              name="ldap1", autocreate=True,
+                              timeout=1)
         # short timeout, faster testing
         server_uri = 'ldap://127.0.0.1:3892'
         ldap_auth2 = LDAPAuth(server_uri=server_uri, base_dn=base_dn,
-                             name="ldap2", autocreate=True,
-                             timeout=1)
+                              name="ldap2", autocreate=True,
+                              timeout=1)
 
         auth = [ldap_auth1, ldap_auth2]
 

File MoinMoin/auth/ldap_login.py

     logout_possible = True
     name = 'ldap'
 
-    def __init__(self,
+    def __init__(
+        self,
         server_uri='ldap://localhost',  # ldap / active directory server URI
                                         # use ldaps://server:636 url for ldaps,
                                         # use  ldap://server for ldap without tls (and set start_tls to 0),
         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)
         self.server_uri = server_uri
         self.bind_dn = bind_dn
                 filterstr = self.search_filter % locals()
                 logging.debug("Searching {0!r}".format(filterstr))
                 attrs = [getattr(self, attr) for attr in [
-                                         'email_attribute',
-                                         'displayname_attribute',
-                                         'surname_attribute',
-                                         'givenname_attribute',
-                                         ] if getattr(self, attr) is not None]
+                    'email_attribute',
+                    'displayname_attribute',
+                    'surname_attribute',
+                    'givenname_attribute',
+                ] if getattr(self, attr) is not None]
                 lusers = l.search_st(self.base_dn, self.scope, filterstr.encode(coding),
                                      attrlist=attrs, timeout=self.timeout)
                 # we remove entries with dn == None to get the real result list:

File MoinMoin/auth/openidrp.py

                                                            _external=True,
                                                            openid_openid=identity,
                                                            openid_submit='1'
-                                                          ))
+                    ))
 
             # not trusted
             return ContinueLogin(None, _('This OpenID provider is not trusted.'))

File MoinMoin/auth/smb_mount.py

 
         See man mount.cifs for details.
     """
-    def __init__(self,
+    def __init__(
+        self,
         server,  # mount.cifs //server/share
         share,  # mount.cifs //server/share
         mountpoint_fn,  # function of username to determine the mountpoint, e.g.:
         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)
         self.server = server
         self.share = share

File MoinMoin/config/default.py

         error message with unknown names.
         """
         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(re), type(DefaultConfig)))]
+                   if not name.startswith('_') and
+                   name not in DefaultConfig.__dict__ and
+                   not isinstance(getattr(self, name), (type(re), type(DefaultConfig)))]
         if unknown:
             msg = """
 Unknown configuration options: {0}.
 
     keyboards = (ur"`1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./",  # US kbd
                  ur"^1234567890ß´qwertzuiopü+asdfghjklöä#yxcvbnm,.-",  # german kbd
-                )  # TODO add more keyboards!
+    )  # TODO add more keyboards!
     for kbd in keyboards:
         rev_kbd = kbd[::-1]
         if password in kbd or password in rev_kbd or \
 # information on the layout of this structure.
 #
 options_no_group_name = {
-  # ==========================================================================
-  'datastruct': ('Datastruct', None, (
-    #('dicts', lambda cfg: datastruct.ConfigDicts({}),
-    ('dicts', lambda cfg: datastruct.WikiDicts(),
-     "function f(cfg) that returns a backend which is used to access dicts definitions."),
-    #('groups', lambda cfg: datastruct.ConfigGroups({}),
-    ('groups', lambda cfg: datastruct.WikiGroups(),
-     "function f(cfg) that returns a backend which is used to access groups definitions."),
-  )),
-  # ==========================================================================
-  'auth': ('Authentication / Authorization / Security', None, (
-    ('auth', DefaultExpression('[MoinAuth()]'),
-     "list of auth objects, to be called in this order (see HelpOnAuthentication)"),
-    ('secrets', None, """Either a long shared secret string used for multiple purposes or a dict {"purpose": "longsecretstring", ...} for setting up different shared secrets for different purposes."""),
-    ('SecurityPolicy',
-     DefaultSecurityPolicy,
-     "Class object hook for implementing security restrictions or relaxations"),
-    ('endpoints_excluded',
-     [],
-     "Exclude unwanted endpoints (list of strings)"),
+    # ==========================================================================
+    'datastruct': ('Datastruct', None, (
+        # ('dicts', lambda cfg: datastruct.ConfigDicts({}),
+        ('dicts', lambda cfg: datastruct.WikiDicts(),
+         "function f(cfg) that returns a backend which is used to access dicts definitions."),
+        # ('groups', lambda cfg: datastruct.ConfigGroups({}),
+        ('groups', lambda cfg: datastruct.WikiGroups(),
+         "function f(cfg) that returns a backend which is used to access groups definitions."),
+    )),
+    # ==========================================================================
+    'auth': ('Authentication / Authorization / Security', None, (
+        ('auth', DefaultExpression('[MoinAuth()]'),
+         "list of auth objects, to be called in this order (see HelpOnAuthentication)"),
+        ('secrets', None, """Either a long shared secret string used for multiple purposes or a dict {"purpose": "longsecretstring", ...} for setting up different shared secrets for different purposes."""),
+        ('SecurityPolicy',
+         DefaultSecurityPolicy,
+         "Class object hook for implementing security restrictions or relaxations"),
+        ('endpoints_excluded',
+         [],
+         "Exclude unwanted endpoints (list of strings)"),
+        ('password_checker', DefaultExpression('_default_password_checker'),
+         'checks whether a password is acceptable (default check is length >= 6, at least 4 different chars, no keyboard sequence, not username used somehow (you can switch this off by using `None`)'),
 
-    ('password_checker', DefaultExpression('_default_password_checker'),
-     'checks whether a password is acceptable (default check is length >= 6, at least 4 different chars, no keyboard sequence, not username used somehow (you can switch this off by using `None`)'),
+        ('passlib_crypt_context', dict(
+            # schemes we want to support (or deprecated schemes for which we still have
+            # hashes in our storage).
+            # note about bcrypt: it needs additional code (that is not pure python and
+            # thus either needs compiling or installing platform-specific binaries)
+            schemes=["sha512_crypt", ],
+            # default scheme for creating new pw hashes (if not given, passlib uses first from schemes)
+            #default="sha512_crypt",
+            # deprecated schemes get auto-upgraded to the default scheme at login
+            # time or when setting a password (including doing a moin account pwreset).
+            #deprecated=["auto"],
+            # vary rounds parameter randomly when creating new hashes...
+            #all__vary_rounds=0.1,
+        ), "passlib CryptContext arguments, see passlib docs"),
+    )),
+    # ==========================================================================
+    'spam_leech_dos': ('Anti-Spam / Leech / DOS', 'These settings help limiting ressource usage and avoiding abuse.', (
+        ('textchas', None,
+         "Spam protection setup using site-specific questions/answers, see HelpOnSpam."),
+        ('textchas_expiry_time', 600,
+         "Time [s] for a !TextCha to expire."),
+    )),
+    # ==========================================================================
+    'style': ('Style / Theme / UI', 'These settings control how the wiki user interface will look like.', (
+        ('sitename', u'Untitled Wiki',
+         "Short description of your wiki site, displayed below the logo on each page, and used in RSS documents as the channel title [Unicode]"),
+        ('interwikiname', None, "unique, stable and required InterWiki name (prefix, moniker) of the site [Unicode]"),
+        ('html_pagetitle', None, "Allows you to set a specific HTML page title (if None, it defaults to the value of `sitename`) [Unicode]"),
+        ('navi_bar', [
+            ('wikilink', 'frontend.show_root', dict(), L_('Home'), L_('Home Page')),
+            ('wikilink', 'frontend.global_history', dict(), L_('History'), L_('Global History')),
+            ('wikilink', 'frontend.index', dict(), L_('Index'), L_('Global Index')),
+            ('wikilink', 'frontend.global_tags', dict(), L_('Tags'), L_('Global Tags Index')),
+            ('wikilink', 'admin.index_user', dict(), L_('User'), L_('User')),
+            ('wikilink', 'admin.index', dict(), L_('Admin'), L_('Administration & Docs')),
+        ], 'Data to create the navi_bar from. Users can add more items in their quick links in user preferences. You need to configure a list of tuples (css_class, endpoint, args, label, title). Use L_() for translating. [list of tuples]'),
 
-    ('passlib_crypt_context', dict(
-        # schemes we want to support (or deprecated schemes for which we still have
-        # hashes in our storage).
-        # note about bcrypt: it needs additional code (that is not pure python and
-        # thus either needs compiling or installing platform-specific binaries)
-        schemes=["sha512_crypt", ],
-        # default scheme for creating new pw hashes (if not given, passlib uses first from schemes)
-        #default="sha512_crypt",
-        # deprecated schemes get auto-upgraded to the default scheme at login
-        # time or when setting a password (including doing a moin account pwreset).
-        #deprecated=["auto"],
-        # vary rounds parameter randomly when creating new hashes...
-        #all__vary_rounds=0.1,
-     ),
-     "passlib CryptContext arguments, see passlib docs"),
-  )),
-  # ==========================================================================
-  'spam_leech_dos': ('Anti-Spam / Leech / DOS',
-  'These settings help limiting ressource usage and avoiding abuse.',
-  (
-    ('textchas', None,
-     "Spam protection setup using site-specific questions/answers, see HelpOnSpam."),
-    ('textchas_expiry_time', 600,
-     "Time [s] for a !TextCha to expire."),
-  )),
-  # ==========================================================================
-  'style': ('Style / Theme / UI',
-  'These settings control how the wiki user interface will look like.',
-  (
-    ('sitename', u'Untitled Wiki',
-     "Short description of your wiki site, displayed below the logo on each page, and used in RSS documents as the channel title [Unicode]"),
-    ('interwikiname', None, "unique, stable and required InterWiki name (prefix, moniker) of the site [Unicode]"),
-    ('html_pagetitle', None, "Allows you to set a specific HTML page title (if None, it defaults to the value of `sitename`) [Unicode]"),
-    ('navi_bar', [
-        ('wikilink', 'frontend.show_root', dict(), L_('Home'), L_('Home Page')),
-        ('wikilink', 'frontend.global_history', dict(), L_('History'), L_('Global History')),
-        ('wikilink', 'frontend.index', dict(), L_('Index'), L_('Global Index')),
-        ('wikilink', 'frontend.global_tags', dict(), L_('Tags'), L_('Global Tags Index')),
-        ('wikilink', 'admin.index_user', dict(), L_('User'), L_('User')),
-        ('wikilink', 'admin.index', dict(), L_('Admin'), L_('Administration & Docs')),
-     ],
-     'Data to create the navi_bar from. Users can add more items in their quick links in user preferences. You need to configure a list of tuples (css_class, endpoint, args, label, title). Use L_() for translating. [list of tuples]'),
+        ('theme_default', u'modernized', "Default theme."),
 
-    ('theme_default', u'modernized', "Default theme."),
+        ('serve_files', {},
+         """
+         Dictionary of name: filesystem_path for static file resources to serve
+         from the filesystem as url .../+serve/<name>/...
+         """),
 
-    ('serve_files', {},
-     """
-     Dictionary of name: filesystem_path for static file resources to serve
-     from the filesystem as url .../+serve/<name>/...
-     """),
+        ('supplementation_item_names', [u'Discussion', ],
+         "List of names of the supplementation (sub)items [Unicode]"),
 
-    ('supplementation_item_names', [u'Discussion', ],
-     "List of names of the supplementation (sub)items [Unicode]"),
+        ('interwiki_preferred', [], "In dialogues, show those wikis at the top of the list [list of Unicode]."),
+        ('sistersites', [], "list of tuples `('WikiName', 'sisterpagelist_fetch_url')`"),
 
-    ('interwiki_preferred', [], "In dialogues, show those wikis at the top of the list [list of Unicode]."),
-    ('sistersites', [], "list of tuples `('WikiName', 'sisterpagelist_fetch_url')`"),
+        ('trail_size', 5,
+         "Number of items in the trail of recently visited items"),
 
-    ('trail_size', 5,
-     "Number of items in the trail of recently visited items"),
+        ('item_views', [
+            # (endpointname, label, check_item_exists
+            ('frontend.show_item', L_('Show'), L_('Show'), False, ),
+            ('frontend.download_item', L_('Download'), L_('Download'), True, ),
+            ('frontend.history', L_('History'), L_('Revision History'), True, ),
+            # note: when rendering a non-existing item, you'll be offered to
+            # create it (in the content area), so we do not offer "Modify":
+            ('frontend.modify_item', L_('Modify'), L_('Edit or Upload'), True, ),
+            ('special.supplementation', None, None, False, ),
+            ('frontend.index', L_('Index'), L_('List sub-items'), False, ),
+            ('special.comments', L_('Comments'), L_('Hide comments'), True, ),
+            ('special.transclusions', L_('Transclusions'), L_('Show transclusions'), True, ),
+            ('frontend.highlight_item', L_('Highlight'), L_('Show with Syntax-Highlighting'), True, ),
+            ('frontend.show_item_meta', L_('Meta'), L_('Display Metadata'), True, ),
+            ('frontend.quicklink_item', None, L_('Create or remove a navigation link to this item'), False, ),
+            ('frontend.subscribe_item', None, L_('Switch notifications about item changes on or off'), False, ),
+            ('frontend.rename_item', L_('Rename'), L_('Rename this item'), True, ),
+            ('frontend.delete_item', L_('Delete'), L_('Delete this item'), True, ),
+            ('frontend.destroy_item', L_('Destroy'), L_('Completely destroy this item'), True, ),
+            ('frontend.backrefs', L_('Referrers'), L_('What refers here?'), False, ),
+            ('frontend.sitemap', L_('Site Map'), L_('Local Site Map of this item'), True, ),
+            ('frontend.similar_names', L_('Similar'), L_('Items with similar names'), False, ),
+        ], 'list of edit bar entries (list of tuples (endpoint, label))'),
 
-    ('item_views', [
-        # (endpointname, label, check_item_exists
-        ('frontend.show_item', L_('Show'), L_('Show'), False, ),
-        ('frontend.download_item', L_('Download'), L_('Download'), True, ),
-        ('frontend.history', L_('History'), L_('Revision History'), True, ),
-        # note: when rendering a non-existing item, you'll be offered to
-        # create it (in the content area), so we do not offer "Modify":
-        ('frontend.modify_item', L_('Modify'), L_('Edit or Upload'), True, ),
-        ('special.supplementation', None, None, False, ),
-        ('frontend.index', L_('Index'), L_('List sub-items'), False, ),
-        ('special.comments', L_('Comments'), L_('Hide comments'), True, ),
-        ('special.transclusions', L_('Transclusions'), L_('Show transclusions'), True, ),
-        ('frontend.highlight_item', L_('Highlight'), L_('Show with Syntax-Highlighting'), True, ),
-        ('frontend.show_item_meta', L_('Meta'), L_('Display Metadata'), True, ),
-        ('frontend.quicklink_item', None, L_('Create or remove a navigation link to this item'), False, ),
-        ('frontend.subscribe_item', None, L_('Switch notifications about item changes on or off'), False, ),
-        ('frontend.rename_item', L_('Rename'), L_('Rename this item'), True, ),
-        ('frontend.delete_item', L_('Delete'), L_('Delete this item'), True, ),
-        ('frontend.destroy_item', L_('Destroy'), L_('Completely destroy this item'), True, ),
-        ('frontend.backrefs', L_('Referrers'), L_('What refers here?'), False, ),
-        ('frontend.sitemap', L_('Site Map'), L_('Local Site Map of this item'), True, ),
-        ('frontend.similar_names', L_('Similar'), L_('Items with similar names'), False, ),
-     ],
-     'list of edit bar entries (list of tuples (endpoint, label))'),
+        ('show_hosts', True,
+         "if True, show host names and IPs. Set to False to hide them."),
+        ('show_interwiki', False,
+         "if True, let the theme display your interwiki name"),
+        ('show_names', True,
+         "if True, show user names in the revision history and on Recent``Changes. Set to False to hide them."),
+        ('show_section_numbers', False,
+         'show section numbers in headings by default'),
+        ('show_rename_redirect', False, "if True, offer creation of redirect pages when renaming wiki pages"),
 
-    ('show_hosts', True,
-     "if True, show host names and IPs. Set to False to hide them."),
-    ('show_interwiki', False,
-     "if True, let the theme display your interwiki name"),
-    ('show_names', True,
-     "if True, show user names in the revision history and on Recent``Changes. Set to False to hide them."),
-    ('show_section_numbers', False,
-     'show section numbers in headings by default'),
-    ('show_rename_redirect', False, "if True, offer creation of redirect pages when renaming wiki pages"),
+        ('template_dirs', [], "list of directories with templates that will override theme and base templates."),
+    )),
+    # ==========================================================================
+    'editor': ('Editor', None, (
+        ('item_license', u'', 'if set, show the license item within the editor. [Unicode]'),
+        #('edit_locking', 'warn 10', "Editor locking policy: `None`, `'warn <timeout in minutes>'`, or `'lock <timeout in minutes>'`"),
+        ('edit_ticketing', True, None),
+    )),
+    # ==========================================================================
+    'paging': ('Paging', None, (
+        ('results_per_page', 50, "Number of results to be shown on a single page in pagination"),
+    )),
+    # ==========================================================================
+    'data': ('Data Storage', None, (
+        ('data_dir', './data/', "Path to the data directory."),
+        ('plugin_dirs', [], "Plugin directories."),
 
-    ('template_dirs', [], "list of directories with templates that will override theme and base templates."),
-  )),
-  # ==========================================================================
-  'editor': ('Editor', None, (
-    ('item_license', u'', 'if set, show the license item within the editor. [Unicode]'),
-    #('edit_locking', 'warn 10', "Editor locking policy: `None`, `'warn <timeout in minutes>'`, or `'lock <timeout in minutes>'`"),
-    ('edit_ticketing', True, None),
-  )),
-  # ==========================================================================
-  'paging': ('Paging', None, (
-    ('results_per_page', 50, "Number of results to be shown on a single page in pagination"),
-  )),
-  # ==========================================================================
-  'data': ('Data Storage', None, (
-    ('data_dir', './data/', "Path to the data directory."),
-    ('plugin_dirs', [], "Plugin directories."),
+        ('interwiki_map', {},
+         "Dictionary of wiki_name -> wiki_url"),
+        ('namespace_mapping', None,
+         "A list of tuples, each tuple containing: Namespace identifier, backend name. " +
+         "E.g.: [('', 'default')), ]. Please see HelpOnStorageConfiguration for further reference."),
+        ('backend_mapping', None,
+         "A dictionary that maps backend names to backends. " +
+         "E.g.: {'default': Backend(), }. Please see HelpOnStorageConfiguration for further reference."),
+        ('acl_mapping', None,
+         "This needs to point to a list of tuples, each tuple containing: name prefix, acl protection to be applied to matching items. " +
+         "E.g.: [('', dict(default='All:read,write,create')), ]. Please see HelpOnStorageConfiguration for further reference."),
+        ('create_storage', False, "Create (initialize) the storage backends before trying to use them."),
+        ('create_index', False, "Create (initialize) the index before trying to use them."),
+        ('destroy_storage', False, "Destroy (empty) the storage backends after using them."),
+        ('destroy_index', False, "Destroy (empty) the index after using it."),
+    )),
+    # ==========================================================================
+    'items': ('Special Item Names', None, (
+        ('item_root', u'Home', "Name of the root item (aka 'front page'). [Unicode]"),
 
-    ('interwiki_map', {},
-     "Dictionary of wiki_name -> wiki_url"),
-    ('namespace_mapping', None,
-    "A list of tuples, each tuple containing: Namespace identifier, backend name. " +
-    "E.g.: [('', 'default')), ]. Please see HelpOnStorageConfiguration for further reference."),
-    ('backend_mapping', None,
-    "A dictionary that maps backend names to backends. " +
-    "E.g.: {'default': Backend(), }. Please see HelpOnStorageConfiguration for further reference."),
-    ('acl_mapping', None,
-    "This needs to point to a list of tuples, each tuple containing: name prefix, acl protection to be applied to matching items. " +
-    "E.g.: [('', dict(default='All:read,write,create')), ]. Please see HelpOnStorageConfiguration for further reference."),
-    ('create_storage', False, "Create (initialize) the storage backends before trying to use them."),
-    ('create_index', False, "Create (initialize) the index before trying to use them."),
-    ('destroy_storage', False, "Destroy (empty) the storage backends after using them."),
-    ('destroy_index', False, "Destroy (empty) the index after using it."),
-  )),
-  # ==========================================================================
-  'items': ('Special Item Names', None, (
-    ('item_root', u'Home', "Name of the root item (aka 'front page'). [Unicode]"),
+        # the following regexes should match the complete name when used in free text
+        # the group 'all' shall match all, while the group 'key' shall match the key only
+        # e.g. FooGroup -> group 'all' ==  FooGroup, group 'key' == Foo
+        # moin's code will add ^ / $ at beginning / end when needed
+        ('item_dict_regex', ur'(?P<all>(?P<key>\S+)Dict)',
+         'Item names exactly matching this regex are regarded as items containing variable dictionary definitions [Unicode]'),
+        ('item_group_regex', ur'(?P<all>(?P<key>\S+)Group)',
+         'Item names exactly matching this regex are regarded as items containing group definitions [Unicode]'),
+    )),
+    # ==========================================================================
+    'user': ('User Preferences', None, (
+        ('user_defaults', {
+            NAME: [],
+            DISPLAY_NAME: None,
+            EMAIL: None,
+            OPENID: None,
+            CSS_URL: None,
+            MAILTO_AUTHOR: False,
+            EDIT_ON_DOUBLECLICK: True,
+            SCROLL_PAGE_AFTER_EDIT: True,
+            SHOW_COMMENTS: False,
+            WANT_TRIVIAL: False,
+            ENC_PASSWORD: u'',  # empty value == invalid hash
+            DISABLED: False,
+            BOOKMARKS: {},
+            QUICKLINKS: [],
+            SUBSCRIBED_ITEMS: [],
+            EMAIL_SUBSCRIBED_EVENTS: [
+                # XXX PageChangedEvent.__name__
+                # XXX PageRenamedEvent.__name__
+                # XXX PageDeletedEvent.__name__
+                # XXX PageCopiedEvent.__name__
+                # XXX PageRevertedEvent.__name__
+            ],
+            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
+        }, 'Default attributes of the user object'),
+    )),
+    # ==========================================================================
+    'various': ('Various', None, (
+        ('bang_meta', True, 'if True, enable {{{!NoWikiName}}} markup'),
 
-    # the following regexes should match the complete name when used in free text
-    # the group 'all' shall match all, while the group 'key' shall match the key only
-    # e.g. FooGroup -> group 'all' ==  FooGroup, group 'key' == Foo
-    # moin's code will add ^ / $ at beginning / end when needed
-    ('item_dict_regex', ur'(?P<all>(?P<key>\S+)Dict)',
-     'Item names exactly matching this regex are regarded as items containing variable dictionary definitions [Unicode]'),
-    ('item_group_regex', ur'(?P<all>(?P<key>\S+)Group)',
-     'Item names exactly matching this regex are regarded as items containing group definitions [Unicode]'),
-  )),
-  # ==========================================================================
-  'user': ('User Preferences', None, (
-    ('user_defaults',
-     {
-        NAME: [],
-        DISPLAY_NAME: None,
-        EMAIL: None,
-        OPENID: None,
-        CSS_URL: None,
-        MAILTO_AUTHOR: False,
-        EDIT_ON_DOUBLECLICK: True,
-        SCROLL_PAGE_AFTER_EDIT: True,
-        SHOW_COMMENTS: False,
-        WANT_TRIVIAL: False,
-        ENC_PASSWORD: u'',  # empty value == invalid hash
-        DISABLED: False,
-        BOOKMARKS: {},
-        QUICKLINKS: [],
-        SUBSCRIBED_ITEMS: [],
-        EMAIL_SUBSCRIBED_EVENTS: [
-            # XXX PageChangedEvent.__name__
-            # XXX PageRenamedEvent.__name__
-            # XXX PageDeletedEvent.__name__
-            # XXX PageCopiedEvent.__name__
-            # XXX PageRevertedEvent.__name__
-        ],
-        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
-     },
-     'Default attributes of the user object'),
-  )),
-  # ==========================================================================
-  'various': ('Various', None, (
-    ('bang_meta', True, 'if True, enable {{{!NoWikiName}}} markup'),
+        ('config_check_enabled', False, "if True, check configuration for unknown settings."),
 
-    ('config_check_enabled', False, "if True, check configuration for unknown settings."),
+        ('timezone_default', u'UTC', "Default time zone."),
+        ('locale_default', u'en_US', "Default locale for user interface and content."),
 
-    ('timezone_default', u'UTC', "Default time zone."),
-    ('locale_default', u'en_US', "Default locale for user interface and content."),
+        ('log_remote_addr', True,
+         "if True, log the remote IP address (and maybe hostname)."),
+        ('log_reverse_dns_lookups', True,
+         "if True, do a reverse DNS lookup on page SAVE. If your DNS is broken, set this to False to speed up SAVE."),
 
-    ('log_remote_addr', True,
-     "if True, log the remote IP address (and maybe hostname)."),
-    ('log_reverse_dns_lookups', True,
-     "if True, do a reverse DNS lookup on page SAVE. If your DNS is broken, set this to False to speed up SAVE."),
+        # some dangerous mimetypes (we don't use "content-disposition: inline" for them when a user
+        # downloads such data, because the browser might execute e.g. Javascript contained
+        # in the HTML and steal your moin session cookie or do other nasty stuff)
+        ('mimetypes_xss_protect', [
+            'text/html',
+            'application/x-shockwave-flash',
+            'application/xhtml+xml',
+        ], '"content-disposition: inline" is not used for downloads of such data'),
 
-    # some dangerous mimetypes (we don't use "content-disposition: inline" for them when a user
-    # downloads such data, because the browser might execute e.g. Javascript contained
-    # in the HTML and steal your moin session cookie or do other nasty stuff)
-    ('mimetypes_xss_protect',
-     [
-       'text/html',
-       'application/x-shockwave-flash',
-       'application/xhtml+xml',
-     ],
-     '"content-disposition: inline" is not used for downloads of such data'),
-
-    ('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
-  )),
+        ('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
+    )),
 }
 
 #
 #
 #
 options = {
-    'acl': ('Access Control Lists',
-    'ACLs control who may do what.',
-    (
-      ('functions', u'',
-       'Access Control List for functions.'),
-      ('rights_contents', ACL_RIGHTS_CONTENTS,
-       'Valid tokens for right sides of content ACL entries.'),
-      ('rights_functions', ACL_RIGHTS_FUNCTIONS,
-       'Valid tokens for right sides of function ACL entries.'),
+    'acl': ('Access Control Lists', 'ACLs control who may do what.', (
+        ('functions', u'', 'Access Control List for functions.'),
+        ('rights_contents', ACL_RIGHTS_CONTENTS, 'Valid tokens for right sides of content ACL entries.'),
+        ('rights_functions', ACL_RIGHTS_FUNCTIONS, 'Valid tokens for right sides of function ACL entries.'),
     )),
 
     'ns': ('Storage Namespaces',
     "Storage namespaces can be defined for all sorts of data. All items sharing a common namespace as prefix" +
     "are then stored within the same backend. The common prefix for all data is ''.",
     (
-      ('content', '/', "All content is by default stored below /, hence the prefix is ''."),  # Not really necessary. Just for completeness.
-      ('user_profile', 'UserProfile/', 'User profiles (i.e. user data, not their homepage) are stored in this namespace.'),
-      ('user_homepage', 'User/', 'All user homepages are stored below this namespace.'),
+        ('content', '/', "All content is by default stored below /, hence the prefix is ''."),  # Not really necessary. Just for completeness.
+        ('user_profile', 'UserProfile/', 'User profiles (i.e. user data, not their homepage) are stored in this namespace.'),
+        ('user_homepage', 'User/', 'All user homepages are stored below this namespace.'),
     )),
 
     'user': ('User', None, (
-      ('email_unique', True,
-       "if True, check email addresses for uniqueness and don't accept duplicates."),
-      ('email_verification', False,
-       "if True, require a new user to verify his or her email address before the first login."),
+        ('email_unique', True,
+         "if True, check email addresses for uniqueness and don't accept duplicates."),
+        ('email_verification', False,
+         "if True, require a new user to verify his or her email address before the first login."),
 
-      ('homewiki', u'Self',
-       "interwiki name of the wiki where the user home pages are located [Unicode] - useful if you have ''many'' users. You could even link to nonwiki \"user pages\" if the wiki username is in the target URL."),
-      ('use_gravatar', False, "if True, gravatar.com will be used to find User's avatar")
+        ('homewiki', u'Self',
+         "interwiki name of the wiki where the user home pages are located [Unicode] - useful if you have ''many'' users. You could even link to nonwiki \"user pages\" if the wiki username is in the target URL."),
+        ('use_gravatar', False, "if True, gravatar.com will be used to find User's avatar")
     )),
 
-    'mail': ('Mail',
-        'These settings control outgoing and incoming email from and to the wiki.',
-    (
-      ('from', None, "Used as From: address for generated mail. [Unicode]"),
-      ('username', None, "Username for SMTP server authentication (None = don't use auth)."),
-      ('password', None, "Password for SMTP server authentication (None = don't use auth)."),
-      ('smarthost', None, "Address of SMTP server to use for sending mail (None = don't use SMTP server)."),
-      ('sendmail', None, "sendmail command to use for sending mail (None = don't use sendmail)"),
+    'mail': ('Mail', 'These settings control outgoing and incoming email from and to the wiki.', (
+        ('from', None, "Used as From: address for generated mail. [Unicode]"),
+        ('username', None, "Username for SMTP server authentication (None = don't use auth)."),
+        ('password', None, "Password for SMTP server authentication (None = don't use auth)."),
+        ('smarthost', None, "Address of SMTP server to use for sending mail (None = don't use SMTP server)."),
+        ('sendmail', None, "sendmail command to use for sending mail (None = don't use sendmail)"),
     )),
 }
 

File MoinMoin/conftest.py

 from __future__ import absolute_import, division
 
 # 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)
-                 ]
+collect_ignore = [
+    'static',  # same
+    '../wiki',  # no tests there
+    '../instance',  # tw likes to use this for wiki data (non-revisioned)
+]
 import atexit
 import os
 import sys

File MoinMoin/constants/contenttypes.py

 CHARSET = 'utf-8'
 
 # Parser to use mimetype text
-PARSER_TEXT_MIMETYPE = ('plain', 'csv', 'rst', 'docbook', 'latex', 'tex', 'html', 'css',
-                       'xml', 'python', 'perl', 'php', 'ruby', 'javascript',
-                       'cplusplus', 'java', 'pascal', 'diff', 'gettext', 'xslt', 'creole', )
+PARSER_TEXT_MIMETYPE = [
+    'plain', 'csv', 'rst', 'docbook', 'latex', 'tex', 'html', 'css',
+    'xml', 'python', 'perl', 'php', 'ruby', 'javascript',
+    'cplusplus', 'java', 'pascal', 'diff', 'gettext', 'xslt', 'creole',
+]
 
 CONTENTTYPE_USER = u'application/x.moin.userprofile'
 CONTENTTYPE_DEFAULT = u'application/octet-stream'

File MoinMoin/constants/misc.py

     \u202E   # RLM
     """,
     re.UNICODE | re.VERBOSE
-    )
+)
 
 CLEAN_INPUT_TRANSLATION_MAP = {
     # these chars will be replaced by blanks
     ord(u'\r'): u' ',
     ord(u'\n'): u' ',
 }
-for c in u'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f' \
-          '\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f':
+for c in u'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f':
     # these chars will be removed
     CLEAN_INPUT_TRANSLATION_MAP[ord(c)] = None
 del c
 
 # Other stuff
-URI_SCHEMES = ['http', 'https', 'ftp', 'file',
-               'mailto', 'nntp', 'news',
-               'ssh', 'telnet', 'irc', 'ircs', 'xmpp', 'mumble',
-               'webcal', 'ed2k', 'apt', 'rootz',
-               'gopher',
-               'notes',
-               'rtp', 'rtsp', 'rtcp',
-              ]
+URI_SCHEMES = [
+    'http', 'https', 'ftp', 'file',
+    'mailto', 'nntp', 'news',
+    'ssh', 'telnet', 'irc', 'ircs', 'xmpp', 'mumble',
+    'webcal', 'ed2k', 'apt', 'rootz',
+    'gopher',
+    'notes',
+    'rtp', 'rtsp', 'rtcp',
+]

File MoinMoin/converter/_args.py

         return len(self.positional) + len(self.keyword)
 
     def __repr__(self):
-        return '<{0}({1!r}, {2!r})>'.format(self.__class__.__name__,
-                self.positional, self.keyword)
+        return '<{0}({1!r}, {2!r})>'.format(self.__class__.__name__, self.positional, self.keyword)
 
     def items(self):
         """

File MoinMoin/converter/_tests/test__args_wiki.py

 
 def test():
     yield (do,
-        ur'both positional both=foo keyword=bar',
-        [u'both', u'positional'],
-        {u'both': u'foo', u'keyword': u'bar'})
+           ur'both positional both=foo keyword=bar',
+           [u'both', u'positional'],
+           {u'both': u'foo', u'keyword': u'bar'})
 
     yield (do,
-        ur'a-b a_b a-c=foo a_c=bar',
-        [u'a-b', u'a_b'],
-        {u'a-c': u'foo', u'a_c': u'bar'})
+           ur'a-b a_b a-c=foo a_c=bar',
+           [u'a-b', u'a_b'],
+           {u'a-c': u'foo', u'a_c': u'bar'})
 
     yield (do,
-        ur'''"a b\tc\nd" k="a b\tc\nd"''',
-        [u'a b\tc\nd'],
-        {u'k': u'a b\tc\nd'})
+           ur'''"a b\tc\nd" k="a b\tc\nd"''',
+           [u'a b\tc\nd'],
+           {u'k': u'a b\tc\nd'})
 
 
 def test_parse():

File MoinMoin/converter/_tests/test_creole_in.py

                 '<page><body><p><code>nowiki</code> <code>nowiki</code></p></body></page>'),
             # XXX: Is <page> correct?
             (u'{{{\n#!\nwiki\n}}}',
-               '<page><body><page><body><p>wiki</p></body></page></body></page>'),
+                '<page><body><page><body><p>wiki</p></body></page></body></page>'),
             (u'{{{\n#!(style="background-color: red")\nwiki\n}}}',
-               '<page><body><page><body style="background-color: red"><p>wiki</p></body></page></body></page>'),
+                '<page><body><page><body style="background-color: red"><p>wiki</p></body></page></body></page>'),
             (u'{{{\n#!creole\nwiki\n}}}',
-               '<page><body><page><body><p>wiki</p></body></page></body></page>'),
+                '<page><body><page><body><p>wiki</p></body></page></body></page>'),
             (u'{{{\n#!creole(style="background-color: red")\nwiki\n}}}',
-               '<page><body><page><body style="background-color: red"><p>wiki</p></body></page></body></page>'),
+                '<page><body><page><body style="background-color: red"><p>wiki</p></body></page></body></page>'),
             (u'{{{\n#!text/plain\ntext\n}}}',
-               u'<page><body><part content-type="text/plain"><body>text</body></part></body></page>'),
+                u'<page><body><part content-type="text/plain"><body>text</body></part></body></page>'),
         ]
         for i in data:
             yield (self.do, ) + i

File MoinMoin/converter/_tests/test_docbook_in.py

     def test_base(self):
         data = [
             ('<article><para>Test</para></article>',
-              # <page><body><div html:class="db-article"><p>Test</p></div></body></page>
-             '/page/body/div[@html:class="db-article"][p="Test"]'),
+                # <page><body><div html:class="db-article"><p>Test</p></div></body></page>
+                '/page/body/div[@html:class="db-article"][p="Test"]'),
             ('<article><simpara>Test</simpara></article>',
-            # <page><body><div html:class="article"><p>Test</p></div></body></page>
-             '/page/body/div[p="Test"]'),
+                # <page><body><div html:class="article"><p>Test</p></div></body></page>
+                '/page/body/div[p="Test"]'),
             ('<article><formalpara><title>Title</title><para>Test</para></formalpara></article>',
-            # <page><body><div html:class="article"><p html:title="Title">Test</p></div></body></page>
-            '/page/body/div/p[text()="Test"][@html:title="Title"]'),
+                # <page><body><div html:class="article"><p html:title="Title">Test</p></div></body></page>
+                '/page/body/div/p[text()="Test"][@html:title="Title"]'),
             ('<article><sect1><title>Heading 1</title> <para>First Paragraph</para></sect1></article>',
-            # <page><body><div html:class="article"><h outline-level="1">Heading 1</h><p>First Paragraph</p></div></body></page>
-             '/page/body/div[./h[@outline-level="1"][text()="Heading 1"]][./p[text()="First Paragraph"]]'),
+                # <page><body><div html:class="article"><h outline-level="1">Heading 1</h><p>First Paragraph</p></div></body></page>
+                '/page/body/div[./h[@outline-level="1"][text()="Heading 1"]][./p[text()="First Paragraph"]]'),
             # Test for conversion with unicode char
             (u'<article><para>안녕 유빈</para></article>',
-            # <page><body><div html:class="article"><p>안녕 유빈</p></div></body></page>
-             u'/page/body/div[p="안녕 유빈"]'),
+                # <page><body><div html:class="article"><p>안녕 유빈</p></div></body></page>
+                u'/page/body/div[p="안녕 유빈"]'),
             # Ignored tags
             ('<article><info><title>Title</title><author>Author</author></info><para>text</para></article>',
-            # <page><body><div html:class="article"><p>text</p></div></body></page>
-            '/page/body/div[p="text"]'),
+                # <page><body><div html:class="article"><p>text</p></div></body></page>
+                '/page/body/div[p="text"]'),
             # XML attributes: We support all the xml standard attributes
             ('<article><para xml:base="http://base.tld" xml:id="id" xml:lang="en">Text</para></article>',
-            # <page><body><div html:class="article"><p xml:base="http://base.tld" xml:id="id" xml:lang="en">Text</p></div></body></page>
-            '/page/body/div/p[@xml:base="http://base.tld"][@xml:id="id"][@xml:lang="en"][text()="Text"]'),
+                # <page><body><div html:class="article"><p xml:base="http://base.tld" xml:id="id" xml:lang="en">Text</p></div></body></page>
+                '/page/body/div/p[@xml:base="http://base.tld"][@xml:id="id"][@xml:lang="en"][text()="Text"]'),
             # ANCHOR --> SPAN
             ('<article><para>bla bla<anchor xml:id="point_1" />bla bla</para></article>',
-            # <page><body><div html:class="article"><p>bla bla<span class="db-anchor" xml:id="point_1" />bla bla</p></div></body></page>
-            '/page/body/div/p/span[@html:class="db-anchor"][@xml:id="point_1"]'),
+                # <page><body><div html:class="article"><p>bla bla<span class="db-anchor" xml:id="point_1" />bla bla</p></div></body></page>
+                '/page/body/div/p/span[@html:class="db-anchor"][@xml:id="point_1"]'),
             # BOOK Document
             ('<book><para>Test</para></book>',
-            # <page><body><div html:class="db-book"><p>Test</p></div></body></page>
-            '/page/body/div[@html:class="db-book"][p="Test"]'),
+                # <page><body><div html:class="db-book"><p>Test</p></div></body></page>
+                '/page/body/div[@html:class="db-book"][p="Test"]'),
         ]
         for i in data:
             yield (self.do, ) + i
         data = [
             # Test simple numbered section conversion into headings.
             ('<article><sect1><title>Heading 1</title> <para>First</para><sect2><title>Heading 2</title><para>Second</para></sect2></sect1></article>',
-            # <page><body><table-of-content><div html:class="article"><h outline-level="1">Heading 1</h><p>First</p><h outline-level="2">Heading 2</h><p>Second</p></div></body></page>
-             '/page/body[table-of-content]/div[h[1][@outline-level="1"][text()="Heading 1"]][p[1][text()="First"]][h[2][@outline-level="2"][text()="Heading 2"]][p[2][text()="Second"]]'),
+                # <page><body><table-of-content><div html:class="article"><h outline-level="1">Heading 1</h><p>First</p><h outline-level="2">Heading 2</h><p>Second</p></div></body></page>
+                '/page/body[table-of-content]/div[h[1][@outline-level="1"][text()="Heading 1"]][p[1][text()="First"]][h[2][@outline-level="2"][text()="Heading 2"]][p[2][text()="Second"]]'),
             ('<article><section><title>Heading 1</title> <para>First</para><section><title>Heading 2</title><para>Second</para></section></section></article>',
-            # <page><body><table-of-content><div html:class="article"><h outline-level="1">Heading 1</h><p>First</p><h outline-level="2">Heading 2</h><p>Second</p></div></body></page>
-             '/page/body[table-of-content]/div[h[1][@outline-level="1"][text()="Heading 1"]][p[1][text()="First"]][h[2][@outline-level="2"][text()="Heading 2"]][p[2][text()="Second"]]'),
+                # <page><body><table-of-content><div html:class="article"><h outline-level="1">Heading 1</h><p>First</p><h outline-level="2">Heading 2</h><p>Second</p></div></body></page>
+                '/page/body[table-of-content]/div[h[1][@outline-level="1"][text()="Heading 1"]][p[1][text()="First"]][h[2][@outline-level="2"][text()="Heading 2"]][p[2][text()="Second"]]'),
             # Test complex recursive section conversion into headings.
             ('<article><section><title>Heading 1 A</title><para>First</para><section><title>Heading 2 A</title><para>Second</para><section><title>Heading 3 A</title><para>Third</para></section></section></section><section><title>Heading 1 B</title><para>Fourth</para></section></article>',
-            # <page><body><table-of-content /><div html:class="article"><h outline-level="1">Heading 1 A</h><p>First</p><h outline-level="2">Heading 2 A</h><p>Second</p><h outline-level="3">Heading 3 A</h><p>Third</p><h outline-level="1">Heading 1 B</h><p>Fourth</p></div></body></page>
-             '/page/body[table-of-content]/div[h[1][@outline-level="1"][text()="Heading 1 A"]][p[1][text()="First"]][h[2][@outline-level="2"][text()="Heading 2 A"]][p[2][text()="Second"]][h[3][@outline-level="3"][text()="Heading 3 A"]][p[3][text()="Third"]][h[4][@outline-level="1"][text()="Heading 1 B"]][p[4][text()="Fourth"]]'),
+                # <page><body><table-of-content /><div html:class="article"><h outline-level="1">Heading 1 A</h><p>First</p><h outline-level="2">Heading 2 A</h><p>Second</p><h outline-level="3">Heading 3 A</h><p>Third</p><h outline-level="1">Heading 1 B</h><p>Fourth</p></div></body></page>
+                '/page/body[table-of-content]/div[h[1][@outline-level="1"][text()="Heading 1 A"]][p[1][text()="First"]][h[2][@outline-level="2"][text()="Heading 2 A"]][p[2][text()="Second"]][h[3][@outline-level="3"][text()="Heading 3 A"]][p[3][text()="Third"]][h[4][@outline-level="1"][text()="Heading 1 B"]][p[4][text()="Fourth"]]'),
         ]
 
         for i in data:
         data = [
             # ITEMIZED LIST --> unordered list
             ('<article><itemizedlist><listitem>Unordered Item 1</listitem><listitem>Unordered Item 2</listitem></itemizedlist></article>',
-            # <page><body><div html:class="article"><list item-label-generate="unordered"><list-item><list-item-body>Unordered Item 1</list-item-body></list-item><list-item><list-item-body>Unordered Item 2</list-item-body></list-item></list></div></body></page>
-             '/page/body/div/list[@item-label-generate="unordered"][list-item[1]/list-item-body[text()="Unordered Item 1"]][list-item[2]/list-item-body[text()="Unordered Item 2"]]'),
+                # <page><body><div html:class="article"><list item-label-generate="unordered"><list-item><list-item-body>Unordered Item 1</list-item-body></list-item><list-item><list-item-body>Unordered Item 2</list-item-body></list-item></list></div></body></page>
+                '/page/body/div/list[@item-label-generate="unordered"][list-item[1]/list-item-body[text()="Unordered Item 1"]][list-item[2]/list-item-body[text()="Unordered Item 2"]]'),
             # ORDERED LIST --> ordered list
             ('<article><orderedlist><listitem>Ordered Item 1</listitem><listitem>Ordered Item 2</listitem></orderedlist></article>',
-            # <page><body><div html:class="article"><list item-label-generate="ordered"><list-item><list-item-body>Ordered Item 1</list-item-body></list-item><list-item><list-item-body>Ordered Item 2</list-item-body></list-item></list></div></body></page>
-             '/page/body/div/list[@item-label-generate="ordered"][list-item[1]/list-item-body[text()="Ordered Item 1"]][list-item[2]/list-item-body[text()="Ordered Item 2"]]'),
+                # <page><body><div html:class="article"><list item-label-generate="ordered"><list-item><list-item-body>Ordered Item 1</list-item-body></list-item><list-item><list-item-body>Ordered Item 2</list-item-body></list-item></list></div></body></page>
+                '/page/body/div/list[@item-label-generate="ordered"][list-item[1]/list-item-body[text()="Ordered Item 1"]][list-item[2]/list-item-body[text()="Ordered Item 2"]]'),
             # ORDERED LIST with upperalpha numeration --> ordered list with upper-alpha list-style-type
             ('<article><orderedlist numeration="upperalpha"><listitem>Ordered Item 1</listitem><listitem>Ordered Item 2</listitem></orderedlist></article>',
-
             # <page><body><div html:class="article"><list item-label-generage="ordered" list-style-type="upper-alpha"><list-item><list-item-body>Ordered Item 1</list-item-body></list-item><list-item><list-item-body>Ordered Item 2</list-item-body></list-item></list></div></body></page>
-             '/page/body/div/list[@item-label-generate="ordered"][@list-style-type="upper-alpha"][list-item[1]/list-item-body[text()="Ordered Item 1"]][list-item[2]/list-item-body[text()="Ordered Item 2"]]'),
+                '/page/body/div/list[@item-label-generate="ordered"][@list-style-type="upper-alpha"][list-item[1]/list-item-body[text()="Ordered Item 1"]][list-item[2]/list-item-body[text()="Ordered Item 2"]]'),
             # ORDERED LIST with loweralpha numeration --> ordered list with lower-alpha list-style-type
             ('<article><orderedlist numeration="loweralpha"><listitem>Ordered Item 1</listitem><listitem>Ordered Item 2</listitem></orderedlist></article>',
-            # <page><body><div html:class="article"><list item-label-generage="ordered" list-style-type="lower-alpha"><list-item><list-item-body>Ordered Item 1</list-item-body></list-item><list-item><list-item-body>Ordered Item 2</list-item-body></list-item></list></div></body></page>
-             '/page/body/div/list[@item-label-generate="ordered"][@list-style-type="lower-alpha"][list-item[1]/list-item-body[text()="Ordered Item 1"]][list-item[2]/list-item-body[text()="Ordered Item 2"]]'),
+                # <page><body><div html:class="article"><list item-label-generage="ordered" list-style-type="lower-alpha"><list-item><list-item-body>Ordered Item 1</list-item-body></list-item><list-item><list-item-body>Ordered Item 2</list-item-body></list-item></list></div></body></page>
+                '/page/body/div/list[@item-label-generate="ordered"][@list-style-type="lower-alpha"][list-item[1]/list-item-body[text()="Ordered Item 1"]][list-item[2]/list-item-body[text()="Ordered Item 2"]]'),
             # ORDERED LIST with upperroman numeration --> ordered list with upper-roman list-style-type
             ('<article><orderedlist numeration="upperroman"><listitem>Ordered Item 1</listitem><listitem>Ordered Item 2</listitem></orderedlist></article>',
-            # <page><body><div html:class="article"><list item-label-generage="ordered" list-style-type="upper-roman"><list-item><list-item-body>Ordered Item 1</list-item-body></list-item><list-item><list-item-body>Ordered Item 2</list-item-body></list-item></list></div></body></page>
-             '/page/body/div/list[@item-label-generate="ordered"][@list-style-type="upper-roman"][list-item[1]/list-item-body[text()="Ordered Item 1"]][list-item[2]/list-item-body[text()="Ordered Item 2"]]'),
+                # <page><body><div html:class="article"><list item-label-generage="ordered" list-style-type="upper-roman"><list-item><list-item-body>Ordered Item 1</list-item-body></list-item><list-item><list-item-body>Ordered Item 2</list-item-body></list-item></list></div></body></page>
+                '/page/body/div/list[@item-label-generate="ordered"][@list-style-type="upper-roman"][list-item[1]/list-item-body[text()="Ordered Item 1"]][list-item[2]/list-item-body[text()="Ordered Item 2"]]'),
             # ORDERED LIST with lowerroman numeration --> ordered list with lower-roman list-style-type
             ('<article><orderedlist numeration="lowerroman"><listitem>Ordered Item 1</listitem><listitem>Ordered Item 2</listitem></orderedlist></article>',
-            # <page><body><div html:class="article"><list item-label-generage="ordered" list-style-type="lower-roman"><list-item><list-item-body>Ordered Item 1</list-item-body></list-item><list-item><list-item-body>Ordered Item 2</list-item-body></list-item></list></div></body></page>
-             '/page/body/div/list[@item-label-generate="ordered"][@list-style-type="lower-roman"][list-item[1]/list-item-body[text()="Ordered Item 1"]][list-item[2]/list-item-body[text()="Ordered Item 2"]]'),
+                # <page><body><div html:class="article"><list item-label-generage="ordered" list-style-type="lower-roman"><list-item><list-item-body>Ordered Item 1</list-item-body></list-item><list-item><list-item-body>Ordered Item 2</list-item-body></list-item></list></div></body></page>
+                '/page/body/div/list[@item-label-generate="ordered"][@list-style-type="lower-roman"][list-item[1]/list-item-body[text()="Ordered Item 1"]][list-item[2]/list-item-body[text()="Ordered Item 2"]]'),
             # VARIABLE LIST --> list
             ('<article><variablelist><varlistentry><term>Term 1</term><listitem>Definition 1</listitem></varlistentry><varlistentry><term>Term 2</term><listitem>Definition 2</listitem></varlistentry></variablelist></article>',
-            # <page><body><div html:class="article"><list><list-item><list-item-label>Termm 1</list-item-label><list-item-body>Definition 1</list-item-body></list-item><list-item><list-item-label>Term 2</list-item-label><list-item-body>Definition 2</list-item-body></list-item></list></div></body></page>
-            '/page/body/div/list[list-item[1][list-item-label="Term 1"][list-item-body="Definition 1"]][list-item[2][list-item-label="Term 2"][list-item-body="Definition 2"]]'),
+                # <page><body><div html:class="article"><list><list-item><list-item-label>Termm 1</list-item-label><list-item-body>Definition 1</list-item-body></list-item><list-item><list-item-label>Term 2</list-item-label><list-item-body>Definition 2</list-item-body></list-item></list></div></body></page>
+                '/page/body/div/list[list-item[1][list-item-label="Term 1"][list-item-body="Definition 1"]][list-item[2][list-item-label="Term 2"][list-item-body="Definition 2"]]'),
             # PROCEDURE --> ordered list (with arabic numeration)
             ('<article><procedure><step>First Step</step><step>Second Step</step></procedure></article>',
-            # <page><body><div html:class="article"><list item-label-generate="ordered"><list-item><list-item-body>First Step</list-item-body></list-item><list-item><list-item-body>Second Step</list-item-body></list-item></list></div></body></page>
-             '/page/body/div/list[@item-label-generate="ordered"][list-item[1]/list-item-body[text()="First Step"]][list-item[2]/list-item-body[text()="Second Step"]]'),
+                # <page><body><div html:class="article"><list item-label-generate="ordered"><list-item><list-item-body>First Step</list-item-body></list-item><list-item><list-item-body>Second Step</list-item-body></list-item></list></div></body></page>
+                '/page/body/div/list[@item-label-generate="ordered"][list-item[1]/list-item-body[text()="First Step"]][list-item[2]/list-item-body[text()="Second Step"]]'),
             # PROCEDURE --> ordered list (with arabic numeration) (with stepalternative)
             ('<article><procedure><step>First Step</step><stepalternatives>Second Step</stepalternatives></procedure></article>',
-            # <page><body><div html:class="article"><list item-label-generate="ordered"><list-item><list-item-body>First Step</list-item-body></list-item><list-item><list-item-body>Second Step</list-item-body></list-item></list></div></body></page>
-             '/page/body/div/list[@item-label-generate="ordered"][list-item[1]/list-item-body[text()="First Step"]][list-item[2]/list-item-body[text()="Second Step"]]'),
+                # <page><body><div html:class="article"><list item-label-generate="ordered"><list-item><list-item-body>First Step</list-item-body></list-item><list-item><list-item-body>Second Step</list-item-body></list-item></list></div></body></page>
+                '/page/body/div/list[@item-label-generate="ordered"][list-item[1]/list-item-body[text()="First Step"]][list-item[2]/list-item-body[text()="Second Step"]]'),
             # PROCEDURE with SUBSTEPS
             ('<article><procedure><step>First Step</step><substeps><step>Second Step</step></substeps></procedure></article>',
-            # <page><body><div html:class="article"><list item-label-generate="ordered"><list-item><list-item-body>First Step</list-item-body></list-item><list-item><list-item-body><list item-label-generate="ordered">Second Step</list-item-body></list-item></list></list></div></body></page>
-             '/page/body/div/list[@item-label-generate="ordered"][list-item[1]/list-item-body[text()="First Step"]][list[@item-label-generate="ordered"]/list-item/list-item-body[text()="Second Step"]]'),
+                # <page><body><div html:class="article"><list item-label-generate="ordered"><list-item><list-item-body>First Step</list-item-body></list-item><list-item><list-item-body><list item-label-generate="ordered">Second Step</list-item-body></list-item></list></list></div></body></page>
+                '/page/body/div/list[@item-label-generate="ordered"][list-item[1]/list-item-body[text()="First Step"]][list[@item-label-generate="ordered"]/list-item/list-item-body[text()="Second Step"]]'),
             # GLOSS LIST --> Definition list
             ('<article><glosslist><glossentry><glossterm>Term 1</glossterm><glossdef><para>Definition 1</para></glossdef></glossentry><glossentry><glossterm>Term 2</glossterm><glossdef><para>Definition 2</para></glossdef></glossentry></glosslist></article>',
-            # <page><body><div html:class="article"><list><list-item><list-item-label>Termm 1</list-item-label><list-item-body>Definition 1</list-item-body></list-item><list-item><list-item-label>Term 2</list-item-label><list-item-body>Definition 2</list-item-body></list-item></list></div></body></page>
-            '/page/body/div/list[list-item[1][list-item-label="Term 1"][list-item-body[p="Definition 1"]]][list-item[2][list-item-label="Term 2"][list-item-body[p="Definition 2"]]]'),
+                # <page><body><div html:class="article"><list><list-item><list-item-label>Termm 1</list-item-label><list-item-body>Definition 1</list-item-body></list-item><list-item><list-item-label>Term 2</list-item-label><list-item-body>Definition 2</list-item-body></list-item></list></div></body></page>
+                '/page/body/div/list[list-item[1][list-item-label="Term 1"][list-item-body[p="Definition 1"]]][list-item[2][list-item-label="Term 2"][list-item-body[p="Definition 2"]]]'),
             # SEGMENTED LIST --> Definition List
             ('<article><segmentedlist><segtitle>Term 1</segtitle><segtitle>Term 2</segtitle><segtitle>Term 3</segtitle><seglistitem><seg>Def 1:1</seg><seg>Def 1:2</seg><seg>Def 1:3</seg></seglistitem><seglistitem><seg>Def 2:1</seg><seg>Def 2:2</seg><seg>Def 2:3</seg></seglistitem></segmentedlist></article>',
-              '/page/body/div/list[list-item[1][list-item-label="Term 1"][list-item-body="Def 1:1"]][list-item[2][list-item-label="Term 2"][list-item-body="Def 1:2"]][list-item[3][list-item-label="Term 3"][list-item-body="Def 1:3"]][list-item[4][list-item-label="Term 1"][list-item-body="Def 2:1"]][list-item[5][list-item-label="Term 2"][list-item-body="Def 2:2"]][list-item[6][list-item-label="Term 3"][list-item-body="Def 2:3"]]'),
+                '/page/body/div/list[list-item[1][list-item-label="Term 1"][list-item-body="Def 1:1"]][list-item[2][list-item-label="Term 2"][list-item-body="Def 1:2"]][list-item[3][list-item-label="Term 3"][list-item-body="Def 1:3"]][list-item[4][list-item-label="Term 1"][list-item-body="Def 2:1"]][list-item[5][list-item-label="Term 2"][list-item-body="Def 2:2"]][list-item[6][list-item-label="Term 3"][list-item-body="Def 2:3"]]'),
             # SIMPLE LIST --> unordered list
             ('<article><simplelist><member>Item 1</member><member>Item 2</member></simplelist></article>',
-            # <page><body><div html:class="article"><list item-label-generate="unordered"><list-item><list-item-body>Unordered Item 1</list-item-body></list-item><list-item><list-item-body>Unordered Item 2</list-item-body></list-item></list></div></body></page>
-             '/page/body/div/list[@item-label-generate="unordered"][list-item[1]/list-item-body[text()="Item 1"]][list-item[2]/list-item-body[text()="Item 2"]]'),
+                # <page><body><div html:class="article"><list item-label-generate="unordered"><list-item><list-item-body>Unordered Item 1</list-item-body></list-item><list-item><list-item-body>Unordered Item 2</list-item-body></list-item></list></div></body></page>
+                '/page/body/div/list[@item-label-generate="unordered"][list-item[1]/list-item-body[text()="Item 1"]][list-item[2]/list-item-body[text()="Item 2"]]'),
             # Q and A set with defaultlabel = number --> ordered list
             ("<article><qandaset defaultlabel='number'><qandaentry><question><para>Question 1</para></question><answer><para>Answer 1</para></answer></qandaentry><qandaentry><question><para>Question 2</para></question><answer><para>Answer 2</para></answer></qandaentry></qandaset></article> ",
-            # <page><body><div html:class="article"><list item-label-generate="ordered"><list-item><list-item-body><p>Question1</p><p>Answer 1</p></list-item-body></list-item><list-item><list-item-body><p>Question 2</p><p>Answer 2</p></list-item-body></list-item></div></body></page>
-             '/page/body/div/list[@item-label-generate="ordered"][list-item[1]/list-item-body[p[1][text()="Question 1"]][p[2][text()="Answer 1"]]][list-item[2]/list-item-body[p[1][text()="Question 2"]][p[2][text()="Answer 2"]]]'),
+                # <page><body><div html:class="article"><list item-label-generate="ordered"><list-item><list-item-body><p>Question1</p><p>Answer 1</p></list-item-body></list-item><list-item><list-item-body><p>Question 2</p><p>Answer 2</p></list-item-body></list-item></div></body></page>
+                '/page/body/div/list[@item-label-generate="ordered"][list-item[1]/list-item-body[p[1][text()="Question 1"]][p[2][text()="Answer 1"]]][list-item[2]/list-item-body[p[1][text()="Question 2"]][p[2][text()="Answer 2"]]]'),
             # Q and A set with defaultlabel = qanda --> definition list, with Q: and A: for the label
             ("<article><qandaset defaultlabel='qanda'><qandaentry><question><para>Question 1</para></question><answer><para>Answer 1</para></answer></qandaentry><qandaentry><question><para>Question 2</para></question><answer><para>Answer 2</para></answer></qandaentry></qandaset></article> ",
-            # <page><body><div html:class="article"><list><list-item><list-item-label>Q: </list-item-label><list-item-body>Question 1</list-item-body></list-item><list-item><list-item-label>A: </list-item-label><list-item-body>Answer 1</list-item-body></list-item><list-item><list-item-label>Q: </list-item-label><list-item-body>Question 2</list-item-body></list-item><list-item><list-item-label>A: </list-item-label><list-item-body>Answer 2</list-item-body></list-item>
-              '/page/body/div/list[list-item[1][list-item-label="Q:"][list-item-body="Question 1"]][list-item[2][list-item-label="A:"][list-item-body="Answer 1"]][list-item[3][list-item-label="Q:"][list-item-body="Question 2"]][list-item[4][list-item-label="A:"][list-item-body="Answer 2"]]'),
+                # <page><body><div html:class="article"><list><list-item><list-item-label>Q: </list-item-label><list-item-body>Question 1</list-item-body></list-item><list-item><list-item-label>A: </list-item-label><list-item-body>Answer 1</list-item-body></list-item><list-item><list-item-label>Q: </list-item-label><list-item-body>Question 2</list-item-body></list-item><list-item><list-item-label>A: </list-item-label><list-item-body>Answer 2</list-item-body></list-item>
+                '/page/body/div/list[list-item[1][list-item-label="Q:"][list-item-body="Question 1"]][list-item[2][list-item-label="A:"][list-item-body="Answer 1"]][list-item[3][list-item-label="Q:"][list-item-body="Question 2"]][list-item[4][list-item-label="A:"][list-item-body="Answer 2"]]'),
         ]
         for i in data:
             yield (self.do, ) + i
     def test_table(self):
         data = [
             ('<article><table><thead><tr><td>Header</td></tr></thead><tfoot><tr><td>Footer</td></tr></tfoot><tbody><tr><td>Cell</td></tr></tbody></table></article>',
-            # <page><body><div html:class="article"><table><table-header><table-row><table-cell>Header</table-cell></table-row></table-header><table-footer><table-row><table-cell>Footer</table-cell></table-row></table-footer><table-body><table-row><table-cell>Cell</table-row></table-cell></table></div></body></page>
-             '/page/body/div/table[./table-header/table-row[table-cell="Header"]][./table-footer/table-row[table-cell="Footer"]][./table-body/table-row[table-cell="Cell"]]'),
+                # <page><body><div html:class="article"><table><table-header><table-row><table-cell>Header</table-cell></table-row></table-header><table-footer><table-row><table-cell>Footer</table-cell></table-row></table-footer><table-body><table-row><table-cell>Cell</table-row></table-cell></table></div></body></page>
+                '/page/body/div/table[./table-header/table-row[table-cell="Header"]][./table-footer/table-row[table-cell="Footer"]][./table-body/table-row[table-cell="Cell"]]'),
             ('<article><table><tbody><tr><td colspan="2">Cell</td></tr></tbody></table></article>',
-            # <page><body><div html:class="article"><table><table-body><table-row><table-cell number-columns-spanned="2">Cell</table-cell></table-row></table-body></table></div></body></page>
-             '/page/body/div/table/table-body/table-row/table-cell[text()="Cell"][@number-columns-spanned="2"]'),
+                # <page><body><div html:class="article"><table><table-body><table-row><table-cell number-columns-spanned="2">Cell</table-cell></table-row></table-body></table></div></body></page>
+                '/page/body/div/table/table-body/table-row/table-cell[text()="Cell"][@number-columns-spanned="2"]'),
             ('<article><table><tbody><tr><td rowspan="2">Cell</td></tr></tbody></table></article>',
-            # <page><body><div html:class="article"><table><table-body><table-row><table-cell number-rows-spanned="2">Cell</table-cell></table-row></table-body></table></div></body></page>
-             '/page/body/div/table/table-body/table-row/table-cell[text()="Cell"][@number-rows-spanned="2"]'),
+                # <page><body><div html:class="article"><table><table-body><table-row><table-cell number-rows-spanned="2">Cell</table-cell></table-row></table-body></table></div></body></page>
+                '/page/body/div/table/table-body/table-row/table-cell[text()="Cell"][@number-rows-spanned="2"]'),
             # Simple db.cals.table
             ('<article><table xml:id="ex.calstable"><tgroup cols="2"><thead><row><entry>a1</entry><entry>a2</entry></row></thead><tfoot><row><entry>f1</entry><entry>f2</entry></row></tfoot><tbody><row><entry>b1</entry><entry>b2</entry></row></tbody></tgroup></table></article>',
-            # <page><body><div html:class="article"><table><table-header><table-row><table-cell>a1</table-cell><table-cell>a2</table-cell></table-row></table-header><table-footer><table-row><table-cell>f1</table-cell><table-cell>f2</table-cell></table-row></table-footer><table-body><table-row><table-cell>b1</table-row><table-cell>b2</table-row></table-cell></table></div></body></page>
-             '/page/body/div/table[./table-header/table-row[table-cell="a1"][table-cell="a2"]][./table-footer/table-row[table-cell="f1"][table-cell="f2"]][./table-body/table-row[table-cell="b1"][table-cell="b2"]]'),
+                # <page><body><div html:class="article"><table><table-header><table-row><table-cell>a1</table-cell><table-cell>a2</table-cell></table-row></table-header><table-footer><table-row><table-cell>f1</table-cell><table-cell>f2</table-cell></table-row></table-footer><table-body><table-row><table-cell>b1</table-row><table-cell>b2</table-row></table-cell></table></div></body></page>
+                '/page/body/div/table[./table-header/table-row[table-cell="a1"][table-cell="a2"]][./table-footer/table-row[table-cell="f1"][table-cell="f2"]][./table-body/table-row[table-cell="b1"][table-cell="b2"]]'),
             # db.cals.table with entry table.
             ('<article><table xml:id="ex.calstable"><tgroup cols="1"><thead><row><entry>a1</entry></row></thead><tfoot><row><entry>f1</entry></row></tfoot><tbody><row><entrytbl cols="1"><tbody><row><entry>s1</entry></row></tbody></entrytbl></row></tbody></tgroup></table></article>',
-            # <page><body><div html:class="article"><table><table-header><table-row><table-cell>a1</table-cell></table-row></table-header><table-footer><table-row><table-cell>f1</table-cell></table-row></table-footer><table-body><table-row><table-cell><table><table-body><table-row><table-cell>s1</table-cell></table-row></table-body></table></table-row></table-cell></table></div></body></page>
-             '/page/body/div/table[./table-header/table-row[table-cell="a1"]][./table-footer/table-row[table-cell="f1"]][./table-body/table-row[table-cell/table/table-body/table-row[table-cell="s1"]]]'),
+                # <page><body><div html:class="article"><table><table-header><table-row><table-cell>a1</table-cell></table-row></table-header><table-footer><table-row><table-cell>f1</table-cell></table-row></table-footer><table-body><table-row><table-cell><table><table-body><table-row><table-cell>s1</table-cell></table-row></table-body></table></table-row></table-cell></table></div></body></page>
+                '/page/body/div/table[./table-header/table-row[table-cell="a1"]][./table-footer/table-row[table-cell="f1"]][./table-body/table-row[table-cell/table/table-body/table-row[table-cell="s1"]]]'),
         ]
         for i in data:
             yield (self.do, ) + i
     def test_misc(self):
         data = [
             ('<article><para>Text Para<footnote><para>Text Footnote</para></footnote></para></article>',
-            # <page><body><div html:class="article"><p>Text Para<note note-class="footnote"><note-body><p>Text Footnote</p></note-body></note></p></div></body></page>
-             '/page/body/div/p[text()="Text Para"]/note[@note-class="footnote"]/note-body/p[text()="Text Footnote"]'),
+                # <page><body><div html:class="article"><p>Text Para<note note-class="footnote"><note-body><p>Text Footnote</p></note-body></note></p></div></body></page>
+                '/page/body/div/p[text()="Text Para"]/note[@note-class="footnote"]/note-body/p[text()="Text Footnote"]'),
             ('<article><para><quote>text</quote></para></article>',
-            # <page><body><div html:class="article"><p><quote>text</quote></para></article>
-            '/page/body/div/p[quote="text"]'),
+                # <page><body><div html:class="article"><p><quote>text</quote></para></article>
+                '/page/body/div/p[quote="text"]'),
             # Test span for inline element
             ('<article><para><abbrev>ABBREV</abbrev></para></article>',
-            # <page><body><div html:class="article"><p><span class="db-abbrev">ABBREV</span></p></div></body></page>
-             '/page/body/div/p/span[@html:class="db-abbrev"][text()="ABBREV"]'),
+                # <page><body><div html:class="article"><p><span class="db-abbrev">ABBREV</span></p></div></body></page>
+                '/page/body/div/p/span[@html:class="db-abbrev"][text()="ABBREV"]'),
             # Test div for block element
             ('<article><acknowledgements><para>Text</para></acknowledgements></article>',
-            # <page><body><div html:class="article"><div html:class="db-acknowledgements"><p>Text</p></div></div></body></page>
-            '/page/body/div/div[@html:class="db-acknowledgements"][p="Text"]'),
+                # <page><body><div html:class="article"><div html:class="db-acknowledgements"><p>Text</p></div></div></body></page>
+                '/page/body/div/div[@html:class="db-acknowledgements"][p="Text"]'),
             # Test for <informalequation>
             ('<article><informalequation><para>E = mc^2</para></informalequation></article>',
-            # <page><body><div html:class="article"><div html:class="db-equation"><p>E = mc^2</p></div></div></body></page>
-             '/page/body/div/div[@html:class="db-equation"][p="E = mc^2"]'),
+                # <page><body><div html:class="article"><div html:class="db-equation"><p>E = mc^2</p></div></div></body></page>
+                '/page/body/div/div[@html:class="db-equation"][p="E = mc^2"]'),
             # Test for <informalexample>
             ('<article><informalexample><para>example</para></informalexample></article>',
-            # <page><body><div html:class="article"><div html:class="db-example"><p>example</p></div></div></body></page>
-             '/page/body/div/div[@html:class="db-example"][p="example"]'),
+                # <page><body><div html:class="article"><div html:class="db-example"><p>example</p></div></div></body></page>
+                '/page/body/div/div[@html:class="db-example"][p="example"]'),
             # Test for <sbr />
             ('<article><cmdsynopsis><para>Line 1<sbr />Line 2</para></cmdsynopsis></article>',
-            # <page><body><div html:class="article"><div html:class="db-cmdsynopsis"><p>Line 1<line-break />Line 2</p></div></div></body></page>
-            '/page/body/div/div[@html:class="db-cmdsynopsis"]/p/line-break'),
+                # <page><body><div html:class="article"><div html:class="db-cmdsynopsis"><p>Line 1<line-break />Line 2</p></div></div></body></page>
+                '/page/body/div/div[@html:class="db-cmdsynopsis"]/p/line-break'),
             # Test for <tag> element with class and namespace attribute
             ('<article><para><tag class="attribute" namespace="namespace">TAG</tag></para></article>',
-            # <page><body><div html:class="article"><p><span class="db-tag-attribute">{namespace}TAG</span></p></div></article>
-            '/page/body/div/p/span[@html:class="db-tag-attribute"][text()="{namespace}TAG"]'),
+                # <page><body><div html:class="article"><p><span class="db-tag-attribute">{namespace}TAG</span></p></div></article>
+                '/page/body/div/p/span[@html:class="db-tag-attribute"][text()="{namespace}TAG"]'),
             # Test for <tag> element without class and namespace attribute
             ('<article><para><tag>TAG</tag></para></article>',
-            # <page><body><div html:class="article"><p><span class="db-tag">TAG</span></p></div></article>
-            '/page/body/div/p/span[@html:class="db-tag"][text()="TAG"]'),
+                # <page><body><div html:class="article"><p><span class="db-tag">TAG</span></p></div></article>
+                '/page/body/div/p/span[@html:class="db-tag"][text()="TAG"]'),
         ]
         for i in data:
             yield (self.do, ) + i
         data = [
             # Normal link, with conversion of all the xlink attributes
             ('<article><para><link xlink:href="uri:test" xlink:title="title">link</link></para></article>',
-            # <page><body><div html:class="article"><p><a xlink:href="uri:test" xlink:title="title">link</a></p></div></body></page>
-             '/page/body/div/p/a[@xlink:href="uri:test"][@xlink:title="title"][text()="link"]'),
+                # <page><body><div html:class="article"><p><a xlink:href="uri:test" xlink:title="title">link</a></p></div></body></page>
+                '/page/body/div/p/a[@xlink:href="uri:test"][@xlink:title="title"][text()="link"]'),
             # Old link from DocBook v.4.X for backward compatibility
             ('<article><para><ulink url="url:test">link</ulink></para></article>',
-            # <page><body><div html:class="article"><p><a xlink:href="url:test">link</a></p></div></body></page>
-             '/page/body/div/p/a[@xlink:href="url:test"][text()="link"]'),
+                # <page><body><div html:class="article"><p><a xlink:href="url:test">link</a></p></div></body></page>
+                '/page/body/div/p/a[@xlink:href="url:test"][text()="link"]'),
             # Normal link, with linkend attribute
             ('<article><para><link linkend="anchor">link</link></para></article>',
-            # <page><body><div html:class="article"><p><a xlink:href="#anchor">link</a></p></div></body></page>
-             '/page/body/div/p/a[@xlink:href="#anchor"][text()="link"]'),
+                # <page><body><div html:class="article"><p><a xlink:href="#anchor">link</a></p></div></body></page>
+                '/page/body/div/p/a[@xlink:href="#anchor"][text()="link"]'),
             # OLINK
             ('<article><para><olink targetdoc="uri" targetptr="anchor">link</olink></para></article>',
-            # <page><body><div html:class="article"><para><a xlink:href="uri#anchor">link</a></para></div></body></page>
-             '/page/body/div/p/a[@xlink:href="uri#anchor"][text()="link"]'),
+                # <page><body><div html:class="article"><para><a xlink:href="uri#anchor">link</a></para></div></body></page>
+                '/page/body/div/p/a[@xlink:href="uri#anchor"][text()="link"]'),
             # Link w/ javascript: scheme
             ('<article><para><ulink url="javascript:alert(\'xss\')">link</ulink></para></article>',
-            # <page><body><div html:class="article"><p><a xlink:href="url:test">link</a></p></div></body></page>
-             '/page/body/div/p/a[@xlink:href=""][text()="link"]'),
+                # <page><body><div html:class="article"><p><a xlink:href="url:test">link</a></p></div></body></page>
+                '/page/body/div/p/a[@xlink:href=""][text()="link"]'),
         ]
         for i in data:
             yield (self.do, ) + i
     def test_code(self):
         data = [
             ('<article><screen>Text</screen></article>',
-            # <page><body><div html:class="article"><blockcode>Text</blockcode></div></body></page>
-             '/page/body/div[blockcode="Text"]'),
+                # <page><body><div html:class="article"><blockcode>Text</blockcode></div></body></page>
+                '/page/body/div[blockcode="Text"]'),
             # Test for <screen> with CDATA
             ('<article><screen><![CDATA[Text]]></screen></article>',
-            # <page><body><div html:class="article"><blockcode>Text</blockcode></div></body></page>
-             '/page/body/div[blockcode="Text"]'),
+                # <page><body><div html:class="article"><blockcode>Text</blockcode></div></body></page>
+                '/page/body/div[blockcode="Text"]'),
             # PROGRAMLISTING --> BLOCKCODE
             ('<article><programlisting>Text</programlisting></article>',
-            # <page><body><div html:class="article"><blockcode>Text</blockcode></div></body></page>
-             '/page/body/div[blockcode="Text"]'),
+                # <page><body><div html:class="article"><blockcode>Text</blockcode></div></body></page>
+                '/page/body/div[blockcode="Text"]'),
             # LITERAL --> CODE
             ('<article><para>text<literal>literal</literal></para></article>',
-            # <page><body><div html:class="article"><p>text<code>literal</code></p></div></body></page>
-             '/page/body/div/p[text()="text"][code="literal"]'),
+                # <page><body><div html:class="article"><p>text<code>literal</code></p></div></body></page>
+                '/page/body/div/p[text()="text"][code="literal"]'),
             ('<article><blockquote><attribution>author</attribution>text</blockquote></article>',
-            # <page><body><div html:class="article"><blockquote source="author">text</blockquote></div></body></page>
-            '/page/body/div/blockquote[@source="author"][text()="text"]'),
+                # <page><body><div html:class="article"><blockquote source="author">text</blockquote></div></body></page>
+                '/page/body/div/blockquote[@source="author"][text()="text"]'),
             # CODE --> CODE
             ('<article><para><code>Text</code></para></article>',
-            # <page><body><div html:class="article"><p><code>Text</code></p></article>
-            '/page/body/div/p[code="Text"]'),
+                # <page><body><div html:class="article"><p><code>Text</code></p></article>
+                '/page/body/div/p[code="Text"]'),
             # COMPUTEROUTPUT --> CODE
             ('<article><para><computeroutput>Text</computeroutput></para></article>',
-            # <page><body><div html:class="article"><p><code>Text</code></p></article>
-            '/page/body/div/p[code="Text"]'),
+                # <page><body><div html:class="article"><p><code>Text</code></p></article>
+                '/page/body/div/p[code="Text"]'),
             # MARKUP --> CODE
             ('<article><para><markup>Text</markup></para></article>',
-            # <page><body><div html:class="article"><p><code>Text</code></p></article>
-            '/page/body/div/p[code="Text"]'),
+                # <page><body><div html:class="article"><p><code>Text</code></p></article>
+                '/page/body/div/p[code="Text"]'),
             # LITERALLAYOUT --> BLOCKCODE
             ('<article><literallayout>Text</literallayout></article>',
-             # <page><body><div html:class="article"><blockcode html:class="db-literallayout">Text</blockcode></div></body></page>
-             '/page/body/div/blockcode[text()="Text"][@html:class="db-literallayout"]'),
+                # <page><body><div html:class="article"><blockcode html:class="db-literallayout">Text</blockcode></div></body></page>
+                '/page/body/div/blockcode[text()="Text"][@html:class="db-literallayout"]'),
         ]
         for i in data:
             yield (self.do, ) + i
         data = [
             # Test for image object
             ('<article><para><inlinemediaobject><imageobject><imagedata fileref="test.png"/></imageobject></inlinemediaobject></para></article>',
-            # <page><body><div html:class="article"><p><object xlink:href="test.png" type='image/' /></p></div></body></page>
-            '/page/body/div/p/span[@html:class="db-inlinemediaobject"]/object[@xlink:href="test.png"][@type="image/"]'),
+                # <page><body><div html:class="article"><p><object xlink:href="test.png" type='image/' /></p></div></body></page>
+                '/page/body/div/p/span[@html:class="db-inlinemediaobject"]/object[@xlink:href="test.png"][@type="image/"]'),
             # Test for audio object
             ('<article><para><inlinemediaobject><audioobject><audiodata fileref="test.wav"/></audioobject></inlinemediaobject></para></article>',
-            # <page><body><div html:class="article"><p><object xlink:href="test.wav" type='audio/' /></p></div></body></page>
-            '/page/body/div/p/span[@html:class="db-inlinemediaobject"]/object[@xlink:href="test.wav"][@type="audio/"]'),
+                # <page><body><div html:class="article"><p><object xlink:href="test.wav" type='audio/' /></p></div></body></page>
+                '/page/body/div/p/span[@html:class="db-inlinemediaobject"]/object[@xlink:href="test.wav"][@type="audio/"]'),
             # Test for video object
             ('<article><para><mediaobject><videoobject><videodata fileref="test.avi"/></videoobject></mediaobject></para></article>',
-            # <page><body><div html:class="article"><p><object xlink:href="test.avi" type='video/' /></p></div></body></page>
-             '/page/body/div/p/div[@html:class="db-mediaobject"]/object[@xlink:href="test.avi"][@type="video/"]'),
+                # <page><body><div html:class="article"><p><object xlink:href="test.avi" type='video/' /></p></div></body></page>
+                '/page/body/div/p/div[@html:class="db-mediaobject"]/object[@xlink:href="test.avi"][@type="video/"]'),
             # Test for image object with different imagedata
             ('<article><mediaobject><imageobject><imagedata fileref="figures/eiffeltower.eps" format="EPS"/></imageobject><imageobject><imagedata fileref="figures/eiffeltower.png" format="PNG"/></imageobject><textobject><phrase>The Eiffel Tower</phrase> </textobject><caption><para>Designed by Gustave Eiffel in 1889, The Eiffel Tower is one of the most widely recognized buildings in the world.</para>  </caption></mediaobject></article>',
-            # <page><body><div html:class="article"><div html:class="db-mediaobject"><object xlink:href="figures/eiffeltowe.png" /></div></div></body></page>
-            '/page/body/div/div[@html:class="db-mediaobject"]/object[@xlink:href="figures/eiffeltower.png"][@type="image/png"]'),
+                # <page><body><div html:class="article"><div html:class="db-mediaobject"><object xlink:href="figures/eiffeltowe.png" /></div></div></body></page>
+                '/page/body/div/div[@html:class="db-mediaobject"]/object[@xlink:href="figures/eiffeltower.png"][@type="image/png"]'),
         ]
         for i in data:
             yield (self.do, ) + i