From d46cf59b0da642072f3176ac220f24ed8df0136e Mon Sep 17 00:00:00 2001 From: Aditya Bansal Date: Sun, 9 Jul 2017 05:39:29 +0530 Subject: [PATCH] pep8: Add compliance with rule E261 to worker/queue_processors.py. --- tools/linter_lib/pep8.py | 1 - zerver/worker/queue_processors.py | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tools/linter_lib/pep8.py b/tools/linter_lib/pep8.py index e41af00eb0..5c5c071920 100644 --- a/tools/linter_lib/pep8.py +++ b/tools/linter_lib/pep8.py @@ -88,7 +88,6 @@ def check_pep8(files): 'zerver/tests/test_signup.py', 'zerver/tests/test_subs.py', 'zerver/tests/test_upload.py', - 'zerver/worker/queue_processors.py', 'zilencer/management/commands/populate_db.py', ] diff --git a/zerver/worker/queue_processors.py b/zerver/worker/queue_processors.py index 3aa5f38668..981b0241b5 100644 --- a/zerver/worker/queue_processors.py +++ b/zerver/worker/queue_processors.py @@ -73,7 +73,7 @@ def assign_queue(queue_name, enabled=True, queue_type="consumer"): return clazz return decorate -worker_classes = {} # type: Dict[str, Any] # Any here should be QueueProcessingWorker type +worker_classes = {} # type: Dict[str, Any] # Any here should be QueueProcessingWorker type queues = {} # type: Dict[str, Dict[str, QueueProcessingWorker]] def register_worker(queue_name, clazz, queue_type): # type: (str, QueueProcessingWorker, str) -> None @@ -103,11 +103,11 @@ def check_and_send_restart_signal(): pass class QueueProcessingWorker(object): - queue_name = None # type: str + queue_name = None # type: str def __init__(self): # type: () -> None - self.q = None # type: SimpleQueueClient + self.q = None # type: SimpleQueueClient if self.queue_name is None: raise WorkerDeclarationException("Queue worker declared without queue_name") @@ -232,7 +232,7 @@ class MissedMessageWorker(QueueProcessingWorker): # type: () -> None while True: missed_events = self.q.drain_queue("missedmessage_emails", json=True) - by_recipient = defaultdict(list) # type: Dict[int, List[Dict[str, Any]]] + by_recipient = defaultdict(list) # type: Dict[int, List[Dict[str, Any]]] for event in missed_events: logging.info("Received event: %s" % (event,)) @@ -477,7 +477,7 @@ class EmbeddedBotWorker(QueueProcessingWorker): def get_bot_handler(self, service): # type: (Service) -> Any bot_module_name = 'bots_api.bots.%s.%s' % (service.name, service.name) - bot_module = importlib.import_module(bot_module_name) # type: Any + bot_module = importlib.import_module(bot_module_name) # type: Any return bot_module.handler_class() # TODO: Handle stateful bots properly