From e4091c6413f1141a2a17360d036a850fb4001d63 Mon Sep 17 00:00:00 2001 From: Tommy Ip Date: Wed, 30 Nov 2016 21:49:02 +0000 Subject: [PATCH] pep8: Fix E222 violations. --- scripts/nagios/check-rabbitmq-queue | 2 +- tools/create-test-api-docs | 2 +- tools/lint-all | 2 +- zerver/lib/actions.py | 2 +- zerver/lib/logging_util.py | 2 +- zerver/lib/unminify.py | 2 +- zerver/tests/test_email_mirror.py | 2 +- zerver/views/webhooks/pivotal.py | 2 +- zilencer/error_notify.py | 6 +++--- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/nagios/check-rabbitmq-queue b/scripts/nagios/check-rabbitmq-queue index 31f2ddf5c0..8e51697a49 100755 --- a/scripts/nagios/check-rabbitmq-queue +++ b/scripts/nagios/check-rabbitmq-queue @@ -50,7 +50,7 @@ for line in output.split("\n"): status = max(status, this_status) max_count = max(max_count, count) -warn_about = ", ".join(warn_queues) +warn_about = ", ".join(warn_queues) now = int(time.time()) now_struct = time.gmtime(now) diff --git a/tools/create-test-api-docs b/tools/create-test-api-docs index 038e35b41e..1dfc9d3cca 100755 --- a/tools/create-test-api-docs +++ b/tools/create-test-api-docs @@ -42,7 +42,7 @@ def encode_info(info): result = '(stringified)\n' except: pass - result += cgi.escape(pprint.pformat(info, indent=4)) + result += cgi.escape(pprint.pformat(info, indent=4)) return '
' + result + '
' except: pass diff --git a/tools/lint-all b/tools/lint-all index b04e8a20ff..dbb77e9221 100755 --- a/tools/lint-all +++ b/tools/lint-all @@ -84,7 +84,7 @@ def check_pep8(files): ignored_rules = [ 'E402', 'E501', 'W503', 'E711', 'E201', 'E203', 'E202', 'E128', 'E226', 'E124', 'E125', 'E126', 'E127', 'E121', 'E122', 'E123', 'E266', 'E265', 'E261', 'E221', 'E303', - 'E241', 'E712', 'E702', 'E401', 'E115', 'E114', 'E111', 'E222', 'E731', 'E302', 'E129', + 'E241', 'E712', 'E702', 'E401', 'E115', 'E114', 'E111', 'E731', 'E302', 'E129', 'E741', 'E714', 'W391', 'E211', 'E713', 'E502', 'E131', 'E305', 'E251', 'E306', 'E231', ] pep8 = subprocess.Popen( diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index beb27239b4..adbe53f458 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -1076,7 +1076,7 @@ def already_sent_mirrored_message_id(message): else: time_window = datetime.timedelta(seconds=0) - messages = Message.objects.filter( + messages = Message.objects.filter( sender=message.sender, recipient=message.recipient, content=message.content, diff --git a/zerver/lib/logging_util.py b/zerver/lib/logging_util.py index c4d0493edd..04a80fa35f 100644 --- a/zerver/lib/logging_util.py +++ b/zerver/lib/logging_util.py @@ -18,7 +18,7 @@ class _RateLimitFilter(object): # Track duplicate errors duplicate = False - rate = getattr(settings, '%s_LIMIT' % self.__class__.__name__.upper(), + rate = getattr(settings, '%s_LIMIT' % self.__class__.__name__.upper(), 600) # seconds if rate > 0: # Test if the cache works diff --git a/zerver/lib/unminify.py b/zerver/lib/unminify.py index e1fda6a39c..0e32ea2741 100644 --- a/zerver/lib/unminify.py +++ b/zerver/lib/unminify.py @@ -45,7 +45,7 @@ class SourceMap(object): out += (' = %s line %d column %d\n' % (result.src, result.src_line+1, result.src_col+1)) except IndexError: - out += ' [Unable to look up in source map]\n' + out += ' [Unable to look up in source map]\n' if ln.startswith(' at'): out += '\n' diff --git a/zerver/tests/test_email_mirror.py b/zerver/tests/test_email_mirror.py index c7b461fce8..cf683cd1c3 100644 --- a/zerver/tests/test_email_mirror.py +++ b/zerver/tests/test_email_mirror.py @@ -285,7 +285,7 @@ class TestReplyExtraction(ZulipTestCase): stream = get_stream("Denmark", user_profile.realm) stream_to_address = encode_email_address(stream) - text = """Reply + text = """Reply -----Original Message----- diff --git a/zerver/views/webhooks/pivotal.py b/zerver/views/webhooks/pivotal.py index 79cbf5859e..9f096a7573 100644 --- a/zerver/views/webhooks/pivotal.py +++ b/zerver/views/webhooks/pivotal.py @@ -55,7 +55,7 @@ def api_pivotal_webhook_v3(request, user_profile, stream): content = description + more_info elif event_type == 'note_create': subject = "Comment added" - content = description + more_info + content = description + more_info elif event_type == 'story_create': issue_desc = get_text(['stories', 'story', 'description']) issue_type = get_text(['stories', 'story', 'story_type']) diff --git a/zilencer/error_notify.py b/zilencer/error_notify.py index 429929c6d0..728f3f0399 100644 --- a/zilencer/error_notify.py +++ b/zilencer/error_notify.py @@ -44,7 +44,7 @@ def email_browser_error(report): "href: %(href)s\n" "Server path: %(server_path)s\n" "Deployed version: %(version)s\n" - % report) + % (report)) more_info = report['more_info'] if more_info is not None: @@ -62,7 +62,7 @@ def zulip_browser_error(report): user_info = user_info_str(report) - body = "User: %s\n" % (user_info,) + body = "User: %s\n" % (user_info,) body += ("Message: %(message)s\n" % report ) @@ -78,7 +78,7 @@ def notify_server_error(report): def zulip_server_error(report): # type: (Dict[str, Any]) -> None - subject = '%(node)s: %(message)s' % report + subject = '%(node)s: %(message)s' % (report) stack_trace = report['stack_trace'] or "No stack trace available" user_info = user_info_str(report)