pep8: Fix E124 violations

This commit is contained in:
AZtheAsian 2016-11-30 22:16:45 -07:00 committed by Tim Abbott
parent 1a8a329b44
commit f7582f0050
11 changed files with 17 additions and 17 deletions

View File

@ -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', 'E203', 'E202', 'E128', 'E226', 'E124', 'E402', 'E501', 'W503', 'E711', 'E201', 'E203', 'E202', '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', 'E111', 'E731', 'E302', 'E129', 'E241', 'E712', 'E702', 'E401', 'E115', 'E114', 'E111', 'E731', 'E302', 'E129',
'E741', 'E714', 'W391', 'E713', 'E502', 'E131', 'E305', 'E251', 'E306', 'E741', 'E714', 'W391', 'E713', 'E502', 'E131', 'E305', 'E251', 'E306',

View File

@ -1157,7 +1157,7 @@ def get_owned_bot_dicts(user_profile, include_all_realm_bots_if_admin=True):
'default_all_public_streams': botdict['default_all_public_streams'], 'default_all_public_streams': botdict['default_all_public_streams'],
'owner': botdict['bot_owner__email'], 'owner': botdict['bot_owner__email'],
'avatar_url': get_avatar_url(botdict['avatar_source'], botdict['email']), 'avatar_url': get_avatar_url(botdict['avatar_source'], botdict['email']),
} }
for botdict in result] for botdict in result]
def get_prereg_user_by_email(email): def get_prereg_user_by_email(email):

View File

@ -294,7 +294,7 @@ class PersonalMessagesTest(ZulipTestCase):
user_message = most_recent_usermessage(user_profile) user_message = most_recent_usermessage(user_profile)
self.assertEqual(str(user_message), self.assertEqual(str(user_message),
u'<UserMessage: recip / test@zulip.com ([])>' u'<UserMessage: recip / test@zulip.com ([])>'
) )
@slow("checks several profiles") @slow("checks several profiles")
def test_personal_to_self(self): def test_personal_to_self(self):

View File

@ -79,7 +79,7 @@ class PublicURLTest(ZulipTestCase):
"/api/v1/streams", "/api/v1/streams",
], ],
404: ["/help/nonexistent"], 404: ["/help/nonexistent"],
} }
post_urls = {200: ["/accounts/login/"], post_urls = {200: ["/accounts/login/"],
302: ["/accounts/logout/"], 302: ["/accounts/logout/"],
401: ["/json/messages", 401: ["/json/messages",
@ -96,9 +96,9 @@ class PublicURLTest(ZulipTestCase):
400: ["/api/v1/external/github", 400: ["/api/v1/external/github",
"/api/v1/fetch_api_key", "/api/v1/fetch_api_key",
], ],
} }
put_urls = {401: ["/json/users/me/pointer"], put_urls = {401: ["/json/users/me/pointer"],
} }
for status_code, url_set in six.iteritems(get_urls): for status_code, url_set in six.iteritems(get_urls):
self.fetch("get", url_set, status_code) self.fetch("get", url_set, status_code)
for status_code, url_set in six.iteritems(post_urls): for status_code, url_set in six.iteritems(post_urls):
@ -112,7 +112,7 @@ class PublicURLTest(ZulipTestCase):
resp = self.client_get("/api/v1/fetch_google_client_id") resp = self.client_get("/api/v1/fetch_google_client_id")
self.assertEquals(400, resp.status_code, self.assertEquals(400, resp.status_code,
msg="Expected 400, received %d for GET /api/v1/fetch_google_client_id" % resp.status_code, msg="Expected 400, received %d for GET /api/v1/fetch_google_client_id" % resp.status_code,
) )
data = ujson.loads(resp.content) data = ujson.loads(resp.content)
self.assertEqual('error', data['result']) self.assertEqual('error', data['result'])
@ -122,7 +122,7 @@ class PublicURLTest(ZulipTestCase):
resp = self.client_get("/api/v1/fetch_google_client_id") resp = self.client_get("/api/v1/fetch_google_client_id")
self.assertEquals(200, resp.status_code, self.assertEquals(200, resp.status_code,
msg="Expected 200, received %d for GET /api/v1/fetch_google_client_id" % resp.status_code, msg="Expected 200, received %d for GET /api/v1/fetch_google_client_id" % resp.status_code,
) )
data = ujson.loads(resp.content) data = ujson.loads(resp.content)
self.assertEqual('success', data['result']) self.assertEqual('success', data['result'])
self.assertEqual('ABCD', data['google_client_id']) self.assertEqual('ABCD', data['google_client_id'])

View File

@ -1828,7 +1828,7 @@ class SubscriptionAPITest(ZulipTestCase):
self.assertEqual(str(subscription), self.assertEqual(str(subscription),
u'<Subscription: ' u'<Subscription: '
'<UserProfile: iago@zulip.com <Realm: zulip.com 1>> -> recip>' '<UserProfile: iago@zulip.com <Realm: zulip.com 1>> -> recip>'
) )
self.assertTrue(subscription.desktop_notifications) self.assertTrue(subscription.desktop_notifications)
self.assertTrue(subscription.audible_notifications) self.assertTrue(subscription.audible_notifications)

View File

@ -802,7 +802,7 @@ class BotTest(ZulipTestCase):
default_events_register_stream=None, default_events_register_stream=None,
default_all_public_streams=False, default_all_public_streams=False,
owner='hamlet@zulip.com', owner='hamlet@zulip.com',
) )
), ),
event['event'] event['event']
) )
@ -956,7 +956,7 @@ class BotTest(ZulipTestCase):
default_events_register_stream=None, default_events_register_stream=None,
default_all_public_streams=False, default_all_public_streams=False,
owner='hamlet@zulip.com', owner='hamlet@zulip.com',
) )
), ),
event['event'] event['event']
) )
@ -1019,7 +1019,7 @@ class BotTest(ZulipTestCase):
default_events_register_stream='Denmark', default_events_register_stream='Denmark',
default_all_public_streams=False, default_all_public_streams=False,
owner='hamlet@zulip.com', owner='hamlet@zulip.com',
) )
), ),
event['event'] event['event']
) )

View File

@ -13,7 +13,7 @@ def create_tornado_application():
urls = (r"/notify_tornado", urls = (r"/notify_tornado",
r"/json/events", r"/json/events",
r"/api/v1/events", r"/api/v1/events",
) )
# Application is an instance of Django's standard wsgi handler. # Application is an instance of Django's standard wsgi handler.
return tornado.web.Application([(url, AsyncDjangoHandler) for url in urls] return tornado.web.Application([(url, AsyncDjangoHandler) for url in urls]

View File

@ -273,7 +273,7 @@ def accounts_register(request):
'creating_new_team': realm_creation, 'creating_new_team': realm_creation,
'realms_have_subdomains': settings.REALMS_HAVE_SUBDOMAINS, 'realms_have_subdomains': settings.REALMS_HAVE_SUBDOMAINS,
'password_auth_enabled': password_auth_enabled(realm), 'password_auth_enabled': password_auth_enabled(realm),
}, },
request=request) request=request)
@zulip_login_required @zulip_login_required

View File

@ -434,7 +434,7 @@ def api_get_auth_backends(request):
return json_success({"password": password_auth_enabled(None), return json_success({"password": password_auth_enabled(None),
"dev": dev_auth_enabled(), "dev": dev_auth_enabled(),
"google": google_auth_enabled(), "google": google_auth_enabled(),
}) })
@authenticated_json_post_view @authenticated_json_post_view
@has_request_variables @has_request_variables

View File

@ -378,7 +378,7 @@ def add_subscriptions_backend(request, user_profile,
" **invite-only**" if private_streams[subscriptions[0]] else "", " **invite-only**" if private_streams[subscriptions[0]] else "",
subscriptions[0], subscriptions[0],
stream_link(subscriptions[0]), stream_link(subscriptions[0]),
)) ))
else: else:
msg = ("Hi there! We thought you'd like to know that %s just " msg = ("Hi there! We thought you'd like to know that %s just "
"subscribed you to the following streams: \n\n" "subscribed you to the following streams: \n\n"

View File

@ -73,7 +73,7 @@ i18n_urls = [
'template_name': 'zerver/reset.html', 'template_name': 'zerver/reset.html',
'email_template_name': 'registration/password_reset_email.txt', 'email_template_name': 'registration/password_reset_email.txt',
'password_reset_form': zerver.forms.ZulipPasswordResetForm, 'password_reset_form': zerver.forms.ZulipPasswordResetForm,
}, name='django.contrib.auth.views.password_reset'), }, name='django.contrib.auth.views.password_reset'),
url(r'^accounts/password/reset/done/$', password_reset_done, url(r'^accounts/password/reset/done/$', password_reset_done,
{'template_name': 'zerver/reset_emailed.html'}), {'template_name': 'zerver/reset_emailed.html'}),
url(r'^accounts/password/reset/(?P<uidb64>[0-9A-Za-z]+)/(?P<token>.+)/$', url(r'^accounts/password/reset/(?P<uidb64>[0-9A-Za-z]+)/(?P<token>.+)/$',