From 47488217b17e341f379253903872a330bedee964 Mon Sep 17 00:00:00 2001 From: bulat22101 Date: Sat, 3 Dec 2016 17:19:09 +0000 Subject: [PATCH] pep8: Fix E129 violations --- bots/jabber_mirror_backend.py | 4 ++-- bots/zephyr_mirror_backend.py | 6 +++--- integrations/git/post-receive | 2 +- zulip/__init__.py | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bots/jabber_mirror_backend.py b/bots/jabber_mirror_backend.py index 683783f..36515d5 100755 --- a/bots/jabber_mirror_backend.py +++ b/bots/jabber_mirror_backend.py @@ -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",): diff --git a/bots/zephyr_mirror_backend.py b/bots/zephyr_mirror_backend.py index 7faa9cb..1cceb64 100755 --- a/bots/zephyr_mirror_backend.py +++ b/bots/zephyr_mirror_backend.py @@ -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 diff --git a/integrations/git/post-receive b/integrations/git/post-receive index aac4f14..51296a9 100755 --- a/integrations/git/post-receive +++ b/integrations/git/post-receive @@ -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 = '' diff --git a/zulip/__init__.py b/zulip/__init__.py index c85bba1..8b6ff38 100644 --- a/zulip/__init__.py +++ b/zulip/__init__.py @@ -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,