From 1ae8ac85d809e3685ca66c8b934188af73cf70dd Mon Sep 17 00:00:00 2001 From: Rafid Aslam Date: Tue, 29 Nov 2016 13:22:02 +0700 Subject: [PATCH] pep8: Fix E301 pep8 violations. Fix "E301: expected (1 or 2) blank line" pep8 violations. --- bots/irc-mirror.py | 1 + bots/zephyr_mirror.py | 1 + integrations/perforce/git_p4.py | 2 ++ zulip/__init__.py | 2 ++ 4 files changed, 6 insertions(+) diff --git a/bots/irc-mirror.py b/bots/irc-mirror.py index f9af690..5185b91 100755 --- a/bots/irc-mirror.py +++ b/bots/irc-mirror.py @@ -35,6 +35,7 @@ class IRCBot(irc.bot.SingleServerIRCBot): def on_welcome(self, c, e): # type: (ServerConnection, Event) -> None c.join(self.channel) + def forward_to_irc(msg): # type: (Dict[str, Any]) -> None if msg["type"] == "stream": diff --git a/bots/zephyr_mirror.py b/bots/zephyr_mirror.py index 38275b5..c1e52b8 100755 --- a/bots/zephyr_mirror.py +++ b/bots/zephyr_mirror.py @@ -62,6 +62,7 @@ if options.forward_class_messages and not options.noshard: from zerver.lib.parallel import run_parallel print("Starting parallel zephyr class mirroring bot") jobs = list("0123456789abcdef") + def run_job(shard): # type: (str) -> int subprocess.call(args + ["--shard=%s" % (shard,)]) diff --git a/integrations/perforce/git_p4.py b/integrations/perforce/git_p4.py index 69b1646..8730aaf 100755 --- a/integrations/perforce/git_p4.py +++ b/integrations/perforce/git_p4.py @@ -39,9 +39,11 @@ except ImportError: """This exception is raised when a process run by check_call() returns a non-zero exit status. The exit status will be stored in the returncode attribute.""" + def __init__(self, returncode, cmd): self.returncode = returncode self.cmd = cmd + def __str__(self): return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode) diff --git a/zulip/__init__.py b/zulip/__init__.py index ff726b8..bcbcccb 100644 --- a/zulip/__init__.py +++ b/zulip/__init__.py @@ -398,6 +398,7 @@ class Client(object): if request is None: request = {} return request + def call(self, *args, **kwargs): request = make_request(*args, **kwargs) if computed_url is not None: @@ -411,6 +412,7 @@ class Client(object): def call_on_each_event(self, callback, event_types=None, narrow=None): if narrow is None: narrow = [] + def do_register(): while True: if event_types is None: