changeset 1379:440b2150593d

pep8: fix some E251
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 10 Jun 2012 20:30:21 +0200
parents 2e1a30ca278a
children 5aa7d0b9c803
files MoinMoin/_tests/test_sourcecode.py MoinMoin/apps/frontend/views.py MoinMoin/auth/_tests/test_auth.py MoinMoin/conftest.py MoinMoin/converter/mediawiki_in.py MoinMoin/converter/moinwiki_in.py MoinMoin/macro/_tests/test__base.py MoinMoin/storage/stores/kt.py MoinMoin/util/_tests/test_mimetype.py MoinMoin/util/_tests/test_send_file.py
diffstat 10 files changed, 27 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_sourcecode.py	Sun Jun 10 20:11:59 2012 +0200
+++ b/MoinMoin/_tests/test_sourcecode.py	Sun Jun 10 20:30:21 2012 +0200
@@ -25,7 +25,7 @@
 
 PEP8IGNORE = """
     E202 E221 E222 E241 E261 E301 E302 E401 E501 E701 W391 W601 W602
-    E121 E122 E123 E124 E125 E126 E127 E128 E225 E251
+    E121 E122 E123 E124 E125 E126 E127 E128 E225
 """.split()
 
 # stuff disabled due to malfunctioning of the pep8 checker:
--- a/MoinMoin/apps/frontend/views.py	Sun Jun 10 20:11:59 2012 +0200
+++ b/MoinMoin/apps/frontend/views.py	Sun Jun 10 20:30:21 2012 +0200
@@ -1423,9 +1423,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	Sun Jun 10 20:11:59 2012 +0200
+++ b/MoinMoin/auth/_tests/test_auth.py	Sun Jun 10 20:30:21 2012 +0200
@@ -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/conftest.py	Sun Jun 10 20:11:59 2012 +0200
+++ b/MoinMoin/conftest.py	Sun Jun 10 20:30:21 2012 +0200
@@ -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,
@@ -110,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/mediawiki_in.py	Sun Jun 10 20:11:59 2012 +0200
+++ b/MoinMoin/converter/mediawiki_in.py	Sun Jun 10 20:30:21 2012 +0200
@@ -851,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:
@@ -876,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:
--- a/MoinMoin/converter/moinwiki_in.py	Sun Jun 10 20:11:59 2012 +0200
+++ b/MoinMoin/converter/moinwiki_in.py	Sun Jun 10 20:30:21 2012 +0200
@@ -381,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/macro/_tests/test__base.py	Sun Jun 10 20:11:59 2012 +0200
+++ b/MoinMoin/macro/_tests/test__base.py	Sun Jun 10 20:30:21 2012 +0200
@@ -26,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')
@@ -39,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'
@@ -54,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/storage/stores/kt.py	Sun Jun 10 20:11:59 2012 +0200
+++ b/MoinMoin/storage/stores/kt.py	Sun Jun 10 20:30:21 2012 +0200
@@ -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/util/_tests/test_mimetype.py	Sun Jun 10 20:11:59 2012 +0200
+++ b/MoinMoin/util/_tests/test_mimetype.py	Sun Jun 10 20:30:21 2012 +0200
@@ -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_send_file.py	Sun Jun 10 20:11:59 2012 +0200
+++ b/MoinMoin/util/_tests/test_send_file.py	Sun Jun 10 20:30:21 2012 +0200
@@ -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)