pep8: Fix E129 violations
This commit is contained in:
parent
dc48a41efe
commit
47488217b1
|
@ -67,7 +67,7 @@ def zulip_to_jid(email, jabber_domain):
|
|||
jid = JID(email, domain=jabber_domain)
|
||||
if (options.zulip_email_suffix
|
||||
and options.zulip_email_suffix in jid.username
|
||||
and not jid.username.endswith("-bot")):
|
||||
and not jid.username.endswith("-bot")):
|
||||
jid.username = jid.username.rpartition(options.zulip_email_suffix)[0]
|
||||
return jid
|
||||
|
||||
|
@ -384,7 +384,7 @@ option does not affect login credentials.'''.replace("\n", " "))
|
|||
for option in ("jid", "jabber_password", "conference_domain", "mode", "zulip_email_suffix",
|
||||
"jabber_server_address", "jabber_server_port"):
|
||||
if (getattr(options, option) is None
|
||||
and config.has_option("jabber_mirror", option)):
|
||||
and config.has_option("jabber_mirror", option)):
|
||||
setattr(options, option, config.get("jabber_mirror", option))
|
||||
|
||||
for option in ("no_use_tls",):
|
||||
|
|
|
@ -100,7 +100,7 @@ def unwrap_lines(body):
|
|||
for line in lines[1:]:
|
||||
line = line.rstrip()
|
||||
if (re.match(r'^\W', line, flags=re.UNICODE)
|
||||
and re.match(r'^\W', previous_line, flags=re.UNICODE)):
|
||||
and re.match(r'^\W', previous_line, flags=re.UNICODE)):
|
||||
result += previous_line + "\n"
|
||||
elif (line == "" or
|
||||
previous_line == "" or
|
||||
|
@ -205,7 +205,7 @@ def update_subscriptions():
|
|||
for stream in public_streams:
|
||||
zephyr_class = stream.encode("utf-8")
|
||||
if (options.shard is not None and
|
||||
not hashlib.sha1(zephyr_class).hexdigest().startswith(options.shard)):
|
||||
not hashlib.sha1(zephyr_class).hexdigest().startswith(options.shard)):
|
||||
# This stream is being handled by a different zephyr_mirror job.
|
||||
continue
|
||||
if zephyr_class in current_zephyr_subs:
|
||||
|
@ -369,7 +369,7 @@ def process_notice(notice, log):
|
|||
logger.debug("Skipping message we got from Zulip!")
|
||||
return
|
||||
if (zephyr_class == "mail" and notice.instance.lower() == "inbox" and is_personal and
|
||||
not options.forward_mail_zephyrs):
|
||||
not options.forward_mail_zephyrs):
|
||||
# Only forward mail zephyrs if forwarding them is enabled.
|
||||
return
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ def send_bot_message(oldrev, newrev, refname):
|
|||
old_head = oldrev[:12]
|
||||
|
||||
if (oldrev == '0000000000000000000000000000000000000000' or
|
||||
newrev == '0000000000000000000000000000000000000000'):
|
||||
newrev == '0000000000000000000000000000000000000000'):
|
||||
# New branch pushed or old branch removed
|
||||
added = ''
|
||||
removed = ''
|
||||
|
|
|
@ -81,7 +81,7 @@ class CountingBackoff(object):
|
|||
# type: () -> None
|
||||
if (self.timeout_success_equivalent is not None
|
||||
and self.last_attempt_time != 0
|
||||
and time.time() - self.last_attempt_time > self.timeout_success_equivalent):
|
||||
and time.time() - self.last_attempt_time > self.timeout_success_equivalent):
|
||||
self.number_of_retries = 0
|
||||
|
||||
class RandomExponentialBackoff(CountingBackoff):
|
||||
|
@ -171,7 +171,7 @@ def get_default_config_filename():
|
|||
# type: () -> str
|
||||
config_file = os.path.join(os.environ["HOME"], ".zuliprc")
|
||||
if (not os.path.exists(config_file) and
|
||||
os.path.exists(os.path.join(os.environ["HOME"], ".humbugrc"))):
|
||||
os.path.exists(os.path.join(os.environ["HOME"], ".humbugrc"))):
|
||||
raise RuntimeError("The Zulip API configuration file is now ~/.zuliprc; please run:\n\n"
|
||||
" mv ~/.humbugrc ~/.zuliprc\n")
|
||||
return config_file
|
||||
|
@ -366,7 +366,7 @@ class Client(object):
|
|||
# want the later exception handlers to deal with any
|
||||
# non-timeout other SSLErrors
|
||||
if (isinstance(e, requests.exceptions.SSLError) and
|
||||
str(e) != "The read operation timed out"):
|
||||
str(e) != "The read operation timed out"):
|
||||
raise
|
||||
if longpolling:
|
||||
# When longpolling, we expect the timeout to fire,
|
||||
|
|
Loading…
Reference in a new issue