mirror of https://github.com/zulip/zulip.git
pep8: fix E202 violations
This commit is contained in:
parent
991c84fa1e
commit
7e14fe65ab
|
@ -37,7 +37,7 @@ logging.basicConfig()
|
||||||
|
|
||||||
log = logging.getLogger('zulip-send')
|
log = logging.getLogger('zulip-send')
|
||||||
|
|
||||||
def do_send_message(client, message_data ):
|
def do_send_message(client, message_data):
|
||||||
# type: (zulip.Client, Dict[str, Any]) -> bool
|
# type: (zulip.Client, Dict[str, Any]) -> bool
|
||||||
'''Sends a message and optionally prints status about the same.'''
|
'''Sends a message and optionally prints status about the same.'''
|
||||||
|
|
||||||
|
|
|
@ -389,7 +389,7 @@ def process_notice(notice, log):
|
||||||
zeph = { 'time': str(notice.time),
|
zeph = { 'time': str(notice.time),
|
||||||
'sender': notice.sender,
|
'sender': notice.sender,
|
||||||
'zsig': zsig, # logged here but not used by app
|
'zsig': zsig, # logged here but not used by app
|
||||||
'content': body }
|
'content': body}
|
||||||
if is_huddle:
|
if is_huddle:
|
||||||
zeph['type'] = 'private'
|
zeph['type'] = 'private'
|
||||||
zeph['recipient'] = huddle_recipients
|
zeph['recipient'] = huddle_recipients
|
||||||
|
|
|
@ -82,7 +82,7 @@ def check_pep8(files):
|
||||||
# type: (List[str]) -> bool
|
# type: (List[str]) -> bool
|
||||||
failed = False
|
failed = False
|
||||||
ignored_rules = [
|
ignored_rules = [
|
||||||
'E402', 'E501', 'W503', 'E711', 'E201', 'E202', 'E128', 'E226',
|
'E402', 'E501', 'W503', 'E711', 'E201', 'E128', 'E226',
|
||||||
'E126', 'E121', 'E122', 'E123', 'E266', 'E265', 'E261', 'E221', 'E303',
|
'E126', 'E121', 'E122', 'E123', 'E266', 'E265', 'E261', 'E221', 'E303',
|
||||||
'E241', 'E712', 'E702', 'E401', 'E115', 'E114', 'E731', 'E302', 'E129',
|
'E241', 'E712', 'E702', 'E401', 'E115', 'E114', 'E731', 'E302', 'E129',
|
||||||
'E741', 'E714', 'W391', 'E713', 'E502', 'E131', 'E305', 'E251', 'E306',
|
'E741', 'E714', 'W391', 'E713', 'E502', 'E131', 'E305', 'E251', 'E306',
|
||||||
|
|
|
@ -29,7 +29,7 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
if args.coverage:
|
if args.coverage:
|
||||||
import coverage
|
import coverage
|
||||||
cov = coverage.Coverage(branch=True, omit=[ "*/zulip-venv-cache/*", dir_join(tools_test_dir, "*") ])
|
cov = coverage.Coverage(branch=True, omit=[ "*/zulip-venv-cache/*", dir_join(tools_test_dir, "*")])
|
||||||
cov.start()
|
cov.start()
|
||||||
|
|
||||||
suite = loader.discover(start_dir=tools_test_dir, top_level_dir=root_dir)
|
suite = loader.discover(start_dir=tools_test_dir, top_level_dir=root_dir)
|
||||||
|
|
|
@ -751,7 +751,7 @@ class Recipient(ModelReprMixin, models.Model):
|
||||||
_type_names = {
|
_type_names = {
|
||||||
PERSONAL: 'personal',
|
PERSONAL: 'personal',
|
||||||
STREAM: 'stream',
|
STREAM: 'stream',
|
||||||
HUDDLE: 'huddle' }
|
HUDDLE: 'huddle'}
|
||||||
|
|
||||||
def type_name(self):
|
def type_name(self):
|
||||||
# type: () -> str
|
# type: () -> str
|
||||||
|
|
|
@ -512,7 +512,7 @@ class EventsRegisterTest(ZulipTestCase):
|
||||||
({'Google': True, 'Email': True, 'GitHub': True, 'LDAP': False, 'Dev': False},
|
({'Google': True, 'Email': True, 'GitHub': True, 'LDAP': False, 'Dev': False},
|
||||||
{'Google': True, 'Email': True, 'GitHub': False, 'LDAP': False, 'Dev': False},
|
{'Google': True, 'Email': True, 'GitHub': False, 'LDAP': False, 'Dev': False},
|
||||||
{'Google': True, 'Email': False, 'GitHub': False, 'LDAP': False, 'Dev': False},
|
{'Google': True, 'Email': False, 'GitHub': False, 'LDAP': False, 'Dev': False},
|
||||||
{'Google': True, 'Email': False, 'GitHub': True, 'LDAP': False, 'Dev': False },
|
{'Google': True, 'Email': False, 'GitHub': True, 'LDAP': False, 'Dev': False},
|
||||||
{'Google': False, 'Email': False, 'GitHub': False, 'LDAP': False, 'Dev': True},
|
{'Google': False, 'Email': False, 'GitHub': False, 'LDAP': False, 'Dev': True},
|
||||||
{'Google': False, 'Email': False, 'GitHub': True, 'LDAP': False, 'Dev': True},
|
{'Google': False, 'Email': False, 'GitHub': True, 'LDAP': False, 'Dev': True},
|
||||||
{'Google': False, 'Email': True, 'GitHub': True, 'LDAP': True, 'Dev': False}):
|
{'Google': False, 'Email': True, 'GitHub': True, 'LDAP': True, 'Dev': False}):
|
||||||
|
|
|
@ -1006,7 +1006,7 @@ class EditMessageTest(ZulipTestCase):
|
||||||
# type: (int, text_type, bool) -> None
|
# type: (int, text_type, bool) -> None
|
||||||
new_subject = 'subject' + unique_str
|
new_subject = 'subject' + unique_str
|
||||||
new_content = 'content' + unique_str
|
new_content = 'content' + unique_str
|
||||||
params_dict = { 'message_id': id_, 'subject': new_subject }
|
params_dict = { 'message_id': id_, 'subject': new_subject}
|
||||||
if not topic_only:
|
if not topic_only:
|
||||||
params_dict['content'] = new_content
|
params_dict['content'] = new_content
|
||||||
result = self.client_post("/json/update_message", params_dict)
|
result = self.client_post("/json/update_message", params_dict)
|
||||||
|
@ -1023,7 +1023,7 @@ class EditMessageTest(ZulipTestCase):
|
||||||
old_content = message.content
|
old_content = message.content
|
||||||
new_subject = 'subject' + unique_str
|
new_subject = 'subject' + unique_str
|
||||||
new_content = 'content' + unique_str
|
new_content = 'content' + unique_str
|
||||||
params_dict = { 'message_id': id_, 'subject': new_subject }
|
params_dict = { 'message_id': id_, 'subject': new_subject}
|
||||||
if not topic_only:
|
if not topic_only:
|
||||||
params_dict['content'] = new_content
|
params_dict['content'] = new_content
|
||||||
result = self.client_post("/json/update_message", params_dict)
|
result = self.client_post("/json/update_message", params_dict)
|
||||||
|
|
|
@ -741,7 +741,7 @@ class SubscriptionPropertiesTest(ZulipTestCase):
|
||||||
"stream": unsubs_stream,
|
"stream": unsubs_stream,
|
||||||
"value": "#ffffff"}])})
|
"value": "#ffffff"}])})
|
||||||
self.assert_json_error(
|
self.assert_json_error(
|
||||||
result, "Not subscribed to stream %s" % (unsubs_stream,) )
|
result, "Not subscribed to stream %s" % (unsubs_stream,))
|
||||||
|
|
||||||
|
|
||||||
def test_json_subscription_property_invalid_verb(self):
|
def test_json_subscription_property_invalid_verb(self):
|
||||||
|
|
|
@ -64,7 +64,7 @@ def zulip_browser_error(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))
|
||||||
|
|
||||||
internal_send_message(settings.ERROR_BOT,
|
internal_send_message(settings.ERROR_BOT,
|
||||||
"stream", "errors", format_subject(subject), body)
|
"stream", "errors", format_subject(subject), body)
|
||||||
|
|
Loading…
Reference in New Issue