changeset 1374:04a434634ef9

pep8: fix some E502, but keep E502 disabled due to pep8 checker bug
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 10 Jun 2012 19:11:05 +0200
parents 7f36753d9fe3
children 2f19e76ad809
files MoinMoin/_tests/test_sourcecode.py MoinMoin/config/default.py MoinMoin/converter/moinwiki_out.py MoinMoin/converter/rst_in.py MoinMoin/converter/rst_out.py
diffstat 5 files changed, 36 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_sourcecode.py	Sun Jun 10 18:37:11 2012 +0200
+++ b/MoinMoin/_tests/test_sourcecode.py	Sun Jun 10 19:11:05 2012 +0200
@@ -24,9 +24,12 @@
 
 PEP8IGNORE = """
     E202 E221 E222 E241 E301 E302 E401 E501 E701 W391 W601 W602
-    E121 E122 E123 E124 E125 E126 E127 E128 E225 E251 E261 E262 E271 E293 E303 E502
+    E121 E122 E123 E124 E125 E126 E127 E128 E225 E251 E261 E262 E271 E293 E303
 """.split()
 
+# stuff disabled due to malfunctioning of the pep8 checker:
+PEP8IGNORE.append("E502")  # https://github.com/jcrocholl/pep8/issues/75
+
 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
--- a/MoinMoin/config/default.py	Sun Jun 10 18:37:11 2012 +0200
+++ b/MoinMoin/config/default.py	Sun Jun 10 19:11:05 2012 +0200
@@ -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/converter/moinwiki_out.py	Sun Jun 10 18:37:11 2012 +0200
+++ b/MoinMoin/converter/moinwiki_out.py	Sun Jun 10 19:11:05 2012 +0200
@@ -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/rst_in.py	Sun Jun 10 18:37:11 2012 +0200
+++ b/MoinMoin/converter/rst_in.py	Sun Jun 10 19:11:05 2012 +0200
@@ -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	Sun Jun 10 18:37:11 2012 +0200
+++ b/MoinMoin/converter/rst_out.py	Sun Jun 10 19:11:05 2012 +0200
@@ -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,9 +484,9 @@
         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'#.'
 
@@ -557,13 +557,13 @@
                                 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:
@@ -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)