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_secret = config.get('twitter', 'access_token_secret')
|
||||
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:
|
||||
parser.error("Please provide a ~/.zulip_twitterrc")
|
||||
parser.error("Please provide a ~/.zulip_twitterrc")
|
||||
|
||||
try:
|
||||
import twitter
|
||||
|
|
|
@ -119,10 +119,10 @@ try:
|
|||
access_token_key = config.get('twitter', 'access_token_key')
|
||||
access_token_secret = config.get('twitter', 'access_token_secret')
|
||||
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):
|
||||
parser.error("Please provide a ~/.zulip_twitterrc")
|
||||
parser.error("Please provide a ~/.zulip_twitterrc")
|
||||
|
||||
try:
|
||||
since_id = config.getint('search', 'since_id')
|
||||
|
|
|
@ -221,7 +221,7 @@ class Client(object):
|
|||
site = site.rstrip("/")
|
||||
self.base_url = site
|
||||
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"):
|
||||
self.base_url += "/api"
|
||||
|
|
|
@ -58,7 +58,7 @@ subprocess.check_call([os.path.join(deploy_path, "scripts", "lib", "create-produ
|
|||
deploy_path])
|
||||
|
||||
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 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)
|
||||
|
||||
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!")
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ def check_pep8(files):
|
|||
ignored_rules = [
|
||||
'E402', 'E501', 'W503', 'E711', 'E201', 'E203', 'E202', 'E128', 'E226',
|
||||
'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',
|
||||
]
|
||||
pep8 = subprocess.Popen(
|
||||
|
|
|
@ -147,7 +147,7 @@ def get_client_name(request, is_json_view):
|
|||
if is_json_view:
|
||||
return "website"
|
||||
else:
|
||||
return "Unspecified"
|
||||
return "Unspecified"
|
||||
|
||||
def process_client(request, user_profile, is_json_view=False, client_name=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,
|
||||
avatar_url=avatar_url(user_profile),
|
||||
owner=user_profile.bot_owner.email,
|
||||
))
|
||||
))
|
||||
send_event(event, bot_owner_userids(user_profile))
|
||||
|
||||
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,
|
||||
}
|
||||
if not all(creds.values()):
|
||||
return None
|
||||
return None
|
||||
|
||||
try:
|
||||
api = twitter.Api(**creds)
|
||||
|
|
|
@ -405,7 +405,7 @@ class StreamMessagesTest(ZulipTestCase):
|
|||
# Did all of the subscribers get the message?
|
||||
new_subscriber_messages = []
|
||||
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?
|
||||
new_non_subscriber_messages = []
|
||||
|
|
|
@ -381,7 +381,7 @@ def create_realm(request, creation_key=None):
|
|||
email = form.cleaned_data['email']
|
||||
confirmation_key = send_registration_completion_email(email, request, realm_creation=True).confirmation_key
|
||||
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)):
|
||||
RealmCreationKey.objects.get(creation_key=creation_key).delete()
|
||||
return HttpResponseRedirect(reverse('send_confirm', kwargs={'email': email}))
|
||||
|
|
Loading…
Reference in New Issue