mirror of https://github.com/zulip/zulip.git
pep8: Fix E111 violations
This commit is contained in:
parent
f7582f0050
commit
c23f9e0df7
|
@ -98,10 +98,10 @@ try:
|
||||||
access_token_key = config.get('twitter', 'access_token_key')
|
access_token_key = config.get('twitter', 'access_token_key')
|
||||||
access_token_secret = config.get('twitter', 'access_token_secret')
|
access_token_secret = config.get('twitter', 'access_token_secret')
|
||||||
except (six.moves.configparser.NoSectionError, six.moves.configparser.NoOptionError):
|
except (six.moves.configparser.NoSectionError, six.moves.configparser.NoOptionError):
|
||||||
parser.error("Please provide a ~/.zulip_twitterrc")
|
parser.error("Please provide a ~/.zulip_twitterrc")
|
||||||
|
|
||||||
if not consumer_key or not consumer_secret or not access_token_key or not access_token_secret:
|
if not consumer_key or not consumer_secret or not access_token_key or not access_token_secret:
|
||||||
parser.error("Please provide a ~/.zulip_twitterrc")
|
parser.error("Please provide a ~/.zulip_twitterrc")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import twitter
|
import twitter
|
||||||
|
|
|
@ -119,10 +119,10 @@ try:
|
||||||
access_token_key = config.get('twitter', 'access_token_key')
|
access_token_key = config.get('twitter', 'access_token_key')
|
||||||
access_token_secret = config.get('twitter', 'access_token_secret')
|
access_token_secret = config.get('twitter', 'access_token_secret')
|
||||||
except (six.moves.configparser.NoSectionError, six.moves.configparser.NoOptionError):
|
except (six.moves.configparser.NoSectionError, six.moves.configparser.NoOptionError):
|
||||||
parser.error("Please provide a ~/.zulip_twitterrc")
|
parser.error("Please provide a ~/.zulip_twitterrc")
|
||||||
|
|
||||||
if not (consumer_key and consumer_secret and access_token_key and access_token_secret):
|
if not (consumer_key and consumer_secret and access_token_key and access_token_secret):
|
||||||
parser.error("Please provide a ~/.zulip_twitterrc")
|
parser.error("Please provide a ~/.zulip_twitterrc")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
since_id = config.getint('search', 'since_id')
|
since_id = config.getint('search', 'since_id')
|
||||||
|
|
|
@ -221,7 +221,7 @@ class Client(object):
|
||||||
site = site.rstrip("/")
|
site = site.rstrip("/")
|
||||||
self.base_url = site
|
self.base_url = site
|
||||||
else:
|
else:
|
||||||
raise RuntimeError("Missing Zulip server URL; specify via --site or ~/.zuliprc.")
|
raise RuntimeError("Missing Zulip server URL; specify via --site or ~/.zuliprc.")
|
||||||
|
|
||||||
if not self.base_url.endswith("/api"):
|
if not self.base_url.endswith("/api"):
|
||||||
self.base_url += "/api"
|
self.base_url += "/api"
|
||||||
|
|
|
@ -58,7 +58,7 @@ subprocess.check_call([os.path.join(deploy_path, "scripts", "lib", "create-produ
|
||||||
deploy_path])
|
deploy_path])
|
||||||
|
|
||||||
if os.path.exists("/etc/supervisor/conf.d/zulip_db.conf"):
|
if os.path.exists("/etc/supervisor/conf.d/zulip_db.conf"):
|
||||||
subprocess.check_call(["supervisorctl", "stop", "process-fts-updates"], preexec_fn=su_to_zulip)
|
subprocess.check_call(["supervisorctl", "stop", "process-fts-updates"], preexec_fn=su_to_zulip)
|
||||||
|
|
||||||
if not (args.skip_puppet and args.skip_migrations):
|
if not (args.skip_puppet and args.skip_migrations):
|
||||||
# If we're running either puppet or migrations, we shut the server down for the duration
|
# If we're running either puppet or migrations, we shut the server down for the duration
|
||||||
|
@ -90,7 +90,7 @@ logging.info("Restarting Zulip...")
|
||||||
subprocess.check_output(["./scripts/restart-server"], preexec_fn=su_to_zulip)
|
subprocess.check_output(["./scripts/restart-server"], preexec_fn=su_to_zulip)
|
||||||
|
|
||||||
if os.path.exists("/etc/supervisor/conf.d/zulip_db.conf"):
|
if os.path.exists("/etc/supervisor/conf.d/zulip_db.conf"):
|
||||||
subprocess.check_call(["supervisorctl", "start", "process-fts-updates"], preexec_fn=su_to_zulip)
|
subprocess.check_call(["supervisorctl", "start", "process-fts-updates"], preexec_fn=su_to_zulip)
|
||||||
|
|
||||||
logging.info("Upgrade complete!")
|
logging.info("Upgrade complete!")
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ def check_pep8(files):
|
||||||
ignored_rules = [
|
ignored_rules = [
|
||||||
'E402', 'E501', 'W503', 'E711', 'E201', 'E203', 'E202', 'E128', 'E226',
|
'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', 'E731', 'E302', 'E129',
|
||||||
'E741', 'E714', 'W391', 'E713', 'E502', 'E131', 'E305', 'E251', 'E306',
|
'E741', 'E714', 'W391', 'E713', 'E502', 'E131', 'E305', 'E251', 'E306',
|
||||||
]
|
]
|
||||||
pep8 = subprocess.Popen(
|
pep8 = subprocess.Popen(
|
||||||
|
|
|
@ -147,7 +147,7 @@ def get_client_name(request, is_json_view):
|
||||||
if is_json_view:
|
if is_json_view:
|
||||||
return "website"
|
return "website"
|
||||||
else:
|
else:
|
||||||
return "Unspecified"
|
return "Unspecified"
|
||||||
|
|
||||||
def process_client(request, user_profile, is_json_view=False, client_name=None):
|
def process_client(request, user_profile, is_json_view=False, client_name=None):
|
||||||
# type: (HttpRequest, UserProfile, bool, Optional[text_type]) -> None
|
# type: (HttpRequest, UserProfile, bool, Optional[text_type]) -> None
|
||||||
|
|
|
@ -369,7 +369,7 @@ def notify_created_bot(user_profile):
|
||||||
default_all_public_streams=user_profile.default_all_public_streams,
|
default_all_public_streams=user_profile.default_all_public_streams,
|
||||||
avatar_url=avatar_url(user_profile),
|
avatar_url=avatar_url(user_profile),
|
||||||
owner=user_profile.bot_owner.email,
|
owner=user_profile.bot_owner.email,
|
||||||
))
|
))
|
||||||
send_event(event, bot_owner_userids(user_profile))
|
send_event(event, bot_owner_userids(user_profile))
|
||||||
|
|
||||||
def do_create_user(email, password, realm, full_name, short_name,
|
def do_create_user(email, password, realm, full_name, short_name,
|
||||||
|
|
|
@ -138,7 +138,7 @@ def fetch_tweet_data(tweet_id):
|
||||||
'access_token_secret': settings.TWITTER_ACCESS_TOKEN_SECRET,
|
'access_token_secret': settings.TWITTER_ACCESS_TOKEN_SECRET,
|
||||||
}
|
}
|
||||||
if not all(creds.values()):
|
if not all(creds.values()):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
api = twitter.Api(**creds)
|
api = twitter.Api(**creds)
|
||||||
|
|
|
@ -405,7 +405,7 @@ class StreamMessagesTest(ZulipTestCase):
|
||||||
# Did all of the subscribers get the message?
|
# Did all of the subscribers get the message?
|
||||||
new_subscriber_messages = []
|
new_subscriber_messages = []
|
||||||
for subscriber in subscribers:
|
for subscriber in subscribers:
|
||||||
new_subscriber_messages.append(message_stream_count(subscriber))
|
new_subscriber_messages.append(message_stream_count(subscriber))
|
||||||
|
|
||||||
# Did non-subscribers not get the message?
|
# Did non-subscribers not get the message?
|
||||||
new_non_subscriber_messages = []
|
new_non_subscriber_messages = []
|
||||||
|
|
|
@ -381,7 +381,7 @@ def create_realm(request, creation_key=None):
|
||||||
email = form.cleaned_data['email']
|
email = form.cleaned_data['email']
|
||||||
confirmation_key = send_registration_completion_email(email, request, realm_creation=True).confirmation_key
|
confirmation_key = send_registration_completion_email(email, request, realm_creation=True).confirmation_key
|
||||||
if settings.DEVELOPMENT:
|
if settings.DEVELOPMENT:
|
||||||
request.session['confirmation_key'] = {'confirmation_key': confirmation_key}
|
request.session['confirmation_key'] = {'confirmation_key': confirmation_key}
|
||||||
if (creation_key is not None and check_key_is_valid(creation_key)):
|
if (creation_key is not None and check_key_is_valid(creation_key)):
|
||||||
RealmCreationKey.objects.get(creation_key=creation_key).delete()
|
RealmCreationKey.objects.get(creation_key=creation_key).delete()
|
||||||
return HttpResponseRedirect(reverse('send_confirm', kwargs={'email': email}))
|
return HttpResponseRedirect(reverse('send_confirm', kwargs={'email': email}))
|
||||||
|
|
Loading…
Reference in New Issue