Skip to content

Commit

Permalink
pep8: Add compliance with rule E261 to worker/queue_processors.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
adnrs96 authored and timabbott committed Jul 11, 2017
1 parent 1e3b575 commit d46cf59
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion tools/linter_lib/pep8.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def run_pycodestyle(files, ignored_rules):
'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',
]

Expand Down
10 changes: 5 additions & 5 deletions zerver/worker/queue_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def decorate(clazz):
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
Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -232,7 +232,7 @@ def start(self):
# 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,))
Expand Down Expand Up @@ -477,7 +477,7 @@ def get_bot_api_client(self, user_profile):
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
Expand Down

0 comments on commit d46cf59

Please sign in to comment.