changeset 1443:7e52a847d5ff

merged
author Pavel Sviderski <pavel@psviderski.name>
date Thu, 21 Jun 2012 03:33:59 +0400
parents 11a61fb8d985 (current diff) 3989635de0fb (diff)
children 34069422fde1
files MoinMoin/_tests/pep8.py MoinMoin/apps/frontend/views.py MoinMoin/static/js/countdown.js MoinMoin/storage/middleware/indexing.py MoinMoin/themes/modernized/static/css/common.css
diffstat 63 files changed, 266 insertions(+), 1214 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Thu Jun 21 02:56:28 2012 +0400
+++ b/.hgignore	Thu Jun 21 03:33:59 2012 +0400
@@ -25,3 +25,5 @@
 .orig$
 .rej$
 .~$
+^docs/devel/api/modules.rst
+^upload.py
--- a/MoinMoin/_tests/pep8.py	Thu Jun 21 02:56:28 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,917 +0,0 @@
-#!/usr/bin/python
-# pep8.py - Check Python source code formatting, according to PEP 8
-# Copyright (C) 2006 Johann C. Rocholl <johann@browsershots.org>
-#
-# Permission is hereby granted, free of charge, to any person
-# obtaining a copy of this software and associated documentation files
-# (the "Software"), to deal in the Software without restriction,
-# including without limitation the rights to use, copy, modify, merge,
-# publish, distribute, sublicense, and/or sell copies of the Software,
-# and to permit persons to whom the Software is furnished to do so,
-# subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-"""
-Check Python source code formatting, according to PEP 8:
-http://www.python.org/dev/peps/pep-0008/
-
-For usage and a list of options, try this:
-$ python pep8.py -h
-
-This program and its regression test suite live here:
-http://svn.browsershots.org/trunk/devtools/pep8/
-http://trac.browsershots.org/browser/trunk/devtools/pep8/
-
-Groups of errors and warnings:
-E errors
-W warnings
-100 indentation
-200 whitespace
-300 blank lines
-400 imports
-500 line length
-600 deprecation
-700 statements
-
-You can add checks to this program by writing plugins. Each plugin is
-a simple function that is called for each line of source code, either
-physical or logical.
-
-Physical line:
-- Raw line of text from the input file.
-
-Logical line:
-- Multi-line statements converted to a single line.
-- Stripped left and right.
-- Contents of strings replaced with 'xxx' of same length.
-- Comments removed.
-
-The check function requests physical or logical lines by the name of
-the first argument:
-
-def maximum_line_length(physical_line)
-def extraneous_whitespace(logical_line)
-def blank_lines(logical_line, blank_lines, indent_level, line_number)
-
-The last example above demonstrates how check plugins can request
-additional information with extra arguments. All attributes of the
-Checker object are available. Some examples:
-
-lines: a list of the raw lines from the input file
-tokens: the tokens that contribute to this logical line
-line_number: line number in the input file
-blank_lines: blank lines before this one
-indent_char: first indentation character in this file (' ' or '\t')
-indent_level: indentation (with tabs expanded to multiples of 8)
-previous_indent_level: indentation on previous line
-previous_logical: previous logical line
-
-The docstring of each check function shall be the relevant part of
-text from PEP 8. It is printed if the user enables --show-pep8.
-
-"""
-
-import os
-import sys
-import re
-import time
-import inspect
-import tokenize
-from optparse import OptionParser
-from keyword import iskeyword
-from fnmatch import fnmatch
-
-__version__ = '0.2.0'
-__revision__ = '$Rev$'
-
-default_exclude = '.svn,CVS,*.pyc,*.pyo'
-
-indent_match = re.compile(r'([ \t]*)').match
-raise_comma_match = re.compile(r'raise\s+\w+\s*(,)').match
-equals_boolean_search = re.compile(r'([!=]=\s*(True|False))|((True|False)\s*[!=]=)').search
-equals_None_search = re.compile(r'([!=]=\s*None)|(None\s*[!=]=)').search
-
-not_one_ws_around_operators_match = re.compile(r'^[^\(\[]+[^\s](\+|\-|\*|/|%|\^|&|\||=|<|>|>>|<<|\+=|\-=|\*=|/=|%=|\^=|&=|\|=|==|<=|>=|>>=|<<=|!=|<>)[^\s][^\)\]]+$').match
-
-operators = """
-+  -  *  /  %  ^  &  |  =  <  >  >>  <<
-+= -= *= /= %= ^= &= |= == <= >= >>= <<=
-!= <> :
-in is or not and
-""".split()
-
-options = None
-args = None
-
-
-##############################################################################
-# Plugins (check functions) for physical lines
-##############################################################################
-
-
-def tabs_or_spaces(physical_line, indent_char):
-    """
-    Never mix tabs and spaces.
-
-    The most popular way of indenting Python is with spaces only.  The
-    second-most popular way is with tabs only.  Code indented with a mixture
-    of tabs and spaces should be converted to using spaces exclusively.  When
-    invoking the Python command line interpreter with the -t option, it issues
-    warnings about code that illegally mixes tabs and spaces.  When using -tt
-    these warnings become errors.  These options are highly recommended!
-    """
-    indent = indent_match(physical_line).group(1)
-    for offset, char in enumerate(indent):
-        if char != indent_char:
-            return offset, "E101 indentation contains mixed spaces and tabs"
-
-
-def tabs_obsolete(physical_line):
-    """
-    For new projects, spaces-only are strongly recommended over tabs.  Most
-    editors have features that make this easy to do.
-    """
-    indent = indent_match(physical_line).group(1)
-    if indent.count('\t'):
-        return indent.index('\t'), "W191 indentation contains tabs"
-
-
-def trailing_whitespace(physical_line):
-    """
-    JCR: Trailing whitespace is superfluous.
-    """
-    physical_line = physical_line.rstrip('\n') # chr(10), newline
-    physical_line = physical_line.rstrip('\r') # chr(13), carriage return
-    physical_line = physical_line.rstrip('\x0c') # chr(12), form feed, ^L
-    stripped = physical_line.rstrip()
-    if physical_line != stripped:
-        return len(stripped), "W291 trailing whitespace"
-
-
-def trailing_blank_lines(physical_line, lines, line_number):
-    """
-    JCR: Trailing blank lines are superfluous.
-    """
-    if physical_line.strip() == '' and line_number == len(lines):
-        return 0, "W391 blank line at end of file"
-
-
-def missing_newline(physical_line):
-    """
-    JCR: The last line should have a newline.
-    """
-    if physical_line.rstrip() == physical_line:
-        return len(physical_line), "W292 no newline at end of file"
-
-
-def maximum_line_length(physical_line):
-    """
-    Limit all lines to a maximum of 79 characters.
-
-    There are still many devices around that are limited to 80 character
-    lines; plus, limiting windows to 80 characters makes it possible to have
-    several windows side-by-side.  The default wrapping on such devices looks
-    ugly.  Therefore, please limit all lines to a maximum of 79 characters.
-    For flowing long blocks of text (docstrings or comments), limiting the
-    length to 72 characters is recommended.
-    """
-    length = len(physical_line.rstrip())
-    if length > 79:
-        return 79, "E501 line too long (%d characters)" % length
-
-
-def crlf_lines(physical_line):
-    """
-    Line contains CR (e.g. as a CRLF line ending).
-
-    Many free software projects have a strong focus on POSIX platforms (like
-    Linux, *BSD, Unix, Mac OS X, etc.) and they all use LF-only line endings.
-    Only Win32 platform uses CRLF line endings.
-    So if you have a Win32-only source code using CRLF line endings, you might
-    want to exclude this test.
-    """
-    pos = physical_line.find('\r')
-    if pos >= 0:
-        return pos, "W293 line contains CR char(s)"
-
-
-##############################################################################
-# Plugins (check functions) for logical lines
-##############################################################################
-
-
-def blank_lines(logical_line, blank_lines, indent_level, line_number,
-                previous_logical):
-    """
-    Separate top-level function and class definitions with two blank lines.
-
-    Method definitions inside a class are separated by a single blank line.
-
-    Extra blank lines may be used (sparingly) to separate groups of related
-    functions.  Blank lines may be omitted between a bunch of related
-    one-liners (e.g. a set of dummy implementations).
-
-    Use blank lines in functions, sparingly, to indicate logical sections.
-    """
-    if line_number == 1:
-        return # Don't expect blank lines before the first line
-    if previous_logical.startswith('@'):
-        return # Don't expect blank lines after function decorator
-    if (logical_line.startswith('def ') or
-        logical_line.startswith('class ') or
-        logical_line.startswith('@')):
-        if indent_level > 0 and blank_lines != 1:
-            return 0, "E301 expected 1 blank line, found %d" % blank_lines
-        if indent_level == 0 and blank_lines != 2:
-            return 0, "E302 expected 2 blank lines, found %d" % blank_lines
-    if blank_lines > 2:
-        return 0, "E303 too many blank lines (%d)" % blank_lines
-
-
-def extraneous_whitespace(logical_line):
-    """
-    Avoid extraneous whitespace in the following situations:
-
-    - Immediately inside parentheses, brackets or braces.
-
-    - Immediately before a comma, semicolon, or colon.
-    """
-    line = logical_line
-    for char in '([{':
-        found = line.find(char + ' ')
-        if found > -1:
-            return found + 1, "E201 whitespace after '%s'" % char
-    for char in '}])':
-        found = line.find(' ' + char)
-        if found > -1 and line[found - 1] != ',':
-            return found, "E202 whitespace before '%s'" % char
-    for char in ',;:':
-        found = line.find(' ' + char)
-        if found > -1:
-            return found, "E203 whitespace before '%s'" % char
-
-
-def missing_whitespace(logical_line):
-    """
-    JCR: Each comma, semicolon or colon should be followed by whitespace.
-    """
-    line = logical_line
-    for index in range(len(line) - 1):
-        char = line[index]
-        if char in ',;:' and line[index + 1] != ' ':
-            before = line[:index]
-            if char == ':' and before.count('[') > before.count(']'):
-                continue # Slice syntax, no space required
-            return index, "E231 missing whitespace after '%s'" % char
-
-
-def indentation(logical_line, previous_logical, indent_char,
-                indent_level, previous_indent_level):
-    """
-    Use 4 spaces per indentation level.
-
-    For really old code that you don't want to mess up, you can continue to
-    use 8-space tabs.
-    """
-    if indent_char == ' ' and indent_level % 4:
-        return 0, "E111 indentation is not a multiple of four"
-    indent_expect = previous_logical.endswith(':')
-    if indent_expect and indent_level <= previous_indent_level:
-        return 0, "E112 expected an indented block"
-    if indent_level > previous_indent_level and not indent_expect:
-        return 0, "E113 unexpected indentation"
-
-
-def whitespace_before_parameters(logical_line, tokens):
-    """
-    Avoid extraneous whitespace in the following situations:
-
-    - Immediately before the open parenthesis that starts the argument
-      list of a function call.
-
-    - Immediately before the open parenthesis that starts an indexing or
-      slicing.
-    """
-    prev_type = tokens[0][0]
-    prev_text = tokens[0][1]
-    prev_end = tokens[0][3]
-    for index in range(1, len(tokens)):
-        token_type, text, start, end, line = tokens[index]
-        if (token_type == tokenize.OP and
-            text in '([' and
-            start != prev_end and
-            prev_type == tokenize.NAME and
-            (index < 2 or tokens[index - 2][1] != 'class') and
-            (not iskeyword(prev_text))):
-            return prev_end, "E211 whitespace before '%s'" % text
-        prev_type = token_type
-        prev_text = text
-        prev_end = end
-
-
-def extra_whitespace_around_operator(logical_line):
-    """
-    Avoid extraneous whitespace in the following situations:
-
-    - More than one space around an assignment (or other) operator to
-      align it with another.
-    """
-    line = logical_line
-    for operator in operators:
-        found = line.find('  ' + operator)
-        if found > -1:
-            return found, "E221 multiple spaces before operator"
-        found = line.find(operator + '  ')
-        if found > -1:
-            return found, "E222 multiple spaces after operator"
-        found = line.find('\t' + operator)
-        if found > -1:
-            return found, "E223 tab before operator"
-        found = line.find(operator + '\t')
-        if found > -1:
-            return found, "E224 tab after operator"
-
-
-def whitespace_around_operator(logical_line):
-    """
-    Have exactly 1 space left and right of the operator.
-    """
-    match = not_one_ws_around_operators_match(logical_line)
-    if match and not 'lambda' in logical_line:
-        return match.start(1), "E225 operators shall be surrounded by a single space on each side %s" % logical_line
-
-
-def whitespace_around_comma(logical_line):
-    """
-    Avoid extraneous whitespace in the following situations:
-
-    - More than one space around an assignment (or other) operator to
-      align it with another.
-
-    JCR: This should also be applied around comma etc.
-    """
-    line = logical_line
-    for separator in ',;:':
-        found = line.find(separator + '  ')
-        if found > -1:
-            return found + 1, "E241 multiple spaces after '%s'" % separator
-        found = line.find(separator + '\t')
-        if found > -1:
-            return found + 1, "E242 tab after '%s'" % separator
-
-
-def imports_on_separate_lines(logical_line):
-    """
-    Imports should usually be on separate lines.
-    """
-    line = logical_line
-    if line.startswith('import '):
-        found = line.find(',')
-        if found > -1:
-            return found, "E401 multiple imports on one line"
-
-
-def compound_statements(logical_line):
-    """
-    Compound statements (multiple statements on the same line) are
-    generally discouraged.
-    """
-    line = logical_line
-    found = line.find(':')
-    if -1 < found < len(line) - 1:
-        before = line[:found]
-        if (before.count('{') <= before.count('}') and # {'a': 1} (dict)
-            before.count('[') <= before.count(']') and # [1:2] (slice)
-            not re.search(r'\blambda\b', before)):     # lambda x: x
-            return found, "E701 multiple statements on one line (colon)"
-    found = line.find(';')
-    if -1 < found:
-        return found, "E702 multiple statements on one line (semicolon)"
-
-
-def python_3000_has_key(logical_line):
-    """
-    The {}.has_key() method will be removed in the future version of
-    Python. Use the 'in' operation instead, like:
-    d = {"a": 1, "b": 2}
-    if "b" in d:
-        print d["b"]
-    """
-    pos = logical_line.find('.has_key(')
-    if pos > -1:
-        return pos, "W601 .has_key() is deprecated, use 'in'"
-
-
-def python_3000_raise_comma(logical_line):
-    """
-    When raising an exception, use "raise ValueError('message')"
-    instead of the older form "raise ValueError, 'message'".
-
-    The paren-using form is preferred because when the exception arguments
-    are long or include string formatting, you don't need to use line
-    continuation characters thanks to the containing parentheses.  The older
-    form will be removed in Python 3000.
-    """
-    match = raise_comma_match(logical_line)
-    if match:
-        return match.start(1), "W602 deprecated form of raising exception"
-
-
-def dumb_equals_boolean(logical_line):
-    """
-    Using "if x == True:" or "if x == False:" is wrong in any case:
-
-    First if you already have a boolean, you don't need to compare it to
-    another boolean. Just use "if x:" or "if not x:".
-
-    Second, even if you have some sort of "tristate logic", not only using
-    True/False, but other values, then you want to use "if x is True:" or
-    "if x is False:" because there is exactly one True and one False object.
-    """
-    match = equals_boolean_search(logical_line)
-    if match:
-        return match.start(1), "E798 don't use 'x == <boolean>', but just 'x' or 'not x' or 'x is <boolean>'"
-
-
-def dumb_equals_None(logical_line):
-    """
-    Using "if x == None:" is wrong in any case:
-
-    You either want to use "if x is None:" (there is only 1 None object) or -
-    in some simple cases - just "if not x:".
-    """
-    match = equals_None_search(logical_line)
-    if match:
-        return match.start(1), "E799 don't use 'x == None', but just 'x is None' or 'not x'"
-
-
-##############################################################################
-# Helper functions
-##############################################################################
-
-
-def expand_indent(line):
-    """
-    Return the amount of indentation.
-    Tabs are expanded to the next multiple of 8.
-
-    >>> expand_indent('    ')
-    4
-    >>> expand_indent('\\t')
-    8
-    >>> expand_indent('    \\t')
-    8
-    >>> expand_indent('       \\t')
-    8
-    >>> expand_indent('        \\t')
-    16
-    """
-    result = 0
-    for char in line:
-        if char == '\t':
-            result = result / 8 * 8 + 8
-        elif char == ' ':
-            result += 1
-        else:
-            break
-    return result
-
-
-##############################################################################
-# Framework to run all checks
-##############################################################################
-
-
-def message(text):
-    """Print a message."""
-    # print >> sys.stderr, options.prog + ': ' + text
-    # print >> sys.stderr, text
-    print text
-
-
-def find_checks(argument_name):
-    """
-    Find all globally visible functions where the first argument name
-    starts with argument_name.
-    """
-    checks = []
-    function_type = type(find_checks)
-    for name, function in globals().iteritems():
-        if type(function) is function_type:
-            args = inspect.getargspec(function)[0]
-            if len(args) >= 1 and args[0].startswith(argument_name):
-                checks.append((name, function, args))
-    checks.sort()
-    return checks
-
-
-def mute_string(text):
-    """
-    Replace contents with 'xxx' to prevent syntax matching.
-
-    >>> mute_string('"abc"')
-    '"xxx"'
-    >>> mute_string("'''abc'''")
-    "'''xxx'''"
-    >>> mute_string("r'abc'")
-    "r'xxx'"
-    """
-    start = 1
-    end = len(text) - 1
-    # String modifiers (e.g. u or r)
-    if text.endswith('"'):
-        start += text.index('"')
-    elif text.endswith("'"):
-        start += text.index("'")
-    # Triple quotes
-    if text.endswith('"""') or text.endswith("'''"):
-        start += 2
-        end -= 2
-    return text[:start] + 'x' * (end - start) + text[end:]
-
-
-class Checker:
-    """
-    Load a Python source file, tokenize it, check coding style.
-    """
-
-    def __init__(self, filename):
-        self.filename = filename
-        self.lines = file(filename, 'rb').readlines()
-        self.physical_checks = find_checks('physical_line')
-        self.logical_checks = find_checks('logical_line')
-        options.counters['physical lines'] = \
-            options.counters.get('physical lines', 0) + len(self.lines)
-
-    def readline(self):
-        """
-        Get the next line from the input buffer.
-        """
-        self.line_number += 1
-        if self.line_number > len(self.lines):
-            return ''
-        return self.lines[self.line_number - 1]
-
-    def readline_check_physical(self):
-        """
-        Check and return the next physical line. This method can be
-        used to feed tokenize.generate_tokens.
-        """
-        line = self.readline()
-        if line:
-            self.check_physical(line)
-        return line
-
-    def run_check(self, check, argument_names):
-        """
-        Run a check plugin.
-        """
-        arguments = []
-        for name in argument_names:
-            arguments.append(getattr(self, name))
-        return check(*arguments)
-
-    def check_physical(self, line):
-        """
-        Run all physical checks on a raw input line.
-        """
-        self.physical_line = line
-        if self.indent_char is None and len(line) and line[0] in ' \t':
-            self.indent_char = line[0]
-        for name, check, argument_names in self.physical_checks:
-            result = self.run_check(check, argument_names)
-            if result is not None:
-                offset, text = result
-                self.report_error(self.line_number, offset, text, check)
-
-    def build_tokens_line(self):
-        """
-        Build a logical line from tokens.
-        """
-        self.mapping = []
-        logical = []
-        length = 0
-        previous = None
-        for token in self.tokens:
-            token_type, text = token[0:2]
-            if token_type in (tokenize.COMMENT, tokenize.NL,
-                              tokenize.INDENT, tokenize.DEDENT,
-                              tokenize.NEWLINE):
-                continue
-            if token_type == tokenize.STRING:
-                text = mute_string(text)
-            if previous:
-                end_line, end = previous[3]
-                start_line, start = token[2]
-                if end_line != start_line: # different row
-                    if self.lines[end_line - 1][end - 1] not in '{[(':
-                        logical.append(' ')
-                        length += 1
-                elif end != start: # different column
-                    fill = self.lines[end_line - 1][end:start]
-                    logical.append(fill)
-                    length += len(fill)
-            self.mapping.append((length, token))
-            logical.append(text)
-            length += len(text)
-            previous = token
-        self.logical_line = ''.join(logical)
-        assert self.logical_line.lstrip() == self.logical_line
-        assert self.logical_line.rstrip() == self.logical_line
-
-    def check_logical(self):
-        """
-        Build a line from tokens and run all logical checks on it.
-        """
-        options.counters['logical lines'] = \
-            options.counters.get('logical lines', 0) + 1
-        self.build_tokens_line()
-        first_line = self.lines[self.mapping[0][1][2][0] - 1]
-        indent = first_line[:self.mapping[0][1][2][1]]
-        self.previous_indent_level = self.indent_level
-        self.indent_level = expand_indent(indent)
-        if options.verbose >= 2:
-            print self.logical_line[:80].rstrip()
-        for name, check, argument_names in self.logical_checks:
-            if options.verbose >= 3:
-                print '   ', name
-            result = self.run_check(check, argument_names)
-            if result is not None:
-                offset, text = result
-                if type(offset) is tuple:
-                    original_number, original_offset = offset
-                else:
-                    for token_offset, token in self.mapping:
-                        if offset >= token_offset:
-                            original_number = token[2][0]
-                            original_offset = (token[2][1]
-                                               + offset - token_offset)
-                self.report_error(original_number, original_offset,
-                                  text, check)
-        self.previous_logical = self.logical_line
-
-    def check_all(self):
-        """
-        Run all checks on the input file.
-        """
-        self.file_errors = 0
-        self.line_number = 0
-        self.indent_char = None
-        self.indent_level = 0
-        self.previous_logical = ''
-        self.blank_lines = 0
-        self.tokens = []
-        parens = 0
-        for token in tokenize.generate_tokens(self.readline_check_physical):
-            # print tokenize.tok_name[token[0]], repr(token)
-            self.tokens.append(token)
-            token_type, text = token[0:2]
-            if token_type == tokenize.OP and text in '([{':
-                parens += 1
-            if token_type == tokenize.OP and text in '}])':
-                parens -= 1
-            if token_type == tokenize.NEWLINE and not parens:
-                self.check_logical()
-                self.blank_lines = 0
-                self.tokens = []
-            if token_type == tokenize.NL and not parens:
-                self.blank_lines += 1
-                self.tokens = []
-            if token_type == tokenize.COMMENT:
-                self.blank_lines = 0
-        return self.file_errors
-
-    def report_error(self, line_number, offset, text, check):
-        """
-        Report an error, according to options.
-        """
-        if options.quiet == 1 and not self.file_errors:
-            message(self.filename)
-        code = text[:4]
-        if ignore_code(code):
-            return
-        self.file_errors += 1
-        options.counters[code] = options.counters.get(code, 0) + 1
-        options.messages[code] = text[5:]
-        if options.quiet:
-            return
-        if options.testsuite:
-            base = os.path.basename(self.filename)[:4]
-            if base == code:
-                return
-            if base[0] == 'E' and code[0] == 'W':
-                return
-        if options.counters[code] == 1 or options.repeat:
-            message("%s:%s:%d: %s" %
-                    (self.filename, line_number, offset + 1, text))
-            if options.show_source:
-                line = self.lines[line_number - 1]
-                message(line.rstrip())
-                message(' ' * offset + '^')
-            if options.show_pep8:
-                message(check.__doc__.lstrip('\n').rstrip())
-
-
-def input_file(filename):
-    """
-    Run all checks on a Python source file.
-    """
-    if excluded(filename) or not filename_match(filename):
-        return {}
-    if options.verbose:
-        message('checking ' + filename)
-    options.counters['files'] = options.counters.get('files', 0) + 1
-    errors = Checker(filename).check_all()
-    if options.testsuite and not errors:
-        message("%s: %s" % (filename, "no errors found"))
-
-
-def input_dir(dirname):
-    """
-    Check all Python source files in this directory and all subdirectories.
-    """
-    dirname = dirname.rstrip('/')
-    if excluded(dirname):
-        return
-    for root, dirs, files in os.walk(dirname):
-        if options.verbose:
-            message('directory ' + root)
-        options.counters['directories'] = \
-            options.counters.get('directories', 0) + 1
-        dirs.sort()
-        for subdir in dirs:
-            if excluded(subdir):
-                dirs.remove(subdir)
-        files.sort()
-        for filename in files:
-            input_file(os.path.join(root, filename))
-
-
-def excluded(filename):
-    """
-    Check if options.exclude contains a pattern that matches filename.
-    """
-    basename = os.path.basename(filename)
-    for pattern in options.exclude:
-        if fnmatch(basename, pattern):
-            # print basename, 'excluded because it matches', pattern
-            return True
-
-
-def filename_match(filename):
-    """
-    Check if options.filename contains a pattern that matches filename.
-    If options.filename is unspecified, this always returns True.
-    """
-    if not options.filename:
-        return True
-    for pattern in options.filename:
-        if fnmatch(filename, pattern):
-            return True
-
-
-def ignore_code(code):
-    """
-    Check if options.ignore contains a prefix of the error code.
-    """
-    for ignore in options.ignore:
-        if code.startswith(ignore):
-            return True
-
-
-def get_error_statistics():
-    """Get error statistics."""
-    return get_statistics("E")
-
-
-def get_warning_statistics():
-    """Get warning statistics."""
-    return get_statistics("W")
-
-
-def get_statistics(prefix=''):
-    """
-    Get statistics for message codes that start with the prefix.
-
-    prefix='' matches all errors and warnings
-    prefix='E' matches all errors
-    prefix='W' matches all warnings
-    prefix='E4' matches all errors that have to do with imports
-    """
-    stats = []
-    keys = options.messages.keys()
-    keys.sort()
-    for key in keys:
-        if key.startswith(prefix):
-            stats.append('%-7s %s %s' %
-                         (options.counters[key], key, options.messages[key]))
-    return stats
-
-
-def print_statistics(prefix=''):
-    """Print overall statistics (number of errors and warnings)."""
-    for line in get_statistics(prefix):
-        print line
-
-
-def print_benchmark(elapsed):
-    """
-    Print benchmark numbers.
-    """
-    print '%-7.2f %s' % (elapsed, 'seconds elapsed')
-    keys = ['directories', 'files',
-            'logical lines', 'physical lines']
-    for key in keys:
-        if key in options.counters:
-            print '%-7d %s per second (%d total)' % (
-                options.counters[key] / elapsed, key,
-                options.counters[key])
-
-
-def process_options(arglist=None):
-    """
-    Process options passed either via arglist or via command line args.
-    """
-    global options, args
-    usage = "%prog [options] input ..."
-    parser = OptionParser(usage)
-    parser.add_option('-v', '--verbose', default=0, action='count',
-                      help="print status messages, or debug with -vv")
-    parser.add_option('-q', '--quiet', default=0, action='count',
-                      help="report only file names, or nothing with -qq")
-    parser.add_option('--exclude', metavar='patterns', default=default_exclude,
-                      help="skip matches (default %s)" % default_exclude)
-    parser.add_option('--filename', metavar='patterns',
-                      help="only check matching files (e.g. *.py)")
-    parser.add_option('--ignore', metavar='errors', default='',
-                      help="skip errors and warnings (e.g. E4,W)")
-    parser.add_option('--repeat', action='store_true',
-                      help="show all occurrences of the same error")
-    parser.add_option('--show-source', action='store_true',
-                      help="show source code for each error")
-    parser.add_option('--show-pep8', action='store_true',
-                      help="show text of PEP 8 for each error")
-    parser.add_option('--statistics', action='store_true',
-                      help="count errors and warnings")
-    parser.add_option('--benchmark', action='store_true',
-                      help="measure processing speed")
-    parser.add_option('--testsuite', metavar='dir',
-                      help="run regression tests from dir")
-    parser.add_option('--doctest', action='store_true',
-                      help="run doctest on myself")
-    options, args = parser.parse_args(arglist)
-    if options.testsuite:
-        args.append(options.testsuite)
-    if len(args) == 0:
-        parser.error('input not specified')
-    options.prog = os.path.basename(sys.argv[0])
-    options.exclude = options.exclude.split(',')
-    for index in range(len(options.exclude)):
-        options.exclude[index] = options.exclude[index].rstrip('/')
-    if options.filename:
-        options.filename = options.filename.split(',')
-    if options.ignore:
-        options.ignore = options.ignore.split(',')
-    else:
-        options.ignore = []
-    options.counters = {}
-    options.messages = {}
-
-    return options, args
-
-
-def _main():
-    """
-    Parse options and run checks on Python source.
-    """
-    options, args = process_options()
-    if options.doctest:
-        import doctest
-        return doctest.testmod()
-    start_time = time.time()
-    for path in args:
-        if os.path.isdir(path):
-            input_dir(path)
-        else:
-            input_file(path)
-    elapsed = time.time() - start_time
-    if options.statistics:
-        print_statistics()
-    if options.benchmark:
-        print_benchmark(elapsed)
-
-
-if __name__ == '__main__':
-    _main()
-
--- a/MoinMoin/_tests/test_sourcecode.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/_tests/test_sourcecode.py	Thu Jun 21 03:33:59 2012 +0400
@@ -11,7 +11,7 @@
 
 import re, time
 import pytest
-from . import pep8
+import pep8
 
 import py
 
@@ -20,8 +20,21 @@
 EXCLUDE = set([
     moindir/'static', # this is our dist static stuff
     moindir/'_tests/wiki', # this is our test wiki
+    moindir/'util/md5crypt.py', # 3rd party, do not fix pep8 there
 ])
 
+PEP8IGNORE = (
+    "E121 E122 E123 E124 E125 E126 E127 E128 "  # continuation line indentation
+    "E225 "  # missing whitespace around operator
+    "E241 "  # whitespace around comma (we have some "tabular" formatting in the tests)
+    "E261 "  # less than 2 blanks before inline comment
+    "E301 E302 "  # separate toplevel definitions with 2 empty lines, method defs inside class by 1 empty line
+    "E401 "  # imports on separate lines
+    "E501 "  # maximum line length (default 79 chars)
+    "E502 "  # bug in pep8.py: https://github.com/jcrocholl/pep8/issues/75
+    "W391 "  # trailing blank line(s) at EOF. But: We want one of them so that diff does not complain!
+).split()
+
 TRAILING_SPACES = 'nochange' # 'nochange' or 'fix'
                              # use 'fix' with extreme caution and in a separate changeset!
 FIX_TS_RE = re.compile(r' +$', re.M) # 'fix' mode: everything matching the trailing space re will be removed
@@ -68,7 +81,7 @@
 
 def pep8_error_count(path):
     # process_options initializes some data structures and MUST be called before each Checker().check_all()
-    pep8.process_options(['pep8', '--ignore=E202,E221,E222,E241,E301,E302,E401,E501,E701,W391,W601,W602', '--show-source', 'dummy_path'])
+    pep8.process_options(['pep8', '--ignore=%s' % ','.join(PEP8IGNORE), '--show-source', 'dummy_path'])
     error_count = pep8.Checker(path).check_all()
     return error_count
 
@@ -95,8 +108,9 @@
 
 def pytest_generate_tests(metafunc):
     for pyfile in sorted(moindir.visit('*.py', lambda p: p not in EXCLUDE)):
-        relpath = moindir.bestrelpath(pyfile)
-        metafunc.addcall(id=relpath, funcargs={'path': pyfile})
+        if pyfile not in EXCLUDE:
+            relpath = moindir.bestrelpath(pyfile)
+            metafunc.addcall(id=relpath, funcargs={'path': pyfile})
 
 def test_sourcecode(path):
     mtime = path.stat().mtime
--- a/MoinMoin/apps/admin/_tests/test_admin.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/apps/admin/_tests/test_admin.py	Thu Jun 21 03:33:59 2012 +0400
@@ -13,7 +13,8 @@
             rv = c.get(url)
             assert rv.status == status
             assert rv.headers['Content-Type'] == 'text/html; charset=utf-8'
-            for item in data: assert item in rv.data
+            for item in data:
+                assert item in rv.data
 
     def test_index(self):
         self._test_view_get(url_for('admin.index'))
--- a/MoinMoin/apps/frontend/views.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/apps/frontend/views.py	Thu Jun 21 03:33:59 2012 +0400
@@ -1450,9 +1450,9 @@
 
             # save response to a dict as we can't use HTTP redirects or flash() for XHR requests
             response = dict(
-                form = None,
-                flash = [],
-                redirect = None,
+                form=None,
+                flash=[],
+                redirect=None,
             )
 
             if form.validate():
--- a/MoinMoin/auth/_tests/test_auth.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/auth/_tests/test_auth.py	Thu Jun 21 03:33:59 2012 +0400
@@ -57,7 +57,7 @@
 def test_handle_login():
     # no messages in the beginning
     assert not flaskg._login_messages
-    test_user1 = handle_login(flaskg.user, login_username = 'test_user', login_password = 'test_password', stage = 'moin')
+    test_user1 = handle_login(flaskg.user, login_username='test_user', login_password='test_password', stage='moin')
     test_login_message = [u'Invalid username or password.']
     assert flaskg._login_messages == test_login_message
     assert test_user1.name == u'anonymous'
@@ -70,7 +70,7 @@
     givenauth_obj.user_name = u'Test_User'
     create_user(u'Test_User', u'test_pass', u'test@moinmoin.org')
     test_user, bool_value = givenauth_obj.request(flaskg.user)
-    test_user2 = handle_login(test_user, login_username = 'Test_User', login_password = 'test_pass', stage = 'moin')
+    test_user2 = handle_login(test_user, login_username='Test_User', login_password='test_pass', stage='moin')
     assert not flaskg._login_messages
     assert test_user2.name == u'Test_User'
     assert test_user2.valid
--- a/MoinMoin/auth/_tests/test_ldap_login.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/auth/_tests/test_ldap_login.py	Thu Jun 21 03:33:59 2012 +0400
@@ -179,7 +179,6 @@
     slapd_config = SLAPD_CONFIG
     ldif_content = LDIF_CONTENT
 
-
     def setup_class(self):
         """ Create LDAP servers environment, start slapds """
         self.ldap_envs = []
--- a/MoinMoin/auth/ldap_login.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/auth/ldap_login.py	Thu Jun 21 03:33:59 2012 +0400
@@ -124,7 +124,6 @@
         username = kw.get('username')
         password = kw.get('password')
 
-
         # we require non-empty password as ldap bind does a anon (not password
         # protected) bind if the password is empty and SUCCEEDS!
         if not password:
--- a/MoinMoin/auth/openidrp.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/auth/openidrp.py	Thu Jun 21 03:33:59 2012 +0400
@@ -101,7 +101,6 @@
                                                            openid_submit='1'
                                                           ))
 
-
             # not trusted
             return ContinueLogin(None, _('This OpenID provider is not trusted.'))
 
--- a/MoinMoin/config/default.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/config/default.py	Thu Jun 21 03:33:59 2012 +0400
@@ -113,11 +113,11 @@
         self.mail_enabled = self.mail_enabled and True or False
 
         if self.namespace_mapping is None:
-            raise error.ConfigurationError("No storage configuration specified! You need to define a namespace_mapping. " + \
+            raise error.ConfigurationError("No storage configuration specified! You need to define a namespace_mapping. "
                                            "For further reference, please see HelpOnStorageConfiguration.")
 
         if self.acl_mapping is None:
-            raise error.ConfigurationError("No acl configuration specified! You need to define a acl_mapping. " + \
+            raise error.ConfigurationError("No acl configuration specified! You need to define a acl_mapping. "
                                            "For further reference, please see HelpOnStorageConfiguration.")
 
         if self.secrets is None:  # admin did not setup a real secret
@@ -411,10 +411,10 @@
     ('interwiki_map', {},
      "Dictionary of wiki_name -> wiki_url"),
     ('namespace_mapping', None,
-    "This needs to point to a list of tuples, each tuple containing: Namespace identifier, backend. " + \
+    "This needs to point to a list of tuples, each tuple containing: Namespace identifier, backend. " +
     "E.g.: [('/', FSBackend('wiki/data')), ]. 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. " + \
+    "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."),
@@ -535,7 +535,7 @@
     )),
 
     'ns': ('Storage Namespaces',
-    "Storage namespaces can be defined for all sorts of data. All items sharing a common namespace as prefix" + \
+    "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.
--- a/MoinMoin/conftest.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/conftest.py	Thu Jun 21 03:33:59 2012 +0400
@@ -49,10 +49,10 @@
     more_config = dict(
         namespace_mapping=namespace_mapping,
         acl_mapping=acl_mapping,
-        create_storage = True, # create a fresh storage at each app start
-        destroy_storage = True, # kill all storage contents at app shutdown
-        create_index = True, # create a fresh index at each app start
-        destroy_index = True, # kill index contents at app shutdown
+        create_storage=True, # create a fresh storage at each app start
+        destroy_storage=True, # kill all storage contents at app shutdown
+        create_index=True, # create a fresh index at each app start
+        destroy_index=True, # kill index contents at app shutdown
     )
     app = create_app_ext(flask_config_dict=dict(SECRET_KEY='foobarfoobar'),
                          moin_config_class=given_config,
@@ -101,7 +101,6 @@
         if hasattr(self._obj, 'im_self'):
             self._obj.im_self.app = self.app
 
-
     def teardown(self):
         super(MoinTestFunction, self).teardown()
 
@@ -111,7 +110,7 @@
 
 def pytest_pycollect_makeitem(__multicall__, collector, name, obj):
     if collector.funcnamefilter(name) and inspect.isfunction(obj):
-        return MoinTestFunction(name, parent = collector)
+        return MoinTestFunction(name, parent=collector)
 
 def pytest_pyfunc_call(pyfuncitem):
     """hook to intercept generators and run them as a single test items"""
--- a/MoinMoin/converter/_tests/test_html_in.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/converter/_tests/test_html_in.py	Thu Jun 21 03:33:59 2012 +0400
@@ -43,7 +43,6 @@
         out.write(f.write, namespaces=self.namespaces, )
         return self.output_re.sub(u'', f.getvalue())
 
-
     def do(self, input, path):
         string_to_parse = self.handle_input(input, args={})
         logging.debug("After the HTML_IN conversion : {0}".format(string_to_parse))
--- a/MoinMoin/converter/_tests/test_moinwiki_in_out.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/converter/_tests/test_moinwiki_in_out.py	Thu Jun 21 03:33:59 2012 +0400
@@ -22,7 +22,7 @@
 
 class TestConverter(object):
 
-    input_namespaces =  'xmlns="{0}" xmlns:page="{1}" xmlns:xlink="{2}"'.format(moin_page.namespace, moin_page.namespace, xlink.namespace)
+    input_namespaces = 'xmlns="{0}" xmlns:page="{1}" xmlns:xlink="{2}"'.format(moin_page.namespace, moin_page.namespace, xlink.namespace)
 
     namespaces = {
         moin_page.namespace: 'page',
--- a/MoinMoin/converter/_tests/test_rst_in.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/converter/_tests/test_rst_in.py	Thu Jun 21 03:33:59 2012 +0400
@@ -34,9 +34,9 @@
                 '<page><body><p>Text</p><p>Test</p></body></page>'),
             (u'H\\ :sub:`2`\\ O\n\nE = mc\\ :sup:`2`', '<page><body><p>H<span baseline-shift="sub">2</span>O</p><p>E = mc<span baseline-shift="super">2</span></p></body></page>'),
             (u'| Lend us a couple of bob till Thursday.', '<page><body>Lend us a couple of bob till Thursday.</body></page>'),
-            (u'**Text**', '<page><body><p><strong>Text</strong></p></body></page>' ),
-            (u'*Text*', '<page><body><p><emphasis>Text</emphasis></p></body></page>' ),
-            (u'``Text``', '<page><body><p><code>Text</code></p></body></page>' ),
+            (u'**Text**', '<page><body><p><strong>Text</strong></p></body></page>'),
+            (u'*Text*', '<page><body><p><emphasis>Text</emphasis></p></body></page>'),
+            (u'``Text``', '<page><body><p><code>Text</code></p></body></page>'),
             (u"`Text <javascript:alert('xss')>`_", u'<page><body><p>Text</p></body></page>'),
         ]
         for i in data:
--- a/MoinMoin/converter/docbook_in.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/converter/docbook_in.py	Thu Jun 21 03:33:59 2012 +0400
@@ -43,7 +43,7 @@
 
     # DocBook elements which are completely ignored by our converter
     # We even do not process children of these elements
-    ignored_tags = set([#Info elements
+    ignored_tags = set([# Info elements
                        'abstract', 'artpagenums', 'annotation',
                        'artpagenums', 'author', 'authorgroup',
                        'authorinitials', 'bibliocoverage', 'biblioid',
--- a/MoinMoin/converter/docbook_out.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/converter/docbook_out.py	Thu Jun 21 03:33:59 2012 +0400
@@ -256,7 +256,7 @@
 
         # We will close a section before starting a new one
         # Need more test
-        elif  depth < self.current_section:
+        elif depth < self.current_section:
             if self.parent_section != 0:
                 section_tag = 'sect{0}'.format(self.parent_section)
                 section = ET.Element(docbook(section_tag), attrib={},
@@ -356,7 +356,7 @@
         mimetype = Type(_type=element.get(moin_page.type_, 'application/x-nonexistent'))
         if href:
             attrib[docbook.fileref] = href
-            if  Type('image/').issupertype(mimetype):
+            if Type('image/').issupertype(mimetype):
                 object_data = self.new(docbook.imagedata, attrib=attrib,
                                        children=[])
                 object_element = self.new(docbook.imageobject, attrib={},
@@ -378,7 +378,6 @@
         return self.new(docbook.inlinemediaobject, attrib={},
                         children=[object_element])
 
-
     def visit_moinpage_table(self, element):
         # TODO: Attributes conversion
         title = element.get(html('title'))
--- a/MoinMoin/converter/html_out.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/converter/html_out.py	Thu Jun 21 03:33:59 2012 +0400
@@ -221,7 +221,7 @@
         return pre
 
     def visit_moinpage_blockquote(self, elem):
-        return  self.new_copy(html.blockquote, elem)
+        return self.new_copy(html.blockquote, elem)
 
     def visit_moinpage_code(self, elem):
         return self.new_copy(html.code, elem)
--- a/MoinMoin/converter/include.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/converter/include.py	Thu Jun 21 03:33:59 2012 +0400
@@ -271,7 +271,6 @@
                 #  end of processing for transclusion; the "result" will get inserted into the DOM below
                 return result
 
-
             # Traverse the DOM by calling self.recurse with each child of the current elem.  Starting elem.tag.name=='page'.
             container = []
             i = 0
--- a/MoinMoin/converter/mediawiki_in.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/converter/mediawiki_in.py	Thu Jun 21 03:33:59 2012 +0400
@@ -142,7 +142,6 @@
         stack.clear()
         stack.top_append(moin_page.separator())
 
-
     block_table = r"""
         ^
         (?P<table>
@@ -852,7 +851,7 @@
             self.nowiki_tag = ''
             self._stack = []
 
-        def push(self, status = []):
+        def push(self, status=[]):
             self._stack.append(self.opened_tags)
             self.opened_tags = status
             if self.opened_tags:
@@ -877,7 +876,7 @@
                     self.nowiki_tag = ''
             return self.opened_tags
 
-        def __call__(self, line, tags = []):
+        def __call__(self, line, tags=[]):
             tags = tags or self.opened_tags
             match = re.match(r"(.*?)(\<.*\>.*)|(.*)", line)
             if match:
@@ -897,11 +896,14 @@
                         tag = match.group(1)
                         next_text = match.group(3)
                         text = match.group(2) or match.group(4)
-                        if not text: text = ''
+                        if not text:
+                            text = ''
                         tag_match = re.match(r"/\s*(.*)", tag)
                         status = not tag_match
-                        if tag_match: tag_name = tag_match.group(1).split(' ')[0]
-                        else: tag_name = tag.split(' ')[0]
+                        if tag_match:
+                            tag_name = tag_match.group(1).split(' ')[0]
+                        else:
+                            tag_name = tag.split(' ')[0]
                         if not tag_name in self.all_tags or re.match(r'.*/\s*$', tag)\
                                 or self.nowiki and (status or tag_name != self.nowiki_tag):
                             if not len(tags):
@@ -948,7 +950,6 @@
                 return ''.join(post_line)
             self.opened_tags = tags
 
-
     def _apply(self, match, prefix, *args):
         """
         Call the _repl method for the last matched group with the given prefix.
--- a/MoinMoin/converter/moinwiki_in.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/converter/moinwiki_in.py	Thu Jun 21 03:33:59 2012 +0400
@@ -178,7 +178,6 @@
     def number_rows_spanned_repl(self, args, number_rows_spanned):
         args.keyword['number-rows-spanned'] = int(number_rows_spanned)
 
-
     def add_attr_to_style(self, args, attr):
         args.keyword['style'] = args.keyword.get('style', "") + attr + " "
 
@@ -382,12 +381,12 @@
 
     block_separator = r'(?P<separator> ^ \s* -{4,} \s* $ )'
 
-    def block_separator_repl(self, _iter_content, stack, separator, hr_class = u'moin-hr{0}'):
+    def block_separator_repl(self, _iter_content, stack, separator, hr_class=u'moin-hr{0}'):
         stack.clear()
         hr_height = min((len(separator) - 3), 6)
         hr_height = max(hr_height, 1)
         attrib = {moin_page('class'): hr_class.format(hr_height)}
-        elem = moin_page.separator(attrib = attrib)
+        elem = moin_page.separator(attrib=attrib)
         stack.top_append(elem)
 
     block_table = r"""
--- a/MoinMoin/converter/moinwiki_out.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/converter/moinwiki_out.py	Thu Jun 21 03:33:59 2012 +0400
@@ -422,10 +422,10 @@
         if text_decoration == u'underline':
             return Moinwiki.underline + self.open_children(elem) + Moinwiki.underline
         if font_size:
-            return u"{0}{1}{2}".format(Moinwiki.larger_open if font_size == u"120%"\
+            return u"{0}{1}{2}".format(Moinwiki.larger_open if font_size == u"120%"
                                            else Moinwiki.smaller_open,
                                        self.open_children(elem),
-                                       Moinwiki.larger_close if font_size == u"120%"\
+                                       Moinwiki.larger_close if font_size == u"120%"
                                            else Moinwiki.smaller_close)
         if baseline_shift == u'super':
             return u'^{0}^'.format(u''.join(elem.itertext()))
--- a/MoinMoin/converter/pygments_in.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/converter/pygments_in.py	Thu Jun 21 03:33:59 2012 +0400
@@ -52,7 +52,6 @@
             if lastval:
                 self._append(lasttype, lastval, element)
 
-
     class Converter(object):
         @classmethod
         def _factory(cls, type_input, type_output, **kw):
@@ -114,7 +113,6 @@
             body = moin_page.body(children=(blockcode, ))
             return moin_page.page(children=(body, ))
 
-
     from . import default_registry
     from MoinMoin.util.mime import Type, type_moin_document
     # Pygments type detection is rather expensive, therefore we want to register
--- a/MoinMoin/converter/rst_in.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/converter/rst_in.py	Thu Jun 21 03:33:59 2012 +0400
@@ -443,7 +443,7 @@
             self.open_moin_page_node(
                 moin_page.part(
                     attrib={
-                        moin_page.content_type:\
+                        moin_page.content_type:
                             "x-moin/macro;name={0}".format(macro_name)}))
             if arguments:
                 self.open_moin_page_node(moin_page.arguments())
--- a/MoinMoin/converter/rst_out.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/converter/rst_out.py	Thu Jun 21 03:33:59 2012 +0400
@@ -336,9 +336,9 @@
                     child =\
                         re.sub(r"\n(.)", lambda m: u"\n{0}{1}".format(u' '*(len(u''.join(self.list_item_labels)) + len(self.list_item_labels)), m.group(1)), child)
                     if self.last_closed == "p":
-                        childrens_output.append(u'\n'\
-                                + u' '\
-                                * (len(''.join(self.list_item_labels))\
+                        childrens_output.append(u'\n'
+                                + u' '
+                                * (len(''.join(self.list_item_labels))
                                    + len(self.list_item_labels)))
                 elif self.status[-1] == "text":
                     if self.last_closed == "p":
@@ -393,8 +393,8 @@
     def open_moinpage_blockcode(self, elem):
         text = u''.join(elem.itertext())
         max_subpage_lvl = 3
-        text = text.replace(u'\n', u'\n  '\
-                                  + u' ' * (len(u''.join(self.list_item_labels))\
+        text = text.replace(u'\n', u'\n  '
+                                  + u' ' * (len(u''.join(self.list_item_labels))
                                          + len(self.list_item_labels)))
 
         if self.list_level >= 0:
@@ -434,10 +434,10 @@
 
     def open_moinpage_line_break(self, elem):
         if self.status[-1] == "list":
-            return ReST.linebreak\
-                   + u' '\
-                     * (len(u''.join(self.list_item_labels))\
-                        + len(self.list_item_labels))
+            return (ReST.linebreak
+                    + u' '
+                      * (len(u''.join(self.list_item_labels))
+                         + len(self.list_item_labels)))
         if self.last_closed == 'p':
             return u'\n\n'
         return ReST.linebreak
@@ -472,9 +472,9 @@
         if self.list_item_labels[-1] == u'' or self.list_item_labels[-1] == u' ':
             self.list_item_labels[-1] = u' '
             self.list_item_label = self.list_item_labels[-1] + u' '
-            ret = u' '\
-                  * (len(u''.join(self.list_item_labels[:-1]))\
-                     + len(self.list_item_labels[:-1]))
+            ret = (u' '
+                   * (len(u''.join(self.list_item_labels[:-1]))
+                      + len(self.list_item_labels[:-1])))
             if self.last_closed and self.last_closed != 'list':
                 ret = u'\n{0}'.format(ret)
             return ret + self.open_children(elem)
@@ -484,15 +484,15 @@
         ret = u''
         if self.last_closed:
             ret = u'\n'
-        ret += u' ' * (len(u''.join(self.list_item_labels[:-1]))\
-                      + len(self.list_item_labels[:-1]))\
-               + self.list_item_label
+        ret += (u' ' * (len(u''.join(self.list_item_labels[:-1]))
+                       + len(self.list_item_labels[:-1]))
+                + self.list_item_label)
         if self.list_item_labels[-1] in [u'1.', u'i.', u'I.', u'a.', u'A.']:
             self.list_item_labels[-1] = u'#.'
 
         ret = self.define_references() + ret + self.open_children(elem)
         if self.last_closed == "text":
-            return  ret + u'\n'
+            return ret + u'\n'
         return ret
 
     def open_moinpage_note(self, elem):
@@ -557,17 +557,17 @@
                                 and self.last_closed != 'list_item_header'\
                                 and self.last_closed != 'list_item_footer'\
                                 and self.last_closed != 'p':
-                ret = ReST.linebreak + u' '\
-                                        * (len(u''.join(self.list_item_labels))\
-                                           + len(self.list_item_labels)) + self.open_children(elem)
+                ret = (ReST.linebreak + u' '
+                                        * (len(u''.join(self.list_item_labels))
+                                           + len(self.list_item_labels)) + self.open_children(elem))
             elif self.last_closed and self.last_closed == 'p':
                 #return ReST.p +\
-                ret = u"\n" + u' ' * (len(u''.join(self.list_item_labels))\
-                                   + len(self.list_item_labels)) + self.open_children(elem)
+                ret = (u"\n" + u' ' * (len(u''.join(self.list_item_labels))
+                                    + len(self.list_item_labels)) + self.open_children(elem))
             else:
                 ret = self.open_children(elem)
             if not self.delete_newlines:
-                ret +=  u"\n"
+                ret += u"\n"
         else:
             self.status.append('p')
             ret = self.open_children(elem)
@@ -750,11 +750,11 @@
         """
         ret = u''
         self.all_used_references.extend(self.used_references)
-        definitions = [u" " * (len(u''.join(self.list_item_labels))\
-                                    + len(self.list_item_labels))\
+        definitions = [u" " * (len(u''.join(self.list_item_labels))
+                                    + len(self.list_item_labels))
                                   + u".. _{0}: {1}".format(t, h) for t, h in self.used_references]
-        definitions.extend(u" " * (len(u''.join(self.list_item_labels))\
-                                     + len(self.list_item_labels))\
+        definitions.extend(u" " * (len(u''.join(self.list_item_labels))
+                                     + len(self.list_item_labels))
                                   + link for link in self.objects)
         definition_block = u"\n\n".join(definitions)
 
--- a/MoinMoin/datastruct/backends/_tests/__init__.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/datastruct/backends/_tests/__init__.py	Thu Jun 21 03:33:59 2012 +0400
@@ -29,7 +29,6 @@
                    u'EmptyGroup': [],
                    u'CheckNotExistingGroup': [u'NotExistingGroup']}
 
-
     expanded_groups = {u'EditorGroup': [u'Admin1', u'Admin2', u'John',
                                         u'JoeDoe', u'Editor1'],
                        u'AdminGroup': [u'Admin1', u'Admin2', u'John'],
@@ -178,7 +177,6 @@
         assert dicts.get(u'SomeNotExistingDict') is None
         assert dicts.get(u'SomeNotExistingDict', {}) == {}
 
-
         for dict_name, expected_dict in self.dicts.items():
             test_dict = dicts[dict_name]
             for key, value in expected_dict.items():
--- a/MoinMoin/datastruct/backends/_tests/test_config_dicts.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/datastruct/backends/_tests/test_config_dicts.py	Thu Jun 21 03:33:59 2012 +0400
@@ -6,7 +6,7 @@
 """
 
 
-from  MoinMoin.datastruct.backends._tests import DictsBackendTest
+from MoinMoin.datastruct.backends._tests import DictsBackendTest
 from MoinMoin.datastruct import ConfigDicts
 from MoinMoin._tests import wikiconfig
 
--- a/MoinMoin/items/__init__.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/items/__init__.py	Thu Jun 21 03:33:59 2012 +0400
@@ -111,7 +111,7 @@
             return NotImplemented
 
         def __repr__(self):
-            return '<{0}: {1}, prio {2} [{3!r}]>' % (self.__class__.__name__,
+            return '<{0}: {1}, prio {2} [{3!r}]>'.format(self.__class__.__name__,
                     self.content_type,
                     self.priority,
                     self.factory)
--- a/MoinMoin/macro/_tests/test_DateTime.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/macro/_tests/test_DateTime.py	Thu Jun 21 03:33:59 2012 +0400
@@ -23,7 +23,7 @@
     assert test_time == result
 
     arguments = ['2011-08-07T11:11:11', 'argument2']
-    result  = macro_obj.macro('content', arguments, 'page_url', 'alternative')
+    result = macro_obj.macro('content', arguments, 'page_url', 'alternative')
     expected = u'Aug 7, 2011 11:11:11 AM'
     assert result == expected
 
--- a/MoinMoin/macro/_tests/test__base.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/macro/_tests/test__base.py	Thu Jun 21 03:33:59 2012 +0400
@@ -13,12 +13,11 @@
 
     def test_MacroBase(self):
         """ test for MacroBase class """
-        macrobase_obj  = MacroBase()
+        macrobase_obj = MacroBase()
         assert not macrobase_obj.immutable
         with pytest.raises(NotImplementedError):
             macrobase_obj.__call__('content', 'arguments', 'page_url', 'alternative', 'context_block')
 
-
     def test_MacroBlockBase(self):
         """ test for MacroBlockBase class """
         class Test_MacroBlockBase(MacroBlockBase):
@@ -27,7 +26,7 @@
                 self.alt = 'alt returned'
 
         macroblockbase_obj = Test_MacroBlockBase()
-        result = macroblockbase_obj.__call__('content', 'arguments', 'page_url', 'alternative', context_block = False)
+        result = macroblockbase_obj.__call__('content', 'arguments', 'page_url', 'alternative', context_block=False)
         assert result == 'alt returned'
         with pytest.raises(NotImplementedError):
             result = macroblockbase_obj.__call__('content', 'arguments', 'page_url', 'alternative', 'context_block')
@@ -40,7 +39,7 @@
                 return 'test_macro'
 
         macroinlinebase_obj = Test_MacroInlineBase()
-        result = macroinlinebase_obj.__call__('content', 'arguments', 'page_url', 'alternative', context_block = False)
+        result = macroinlinebase_obj.__call__('content', 'arguments', 'page_url', 'alternative', context_block=False)
         assert result == 'test_macro'
         result = macroinlinebase_obj.__call__('content', 'arguments', 'page_url', 'alternative', 'context_block')
         assert result.text == 'test_macro'
@@ -55,6 +54,6 @@
                 return 'test_macro'
 
         macroinlineonlybase_obj = Test_MacroInlineOnlyBase()
-        result = macroinlineonlybase_obj.__call__('content', 'arguments', 'page_url', 'alternative', context_block = False)
+        result = macroinlineonlybase_obj.__call__('content', 'arguments', 'page_url', 'alternative', context_block=False)
         assert result == 'test_macro'
 
--- a/MoinMoin/script/maint/moinshell.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/script/maint/moinshell.py	Thu Jun 21 03:33:59 2012 +0400
@@ -30,7 +30,6 @@
 
     def __init__(self, banner=None, make_context=None, use_ipython=True):
 
-
         self.banner = banner or self.banner
         self.use_ipython = use_ipython
 
--- a/MoinMoin/script/migration/moin19/import19.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/script/migration/moin19/import19.py	Thu Jun 21 03:33:59 2012 +0400
@@ -411,7 +411,7 @@
             self.to_end()
             raise KeyError
         del meta['__rev']
-        del meta[EXTRA] #  we have full name in NAME
+        del meta[EXTRA] # we have full name in NAME
         meta[ACTION] = u'SAVE'
         meta = dict([(k, v) for k, v in meta.items() if v]) # remove keys with empty values
         return meta
--- a/MoinMoin/search/_tests/test_analyzers.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/search/_tests/test_analyzers.py	Thu Jun 21 03:33:59 2012 +0400
@@ -116,7 +116,6 @@
 class TestMimeTokenizer(TokenizerTestBase):
     """ analyzers: test content type analyzer """
 
-
     test_cases_query = [
                   # (query, tokens)
                   (u'text/plain',
--- a/MoinMoin/security/_tests/test_security.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/security/_tests/test_security.py	Thu Jun 21 03:33:59 2012 +0400
@@ -187,7 +187,7 @@
         """ security: allow extra white space between entries """
         acl_iter = acliter('UserOne,user two:read,write   user three,UserFour:read  All:')
         mod, entries, rights = acl_iter.next()
-        assert  entries == ['UserOne', 'user two']
+        assert entries == ['UserOne', 'user two']
         assert rights == ['read', 'write']
         mod, entries, rights = acl_iter.next()
         assert entries == ['user three', 'UserFour']
--- a/MoinMoin/security/_tests/test_textcha.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/security/_tests/test_textcha.py	Thu Jun 21 03:33:59 2012 +0400
@@ -40,8 +40,8 @@
 
         # test for textcha
         test_textchas = textcha_obj.textchas
-        expected_textchas  = {'Good Question': 'Good Answer',
-                                'What is the question?': 'Test_Answer'}
+        expected_textchas = {'Good Question': 'Good Answer',
+                             'What is the question?': 'Test_Answer'}
         assert test_textchas == expected_textchas
         # test for the question
         test_question = textcha_obj.question
--- a/MoinMoin/static/js/countdown.js	Thu Jun 21 02:56:28 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-var state = 0; // 0: start; 1: long count; 2: short count; 3: timeout; 4/5: blink
-var counter = 0, step = 1, delay = 1;
-
-function countdown() {
-    // change state if counter is down
-    if (counter <= 1) {
-        state += 1
-        if (state == 1) {
-            counter = countdown_timeout_min
-            step = 1
-            delay = 60000
-        }
-        if (state == 2) {
-            counter = 60
-            step = 5
-            delay = step * 1000
-        }
-        if (state == 3 || state == 5) {
-            window.status = countdown_lock_expire
-            state = 3
-            counter = 1
-            step = 1
-            delay = 500
-        }
-        if (state == 4) {
-            // blink the above text
-            window.status = " "
-            counter = 1
-            delay = 250
-        }
-    }
-
-    // display changes
-    if (state < 3) {
-        var msg
-        if (state == 1) msg = countdown_lock_mins
-        if (state == 2) msg = countdown_lock_secs
-        window.status = msg.replace(/#/, counter)
-    }
-    counter -= step
-
-    // Set timer for next update
-    setTimeout("countdown()", delay);
-}
-
--- a/MoinMoin/static/js/index_action.js	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/static/js/index_action.js	Thu Jun 21 03:33:59 2012 +0400
@@ -2,34 +2,38 @@
  * Script for the actions performed on the items at index page.
  * Copyright 2011, AkashSinha<akash2607@gmail.com>
  */
+/*jslint browser: true, */
+/*global $:false */
 
 var actionLoading = [];
 actionLoading["delete"] = "Deleting..";
-actionLoading["destroy"] = "Destroying..";
+actionLoading.destroy = "Destroying..";
 
 var actionDone = [];
 actionDone["delete"] = "deleted";
-actionDone["destroy"] = "destroyed";
+actionDone.destroy = "destroyed";
 
 function enablelink(downloadlink) {
-    url=downloadlink.attr("title");
-    downloadlink.attr("href",url);
+    "use strict";
+    var url = downloadlink.attr("title");
+    downloadlink.attr("href", url);
     downloadlink.addClass("active-link");
 }
 
 function disablelink(downloadlink) {
-    downloadlink.attr("href","about:blank");
+    "use strict";
+    downloadlink.attr("href", "about:blank");
     downloadlink.removeClass("active-link");
 }
 
 function showpop(action) {
+    "use strict";
     $(".popup-container").css("display", "none");
-    if(action == "newitem") {
+    if (action === "newitem") {
         $("#popup-for-newitem").css("display", "block");
         $("#file_upload").appendTo("#popup-for-newitem .popup-body");
         $(".upload-form").css("display", "block");
-    }
-    else {
+    } else {
         $("#popup-for-action").css("display", "block");
         $(".popup-comment").removeClass("blank");
         $(".popup-comment").val("");
@@ -40,89 +44,93 @@
 }
 
 function hidepop() {
+    "use strict";
     $("#popup").css("display", "none");
     $("#lightbox").css("display", "none");
 }
 
 function hide(item_link) {
-   item_link.parent().remove();
+    "use strict";
+    item_link.parent().remove();
 }
 
 function show_conflict(item_link) {
-   item_link.removeClass().addClass("moin-conflict");
-   item_link.parent().removeClass();
+    "use strict";
+    item_link.removeClass().addClass("moin-conflict");
+    item_link.parent().removeClass();
 }
 
 function do_action(comment, action) {
-    var links = [];
+    "use strict";
+    var links = [], itemnames, actionTrigger, url;
     $(".selected-item").children("a.moin-item").each(function () {
-        itemname = $(this).attr("title");
+        var itemname = $(this).attr("title");
         links.push(itemname);
     });
-    var itemnames = JSON.stringify(links);
-    var actionTrigger = "moin-" + action + "-trigger";
+    itemnames = JSON.stringify(links);
+    actionTrigger = "moin-" + action + "-trigger";
     url = $("#" + actionTrigger).attr("data-actionurl");
     $("#popup").css("display", "none");
     $(".moin-index-message span").text(actionLoading[action]);
     $(".moin-index-message").css("display", "block");
     $.post(url, {
-            itemnames: itemnames,
-            comment: comment,
-            }, function (data) {
-                var itemnames = data.itemnames;
-                var action_status = data.status;
-                var success_item = 0;
-                var left_item = 0;
-                $.each(itemnames, function (itemindex, itemname) {
-                    if(action_status[itemindex]) {
-                        hide($('.selected-item').children('a.moin-item[title="' + itemname + '"]'));
-                        success_item++;
-                    }
-                    else {
-                        show_conflict($('.selected-item').children('a.moin-item[title="' + itemname + '"]'));
-                        left_item++;
-                   }
-                   });
-                   var message = "Items " + actionDone[action] + ": " + success_item ;
-                   if(left_item)
-                       message += ", Items not " + actionDone[action] + ": " + left_item + ".";
-                   $(".moin-index-message span").text(message);
-                   setTimeout(function () {
-                       $(".moin-index-message").fadeOut();
-                   }, 4000);
-            }, "json");
+        itemnames: itemnames,
+        comment: comment
+    }, function (data) {
+        var itemnames = data.itemnames,
+            action_status = data.status,
+            success_item = 0,
+            left_item = 0,
+            message;
+        $.each(itemnames, function (itemindex, itemname) {
+            if (action_status[itemindex]) {
+                hide($('.selected-item').children('a.moin-item[title="' + itemname + '"]'));
+                success_item += 1;
+            } else {
+                show_conflict($('.selected-item').children('a.moin-item[title="' + itemname + '"]'));
+                left_item += 1;
+            }
+        });
+        message = "Items " + actionDone[action] + ": " + success_item;
+        if (left_item) {
+            message += ", Items not " + actionDone[action] + ": " + left_item + ".";
+        }
+        $(".moin-index-message span").text(message);
+        setTimeout(function () {
+            $(".moin-index-message").fadeOut();
+        }, 4000);
+    }, "json");
 }
 
 $("document").ready(function () {
-
+    "use strict";
     $(".moin-contenttypes-wrapper").children("div").click(function () {
         var wrapper = $(this).parent();
-        if(wrapper.find("ul:visible").length) {
-            $(".moin-contenttypes-wrapper").find("ul").fadeOut(200);
+        if (wrapper.find("form:visible").length) {
+            $(".moin-contenttypes-wrapper").find("form").fadeOut(200);
             $(this).removeClass().addClass("ct-hide");
-        }
-        else {
-            $(".moin-contenttypes-wrapper").find("ul").fadeIn(200);
+        } else {
+            $(".moin-contenttypes-wrapper").find("form").fadeIn(200);
             $(this).removeClass().addClass("ct-shown");
         }
     });
 
     $(".filter-toggle").click(function () {
         $(".moin-contenttypes-wrapper form").find("input[type='checkbox']").each(function () {
-            if($(this).attr("checked"))
+            if ($(this).attr("checked")) {
                 $(this).removeAttr("checked");
-            else
+            } else {
                 $(this).attr("checked", "checked");
+            }
         });
         return false;
     });
 
     $(".filter-more").click(function () {
         var helper_texts = $(".moin-contenttypes-wrapper form").find(".helper-text:visible");
-        if(helper_texts.length) {
+        if (helper_texts.length) {
             helper_texts.fadeOut();
-        }
-        else {
+        } else {
             $(".moin-contenttypes-wrapper form").find(".helper-text").css("display", "block");
         }
 
@@ -130,65 +138,64 @@
     });
 
     $(".moin-select-item").click(function () {
-        if($(this).parent().hasClass("selected-item")) {
+        var downloadlink;
+        if ($(this).parent().hasClass("selected-item")) {
             $(this).parent().removeClass("selected-item");
-            downloadlink=$(this).parent().children(".moin-download-link");
+            downloadlink = $(this).parent().children(".moin-download-link");
             disablelink(downloadlink);
-            if($(".moin-select-allitem").hasClass("allitem-selected")) {
+            if ($(".moin-select-allitem").hasClass("allitem-selected")) {
                 $(".moin-select-allitem").removeClass("allitem-selected").addClass("allitem-toselect");
             }
-        }
-        else {
+        } else {
             $(this).parent().addClass("selected-item");
-            downloadlink=$(this).parent().children(".moin-download-link");
+            downloadlink = $(this).parent().children(".moin-download-link");
             enablelink(downloadlink);
         }
     });
 
     $(".show-action").click(function () {
-        actionsDiv = $(this).parent().parent();
-         if(actionsDiv.find("ul:first").is(":visible")) {
-             actionsDiv.find("ul:first").fadeOut(200);
-             actionsDiv.removeClass("action-visible");
-         }
-         else {
-             actionsDiv.find("ul:first").fadeIn(200);
-             actionsDiv.addClass("action-visible");
-         }
+        var actionsDiv = $(this).parent().parent();
+        if (actionsDiv.find("ul:first").is(":visible")) {
+            actionsDiv.find("ul:first").fadeOut(200);
+            actionsDiv.removeClass("action-visible");
+        } else {
+            actionsDiv.find("ul:first").fadeIn(200);
+            actionsDiv.addClass("action-visible");
+        }
     });
 
     $(".moin-select-allitem").click(function () {
-        if($(this).hasClass("allitem-toselect")) {
+        var downloadlink;
+        if ($(this).hasClass("allitem-toselect")) {
             $(".moin-item-index div").removeClass().addClass("selected-item");
             $(".moin-item-index div").each(function () {
-                downloadlink=$(this).children(".moin-download-link");
+                downloadlink = $(this).children(".moin-download-link");
                 enablelink(downloadlink);
             });
             $(this).removeClass("allitem-toselect").addClass("allitem-selected");
-        }
-        else {
+        } else {
             $(this).removeClass("allitem-selected").addClass("allitem-toselect");
             $(".moin-item-index div").removeClass();
             $(".moin-item-index div").each(function () {
-                downloadlink=$(this).children(".moin-download-link");
+                downloadlink = $(this).children(".moin-download-link");
                 disablelink(downloadlink);
             });
         }
     });
 
     $(".moin-action-tab").click(function () {
-        if(!($("div.selected-item").length)) {
+        if (!($("div.selected-item").length)) {
             $(".moin-index-message span").text("Nothing was selected.");
             $(".moin-index-message").fadeIn();
             setTimeout(function () {
                 $(".moin-index-message").fadeOut();
             }, 4000);
-        }
-        else {
-            if(this.id == "moin-delete-trigger")
+        } else {
+            if (this.id === "moin-delete-trigger") {
                 showpop("delete");
-            else
+            } else {
                 showpop("destroy");
+            }
         }
         $(".show-action").trigger("click");
     });
@@ -200,7 +207,7 @@
     });
 
     $(".popup-cancel").click(function () {
-        if($("#popup-for-newitem:visible").length) {
+        if ($("#popup-for-newitem:visible").length) {
             $("#file_upload").appendTo("#moin-upload-cont");
             $(".upload-form").css("display", "none");
         }
@@ -208,30 +215,30 @@
     });
 
     $(".popup-submit").click(function () {
-        var comment = $(".popup-comment").val();
-        var action = $(".popup-action").val();
+        var comment = $(".popup-comment").val(),
+            action = $(".popup-action").val();
         comment = $.trim(comment);
         do_action(comment, action);
         hidepop();
     });
 
     $("#popup-for-newitem").find("form:first").submit(function () {
-        var itembox = $(this).children("input[name='newitem']");
-        itemname = itembox.val();
-        if($.trim(itemname) == "") {
+        var itembox = $(this).children("input[name='newitem']"),
+            itemname = itembox.val();
+        if ($.trim(itemname) === "") {
             itembox.addClass("blank");
             itembox.focus();
             return false;
-       }
+        }
     });
 
     $("#moin-download-trigger").click(function () {
-        if(!($("a.active-link").length)) {
-           $(".moin-index-message span").text("Nothing was selected.");
-           $(".moin-index-message").fadeIn();
-           setTimeout(function () {
-               $(".moin-index-message").fadeOut();
-           }, 4000);
+        if (!($("a.active-link").length)) {
+            $(".moin-index-message span").text("Nothing was selected.");
+            $(".moin-index-message").fadeIn();
+            setTimeout(function () {
+                $(".moin-index-message").fadeOut();
+            }, 4000);
         }
         $(".show-action").trigger("click");
     });
--- a/MoinMoin/static/js/jfu.js	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/static/js/jfu.js	Thu Jun 21 03:33:59 2012 +0400
@@ -10,6 +10,7 @@
  * http://creativecommons.org/licenses/MIT/
  */
 
+/*jslint browser: true, */
 /*jslint regexp: false */
 /*global jQuery */
 
@@ -32,8 +33,7 @@
                     $(this)
                         .addClass('ui-button ui-widget ui-state-default ui-corner-all')
                         .addClass(
-                            options.text === false ? 'ui-button-icon-only' :
-                                'ui-button-text-icon-primary'
+                            options.text === false ? 'ui-button-icon-only' : 'ui-button-text-icon-primary'
                         )
                         .html($('<span class="ui-button-text"/>').text($(this).text()))
                         .prepend(
@@ -48,7 +48,7 @@
     UploadHandler = function (container, options) {
         var uploadHandler = this;
 
-        this.fileArray = new Array();
+        this.fileArray = [];
         this.url = container.find('form:first').attr('action');
         this.dropZone = $("#moin-content");
         this.uploadTable = container.find('.files:first');
@@ -76,8 +76,9 @@
         };
 
         this.fileExist = function (fileName, fileArray) {
-            for(var i=0; i<fileArray.length; i++) {
-                  if (fileArray[i] == fileName) return true;
+            var i;
+            for (i = 0; i < fileArray.length; i += 1) {
+                if (fileArray[i] === fileName) { return true; }
             }
             fileArray.push(fileName);
             return false;
@@ -108,14 +109,14 @@
                 fileName = handler.formatFileName(file.name),
                 uploadRow = handler.uploadTemplate
                     .clone().removeAttr('id');
-            if(!handler.fileExist(fileName, handler.fileArray)) {
-            uploadRow.find('.file_name')
-                .text(fileName);
-            uploadRow.find('.file_upload_start button')
-                .button({icons: {primary: 'ui-icon-circle-arrow-e'}, text: false});
-            uploadRow.find('.file_upload_cancel button')
-                .button({icons: {primary: 'ui-icon-cancel'}, text: false});
-            return uploadRow;
+            if (!handler.fileExist(fileName, handler.fileArray)) {
+                uploadRow.find('.file_name')
+                    .text(fileName);
+                uploadRow.find('.file_upload_start button')
+                    .button({icons: {primary: 'ui-icon-circle-arrow-e'}, text: false});
+                uploadRow.find('.file_upload_cancel button')
+                    .button({icons: {primary: 'ui-icon-cancel'}, text: false});
+                return uploadRow;
             }
             return null;
 
@@ -267,11 +268,11 @@
     $.fn.fileUploadUIX = function (method) {
         if (methods[method]) {
             return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
-        } else if (typeof method === 'object' || !method) {
+        }
+        if (typeof method === 'object' || !method) {
             return methods.init.apply(this, arguments);
-        } else {
-            $.error('Method "' + method + '" does not exist on jQuery.fileUploadUIX');
         }
+        $.error('Method "' + method + '" does not exist on jQuery.fileUploadUIX');
     };
 
 }(jQuery));
@@ -291,6 +292,7 @@
 /*global $ */
 
 $(function () {
+    'use strict';
     // Initialize jQuery File Upload (Extended User Interface Version):
     $('#file_upload').fileUploadUIX();
 });
--- a/MoinMoin/storage/backends/_tests/__init__.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/storage/backends/_tests/__init__.py	Thu Jun 21 03:33:59 2012 +0400
@@ -110,7 +110,7 @@
             metaid = self.be.store(meta, StringIO(data))
 
     def test_iter(self):
-        mds = [#(metadata items, data str)
+        mds = [# (metadata items, data str)
                 (dict(name='one'), 'ONE'),
                 (dict(name='two'), 'TWO'),
                 (dict(name='three'), 'THREE'),
--- a/MoinMoin/storage/backends/_tests/test_fileserver.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/storage/backends/_tests/test_fileserver.py	Thu Jun 21 03:33:59 2012 +0400
@@ -53,7 +53,7 @@
     def test_files(self):
         # note: as we can only store the data into the file system, meta can
         # only have items that are generated by the fileserver backend:
-        items = [#name,  meta,   data
+        items = [# name,  meta,   data
                  (u'foo.png', dict(size=11, contenttype=u'image/png'), 'png content'),
                  (u'bar.txt', dict(size=12, contenttype=u'text/plain'), 'text content'),
                 ]
@@ -82,7 +82,7 @@
     def test_dir(self):
         # note: as we can only store the data into the file system, meta can
         # only have items that are generated by the fileserver backend:
-        items = [#name,  meta,   data
+        items = [# name,  meta,   data
                  (u'dir/foo.png', dict(size=11, contenttype=u'image/png'), 'png content'),
                  (u'dir/bar.txt', dict(size=12, contenttype=u'text/plain'), 'text content'),
                 ]
--- a/MoinMoin/storage/middleware/_tests/test_indexing.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/storage/middleware/_tests/test_indexing.py	Thu Jun 21 03:33:59 2012 +0400
@@ -348,7 +348,6 @@
         with pytest.raises(ValueError):
             rev.data.read()
 
-
     def test_indexed_content(self):
         # TODO: this is a very simple check that assumes that data is put 1:1
         # into index' CONTENT field.
--- a/MoinMoin/storage/middleware/_tests/test_protecting.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/storage/middleware/_tests/test_protecting.py	Thu Jun 21 03:33:59 2012 +0400
@@ -113,7 +113,6 @@
         with pytest.raises(AccessDenied):
             item.destroy_revision(revid_protected)
 
-
     def test_destroy_item(self):
         revid_unprotected, revid_protected = self.make_items(u'joe:destroy', u'boss:destroy')
         # now testing:
--- a/MoinMoin/storage/middleware/_tests/test_routing.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/storage/middleware/_tests/test_routing.py	Thu Jun 21 03:33:59 2012 +0400
@@ -30,7 +30,6 @@
     return ROBackend(store.meta_store, store.data_store)
 
 
-
 def pytest_funcarg__router(request):
     root_be = StoreBackend(MemoryBytesStore(), MemoryFileStore())
     sub_be = StoreBackend(MemoryBytesStore(), MemoryFileStore())
--- a/MoinMoin/storage/middleware/indexing.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/storage/middleware/indexing.py	Thu Jun 21 03:33:59 2012 +0400
@@ -262,8 +262,12 @@
         latest_revs_fields.update(**common_fields)
 
         userprofile_fields = {
-            EMAIL: ID(unique=True, stored=True),
-            OPENID: ID(unique=True, stored=True),
+            # Note: email / openid (if given) should be unique, but we might
+            # have lots of empty values if it is not given and thus it is NOT
+            # unique overall! Wrongly declaring it unique would lead to whoosh
+            # killing other users from index when update_document() is called!
+            EMAIL: ID(stored=True),
+            OPENID: ID(stored=True),
         }
         latest_revs_fields.update(**userprofile_fields)
 
--- a/MoinMoin/storage/middleware/validation.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/storage/middleware/validation.py	Thu Jun 21 03:33:59 2012 +0400
@@ -132,7 +132,6 @@
     return name_validator(element, state)
 
 
-
 def user_contenttype_validator(element, state):
     """
     user profile content type
--- a/MoinMoin/storage/stores/kt.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/storage/stores/kt.py	Thu Jun 21 03:33:59 2012 +0400
@@ -112,7 +112,7 @@
             return None
         return body
 
-    def set(self, key, value, xt = None):
+    def set(self, key, value, xt=None):
         if isinstance(key, unicode):
             key = key.encode("utf-8")
         key = "/" + urllib.quote(key)
@@ -146,7 +146,7 @@
             return None
         return response # XXX can we do that?
 
-    def set(self, key, value, xt = None):
+    def set(self, key, value, xt=None):
         if isinstance(key, unicode):
             key = key.encode("utf-8")
         key = "/" + urllib.quote(key)
--- a/MoinMoin/templates/base.html	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/templates/base.html	Thu Jun 21 03:33:59 2012 +0400
@@ -35,10 +35,6 @@
 
     {% block head_links %}
     <link rel="shortcut icon" href="{{ url_for('static', filename='logos/favicon.ico') }}" />
-    {% set parent_item = theme_supp.parent_item(item_name) %}
-    {%- if parent_item -%}
-        <link rel="up" href="{{ url_for('frontend.show_item', item_name=parent_item) }}" />
-    {%- endif %}
 
     {% block theme_stylesheets %}
     <link media="all" rel="stylesheet" href="{{ theme_static('css/common.css') }}" />
--- a/MoinMoin/templates/forms.html	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/templates/forms.html	Thu Jun 21 03:33:59 2012 +0400
@@ -35,7 +35,7 @@
        to the input id attribute. This is needed so the id will match the for attribute
        in the matching label generated 2 lines below.
     #}
-    {{ gen.input(field, type=field_type, auto_value=False) }}
+    {{ gen.input(field, type=field_type, auto_value=False, checked="checked") }}
     {{ render_errors(field) }}
     {{ gen.label(field) }}
     <span class="helper-text">
--- a/MoinMoin/templates/index.html	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/templates/index.html	Thu Jun 21 03:33:59 2012 +0400
@@ -159,9 +159,9 @@
                 <form action={{ url_for('.ajaxmodify') }} method="post">
                     <label for="moin-newitem">{{ _("Item name") }}</label>
                     {% if item_name %}
-                        <input type="text" id="moin-newitem" placeholder="{{ _("Enter item name here") }}" value="{{ item_name }}/" required="required"/>
+                        <input type="text" id="moin-newitem" name="newitem" placeholder="{{ _("Enter item name here") }}" value="{{ item_name }}/" required="required"/>
                     {% else %}
-                        <input type="text" id="moin-newitem" placeholder="{{ _("Enter item name here") }}" required="required"/>
+                        <input type="text" id="moin-newitem" name="newitem" placeholder="{{ _("Enter item name here") }}" required="required"/>
                     {% endif %}
                     <br/>
                     <input type="submit" value="{{ _("Create") }}"/>
--- a/MoinMoin/themes/__init__.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/themes/__init__.py	Thu Jun 21 03:33:59 2012 +0400
@@ -45,7 +45,6 @@
         return get_theme(theme_name)
 
 
-
 def render_template(template, **context):
     flaskg.clock.start('render_template')
     output = render_theme_template(get_current_theme(), template, **context)
--- a/MoinMoin/themes/foobar/templates/index.html	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/themes/foobar/templates/index.html	Thu Jun 21 03:33:59 2012 +0400
@@ -56,7 +56,6 @@
                     {{ forms.render_filter_field(gen, form['video_items'], 'checkbox', contenttype_groups['video items']) }}
                     {{ forms.render_filter_field(gen, form['other_items'], 'checkbox', contenttype_groups['other items']) }}
                     {{ forms.render_filter_field(gen, form['unknown_items'], 'checkbox', unknown_items_label) }}
-
                 </ul>
                 {{ gen.input(form['submit'], type='submit') }}
                 {{ gen.form.close() }}
@@ -153,9 +152,9 @@
                 <form action={{ url_for('.ajaxmodify') }} method="post">
                     <label for="moin-newitem">{{ _("Item name") }}</label>
                     {% if item_name %}
-                        <input type="text" id="moin-newitem" placeholder="{{ _("Enter item name here") }}" value="{{ item_name }}/" required="required"/>
+                        <input type="text" id="moin-newitem" name="newitem" placeholder="{{ _("Enter item name here") }}" value="{{ item_name }}/" required="required"/>
                     {% else %}
-                        <input type="text" id="moin-newitem" placeholder="{{ _("Enter item name here") }}" required="required"/>
+                        <input type="text" id="moin-newitem" name="newitem" placeholder="{{ _("Enter item name here") }}" required="required"/>
                     {% endif %}
                     <br/>
                     <input type="submit" value="{{ _("Create") }}"/>
--- a/MoinMoin/themes/modernized/static/css/common.css	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/themes/modernized/static/css/common.css	Thu Jun 21 03:33:59 2012 +0400
@@ -256,7 +256,7 @@
 .moin-contenttypes-wrapper div { cursor: pointer; margin: 0.1em; padding: 0.5em 1.2em 0.5em 0.5em ; height: 1em; }
 div.ct-shown { background: #4477FF url("../img/moin-movedown.png") no-repeat center right; color: #FFFFFF; }
 div.ct-hide { background: transparent url("../img/moin-moveup.png") no-repeat center right; }
-.moin-contenttypes-wrapper ul { position: absolute; top: 1.9em; left: 0; display: none; margin: 0.3em 0; border-top: 1px solid #E5E5E5; z-index: 2; background: #FFFFFF; border: 1px solid #E5E5E5; }
+.moin-contenttypes-wrapper form { position: absolute; top: 1.9em; left: 0; display: none; margin: 0.3em 0; border-top: 1px solid #E5E5E5; z-index: 2; background: #FFFFFF; border: 1px solid #E5E5E5; }
 .moin-contenttypes-wrapper ul li { list-style-type: none; padding: 0.5em; min-width: 11.5em; }
 .moin-contenttypes-wrapper ul li label { margin-left: 0.5em; }
 .moin-contenttypes-wrapper ul li .helper-text { font-size: 0.7em; color: #6E6A6B; display: none; }
--- a/MoinMoin/user.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/user.py	Thu Jun 21 03:33:59 2012 +0400
@@ -446,13 +446,12 @@
         if not exists:
             pass # XXX UserCreatedEvent
         else:
-            pass #  XXX UserChangedEvent
+            pass # XXX UserChangedEvent
 
     def getText(self, text):
         """ translate a text to the language of this user """
         return text # FIXME, was: self._request.getText(text, lang=self.language)
 
-
     # Bookmarks --------------------------------------------------------------
 
     def _set_bookmark(self, tm):
--- a/MoinMoin/util/_tests/test_filesys.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/util/_tests/test_filesys.py	Thu Jun 21 03:33:59 2012 +0400
@@ -159,7 +159,7 @@
         self.test_dest_dir = self.test_dir + '_copy'
         filesys.copytree(self.test_dir, self.test_dest_dir)
         # check for the dir contents
-        assert os.listdir(self.test_dir) == os.listdir(self.test_dest_dir)
+        assert sorted(os.listdir(self.test_dir)) == sorted(os.listdir(self.test_dest_dir))
 
     def test_dir_exist(self):
         """ raise Error if dir already exist """
--- a/MoinMoin/util/_tests/test_interwiki.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/util/_tests/test_interwiki.py	Thu Jun 21 03:33:59 2012 +0400
@@ -102,7 +102,6 @@
         with pytest.raises(ValueError):
             InterWikiMap.from_string(u'foobarbaz')
 
-
     def test_real_interwiki_map(self):
         """
         Test a 'real' interwiki file.
--- a/MoinMoin/util/_tests/test_mimetype.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/util/_tests/test_mimetype.py	Thu Jun 21 03:33:59 2012 +0400
@@ -13,7 +13,7 @@
     """ Test: util.mimetype """
 
     def test_parse_format(self):
-        MimeType_obj = mimetype.MimeType(filename = 'test_file.jpg')
+        MimeType_obj = mimetype.MimeType(filename='test_file.jpg')
         # format in config.parser_text_mimetype
         test = [
         #test_format    # test_mimetype
@@ -54,25 +54,25 @@
 
         # when mimestr is None
         for test_extension, test_major_minor in test:
-            MimeType_obj = mimetype.MimeType(filename = 'test_file' + test_extension)
+            MimeType_obj = mimetype.MimeType(filename='test_file' + test_extension)
             result = MimeType_obj.mime_type()
             expected = test_major_minor
             assert result == expected
 
         # when mimestr is not None
-        MimeType_obj = mimetype.MimeType(filename = 'test_file', mimestr = 'image/jpeg;charset="utf-8";misc=moin_misc')
+        MimeType_obj = mimetype.MimeType(filename='test_file', mimestr='image/jpeg;charset="utf-8";misc=moin_misc')
         result = MimeType_obj.mime_type()
         assert result == 'image/jpeg'
 
     def test_content_type(self):
         MimeType_obj = mimetype.MimeType('test_file.mpeg')
 
-        result1 = MimeType_obj.content_type(major = 'application', minor = 'pdf', charset="utf-16", params=None)
+        result1 = MimeType_obj.content_type(major='application', minor='pdf', charset="utf-16", params=None)
         expected = 'application/pdf'
         assert result1 == expected
 
         # major == 'text'
-        result2 = MimeType_obj.content_type(major = 'text', minor = 'plain', charset="utf-16", params=None)
+        result2 = MimeType_obj.content_type(major='text', minor='plain', charset="utf-16", params=None)
         expected = 'text/plain; charset="utf-16"'
         assert result2 == expected
 
--- a/MoinMoin/util/_tests/test_paramparser.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/util/_tests/test_paramparser.py	Thu Jun 21 03:33:59 2012 +0400
@@ -137,11 +137,11 @@
 
     def testUnitArgument(self):
         result = paramparser.UnitArgument('7mm', float, ['%', 'mm'])
-        assert result.get_default() ==  (7.0, 'mm')
+        assert result.get_default() == (7.0, 'mm')
         assert result.parse_argument('8%') == (8.0, '%')
-        pytest.raises(ValueError, result.parse_argument,  u'7m')
-        pytest.raises(ValueError, result.parse_argument,  u'7')
-        pytest.raises(ValueError, result.parse_argument,  u'mm')
+        pytest.raises(ValueError, result.parse_argument, u'7m')
+        pytest.raises(ValueError, result.parse_argument, u'7')
+        pytest.raises(ValueError, result.parse_argument, u'mm')
 
     def testExtendedParser(self):
         tests = [
--- a/MoinMoin/util/_tests/test_send_file.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/util/_tests/test_send_file.py	Thu Jun 21 03:33:59 2012 +0400
@@ -29,10 +29,10 @@
 
     def test_temptest(self):
         self.makefile(self.fname, 'test_content')
-        result = send_file.send_file(self.fname, as_attachment = True, conditional = True)
+        result = send_file.send_file(self.fname, as_attachment=True, conditional=True)
         expected = '<Response streamed [200 OK]>'
         assert str(result) == expected
 
         with pytest.raises(TypeError):
-            send_file.send_file(None, as_attachment = True)
+            send_file.send_file(None, as_attachment=True)
 
--- a/MoinMoin/util/diff3.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/util/diff3.py	Thu Jun 21 03:33:59 2012 +0400
@@ -261,7 +261,6 @@
 AAA 014
 """
 
-
     text = text_merge(text0, text1, text2)
     print(text)
 
--- a/MoinMoin/util/diff_text.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/util/diff_text.py	Thu Jun 21 03:33:59 2012 +0400
@@ -32,14 +32,14 @@
         if l[0] != ' ':
             changed = 1
             break
-    if not changed: return []
+    if not changed:
+        return []
 
 #    if not "we want the unchanged lines, too":
 #        if "no questionmark lines":
 #            lines = [line for line in lines if line[0] != '?']
 #        return lines
 
-
     # calculate the hunks and remove the unchanged lines between them
     i = 0              # actual index in lines
     count = 0          # number of unchanged lines
@@ -65,8 +65,10 @@
             else:
                 count = 0
                 i += 1
-            if marker == '-': lcount_old = lcount_old + 1
-            else: lcount_new = lcount_new + 1
+            if marker == '-':
+                lcount_old = lcount_old + 1
+            else:
+                lcount_new = lcount_new + 1
         elif marker == '?':
             lines[i:i+1] = []
 
--- a/MoinMoin/util/iri.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/util/iri.py	Thu Jun 21 03:33:59 2012 +0400
@@ -146,11 +146,16 @@
             return unicode(self) == other
 
         if isinstance(other, Iri):
-            if self._scheme != other._scheme: return False
-            if self._authority != other._authority: return False
-            if self._path != other._path: return False
-            if self._query != other._query: return False
-            if self._fragment != other._fragment: return False
+            if self._scheme != other._scheme:
+                return False
+            if self._authority != other._authority:
+                return False
+            if self._path != other._path:
+                return False
+            if self._query != other._query:
+                return False
+            if self._fragment != other._fragment:
+                return False
             return True
 
         return NotImplemented
--- a/MoinMoin/util/mime.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/util/mime.py	Thu Jun 21 03:33:59 2012 +0400
@@ -6,7 +6,6 @@
 """
 
 
-
 class Type(object):
     """
     :ivar type: Type part
@@ -50,9 +49,12 @@
             return self.__eq__(self.__class__(other))
 
         if isinstance(other, Type):
-            if self.type != other.type: return False
-            if self.subtype != other.subtype: return False
-            if self.parameters != other.parameters: return False
+            if self.type != other.type:
+                return False
+            if self.subtype != other.subtype:
+                return False
+            if self.parameters != other.parameters:
+                return False
             return True
 
         return NotImplemented
@@ -115,8 +117,10 @@
         - the other parameters are a supperset of this one.
         """
         if isinstance(other, Type):
-            if self.type and self.type != other.type: return False
-            if self.subtype and self.subtype != other.subtype: return False
+            if self.type and self.type != other.type:
+                return False
+            if self.subtype and self.subtype != other.subtype:
+                return False
             self_params = set(self.parameters.iteritems())
             other_params = set(other.parameters.iteritems())
             return self_params <= other_params
--- a/MoinMoin/util/registry.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/MoinMoin/util/registry.py	Thu Jun 21 03:33:59 2012 +0400
@@ -10,7 +10,6 @@
 """
 
 
-
 class RegistryBase(object):
     PRIORITY_REALLY_FIRST = -20
     PRIORITY_FIRST = -10
--- a/setup.py	Thu Jun 21 02:56:28 2012 +0400
+++ b/setup.py	Thu Jun 21 03:33:59 2012 +0400
@@ -93,6 +93,7 @@
         'pygments>=1.4', # src code / text file highlighting
         'Werkzeug>=0.8.1', # wsgi toolkit
         'pytest>=2.1', # pytest is needed by unit tests
+        'pep8', # pep8 style checker is needed by unit tests
         'whoosh>=2.4.0', # needed for indexed search
         'sphinx>=1.1', # needed to build the docs
         'pdfminer', # pdf -> text/plain conversion