mirror of https://github.com/zulip/zulip.git
pep8: Fix E222 violations.
This commit is contained in:
parent
46b7d54b3e
commit
e4091c6413
|
@ -50,7 +50,7 @@ for line in output.split("\n"):
|
||||||
status = max(status, this_status)
|
status = max(status, this_status)
|
||||||
max_count = max(max_count, count)
|
max_count = max(max_count, count)
|
||||||
|
|
||||||
warn_about = ", ".join(warn_queues)
|
warn_about = ", ".join(warn_queues)
|
||||||
now = int(time.time())
|
now = int(time.time())
|
||||||
now_struct = time.gmtime(now)
|
now_struct = time.gmtime(now)
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ def encode_info(info):
|
||||||
result = '(stringified)\n'
|
result = '(stringified)\n'
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
result += cgi.escape(pprint.pformat(info, indent=4))
|
result += cgi.escape(pprint.pformat(info, indent=4))
|
||||||
return '<pre>' + result + '</pre>'
|
return '<pre>' + result + '</pre>'
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -84,7 +84,7 @@ def check_pep8(files):
|
||||||
ignored_rules = [
|
ignored_rules = [
|
||||||
'E402', 'E501', 'W503', 'E711', 'E201', 'E203', 'E202', 'E128', 'E226', 'E124', 'E125',
|
'E402', 'E501', 'W503', 'E711', 'E201', 'E203', 'E202', 'E128', 'E226', 'E124', 'E125',
|
||||||
'E126', 'E127', 'E121', 'E122', 'E123', 'E266', 'E265', 'E261', 'E221', 'E303',
|
'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',
|
'E741', 'E714', 'W391', 'E211', 'E713', 'E502', 'E131', 'E305', 'E251', 'E306', 'E231',
|
||||||
]
|
]
|
||||||
pep8 = subprocess.Popen(
|
pep8 = subprocess.Popen(
|
||||||
|
|
|
@ -1076,7 +1076,7 @@ def already_sent_mirrored_message_id(message):
|
||||||
else:
|
else:
|
||||||
time_window = datetime.timedelta(seconds=0)
|
time_window = datetime.timedelta(seconds=0)
|
||||||
|
|
||||||
messages = Message.objects.filter(
|
messages = Message.objects.filter(
|
||||||
sender=message.sender,
|
sender=message.sender,
|
||||||
recipient=message.recipient,
|
recipient=message.recipient,
|
||||||
content=message.content,
|
content=message.content,
|
||||||
|
|
|
@ -18,7 +18,7 @@ class _RateLimitFilter(object):
|
||||||
|
|
||||||
# Track duplicate errors
|
# Track duplicate errors
|
||||||
duplicate = False
|
duplicate = False
|
||||||
rate = getattr(settings, '%s_LIMIT' % self.__class__.__name__.upper(),
|
rate = getattr(settings, '%s_LIMIT' % self.__class__.__name__.upper(),
|
||||||
600) # seconds
|
600) # seconds
|
||||||
if rate > 0:
|
if rate > 0:
|
||||||
# Test if the cache works
|
# Test if the cache works
|
||||||
|
|
|
@ -45,7 +45,7 @@ class SourceMap(object):
|
||||||
out += (' = %s line %d column %d\n' %
|
out += (' = %s line %d column %d\n' %
|
||||||
(result.src, result.src_line+1, result.src_col+1))
|
(result.src, result.src_line+1, result.src_col+1))
|
||||||
except IndexError:
|
except IndexError:
|
||||||
out += ' [Unable to look up in source map]\n'
|
out += ' [Unable to look up in source map]\n'
|
||||||
|
|
||||||
if ln.startswith(' at'):
|
if ln.startswith(' at'):
|
||||||
out += '\n'
|
out += '\n'
|
||||||
|
|
|
@ -285,7 +285,7 @@ class TestReplyExtraction(ZulipTestCase):
|
||||||
stream = get_stream("Denmark", user_profile.realm)
|
stream = get_stream("Denmark", user_profile.realm)
|
||||||
|
|
||||||
stream_to_address = encode_email_address(stream)
|
stream_to_address = encode_email_address(stream)
|
||||||
text = """Reply
|
text = """Reply
|
||||||
|
|
||||||
-----Original Message-----
|
-----Original Message-----
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ def api_pivotal_webhook_v3(request, user_profile, stream):
|
||||||
content = description + more_info
|
content = description + more_info
|
||||||
elif event_type == 'note_create':
|
elif event_type == 'note_create':
|
||||||
subject = "Comment added"
|
subject = "Comment added"
|
||||||
content = description + more_info
|
content = description + more_info
|
||||||
elif event_type == 'story_create':
|
elif event_type == 'story_create':
|
||||||
issue_desc = get_text(['stories', 'story', 'description'])
|
issue_desc = get_text(['stories', 'story', 'description'])
|
||||||
issue_type = get_text(['stories', 'story', 'story_type'])
|
issue_type = get_text(['stories', 'story', 'story_type'])
|
||||||
|
|
|
@ -44,7 +44,7 @@ def email_browser_error(report):
|
||||||
"href: %(href)s\n"
|
"href: %(href)s\n"
|
||||||
"Server path: %(server_path)s\n"
|
"Server path: %(server_path)s\n"
|
||||||
"Deployed version: %(version)s\n"
|
"Deployed version: %(version)s\n"
|
||||||
% report)
|
% (report))
|
||||||
|
|
||||||
more_info = report['more_info']
|
more_info = report['more_info']
|
||||||
if more_info is not None:
|
if more_info is not None:
|
||||||
|
@ -62,7 +62,7 @@ def zulip_browser_error(report):
|
||||||
|
|
||||||
user_info = user_info_str(report)
|
user_info = user_info_str(report)
|
||||||
|
|
||||||
body = "User: %s\n" % (user_info,)
|
body = "User: %s\n" % (user_info,)
|
||||||
body += ("Message: %(message)s\n"
|
body += ("Message: %(message)s\n"
|
||||||
% report )
|
% report )
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ def notify_server_error(report):
|
||||||
|
|
||||||
def zulip_server_error(report):
|
def zulip_server_error(report):
|
||||||
# type: (Dict[str, Any]) -> None
|
# 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"
|
stack_trace = report['stack_trace'] or "No stack trace available"
|
||||||
|
|
||||||
user_info = user_info_str(report)
|
user_info = user_info_str(report)
|
||||||
|
|
Loading…
Reference in New Issue