mirror of https://github.com/zulip/zulip.git
python: Fix errors from pycodestyle 2.6.0.
zerver/lib/i18n.py:34:28: E741 ambiguous variable name 'l' zerver/lib/webhooks/common.py:103:34: E225 missing whitespace around operator zerver/tests/test_queue_worker.py:563:9: E306 expected 1 blank line before a nested definition, found 0 Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
9a9c1e0794
commit
10805abd6e
|
@ -31,9 +31,9 @@ def get_language_list() -> List[Dict[str, Any]]:
|
|||
return languages['name_map']
|
||||
|
||||
def get_language_list_for_templates(default_language: str) -> List[Dict[str, Dict[str, str]]]:
|
||||
language_list = [l for l in get_language_list()
|
||||
if 'percent_translated' not in l or
|
||||
l['percent_translated'] >= 5.]
|
||||
language_list = [lang for lang in get_language_list()
|
||||
if 'percent_translated' not in lang or
|
||||
lang['percent_translated'] >= 5.]
|
||||
|
||||
formatted_list = []
|
||||
lang_len = len(language_list)
|
||||
|
|
|
@ -100,7 +100,7 @@ def standardize_headers(input_headers: Union[None, Dict[str, Any]]) -> Dict[str,
|
|||
|
||||
for raw_header in input_headers:
|
||||
polished_header = raw_header.upper().replace("-", "_")
|
||||
if polished_header not in["CONTENT_TYPE", "CONTENT_LENGTH"]:
|
||||
if polished_header not in ["CONTENT_TYPE", "CONTENT_LENGTH"]:
|
||||
if not polished_header.startswith("HTTP_"):
|
||||
polished_header = "HTTP_" + polished_header
|
||||
canonical_headers[polished_header] = str(input_headers[raw_header])
|
||||
|
|
|
@ -560,6 +560,7 @@ class WorkerTest(ZulipTestCase):
|
|||
self.assertEqual(event["type"], 'unexpected behaviour')
|
||||
|
||||
processed = []
|
||||
|
||||
@queue_processors.assign_queue('unreliable_loopworker')
|
||||
class UnreliableLoopWorker(queue_processors.LoopQueueProcessingWorker):
|
||||
def consume_batch(self, events: List[Dict[str, Any]]) -> None:
|
||||
|
|
Loading…
Reference in New Issue