mypy: Clarify type hints in zulip/integrations/.
This commit is contained in:
parent
357a5e06f3
commit
f81843f189
|
@ -63,7 +63,7 @@ def make_api_call(path):
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"Accept": "application/json"})
|
"Accept": "application/json"})
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
return json.loads(response.text)
|
return json.loads(response.text) # type: ignore # dynamic import
|
||||||
|
|
||||||
if response.status_code >= 500:
|
if response.status_code >= 500:
|
||||||
logging.error(str(response.status_code))
|
logging.error(str(response.status_code))
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
# | other sender| x | | |
|
# | other sender| x | | |
|
||||||
# public mode +-------------+-----+----+--------+----
|
# public mode +-------------+-----+----+--------+----
|
||||||
# | self sender | | | |
|
# | self sender | | | |
|
||||||
from typing import Dict, List, Set
|
from typing import Dict, List, Set, Optional
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import threading
|
import threading
|
||||||
|
@ -216,7 +216,7 @@ class ZulipToJabberBot(object):
|
||||||
def __init__(self, zulip_client):
|
def __init__(self, zulip_client):
|
||||||
# type: (Client) -> None
|
# type: (Client) -> None
|
||||||
self.client = zulip_client
|
self.client = zulip_client
|
||||||
self.jabber = None
|
self.jabber = None # type: Optional[JabberToZulipBot]
|
||||||
|
|
||||||
def set_jabber_client(self, client):
|
def set_jabber_client(self, client):
|
||||||
# type: (JabberToZulipBot) -> None
|
# type: (JabberToZulipBot) -> None
|
||||||
|
|
|
@ -341,7 +341,7 @@ def decrypt_zephyr(zephyr_class, instance, body):
|
||||||
return decrypted
|
return decrypted
|
||||||
|
|
||||||
def process_notice(notice, log):
|
def process_notice(notice, log):
|
||||||
# type: (zulip, Optional[IO[Any]]) -> None
|
# type: (Any, Optional[IO[Any]]) -> None
|
||||||
(zsig, body) = parse_zephyr_body(notice.message, notice.format)
|
(zsig, body) = parse_zephyr_body(notice.message, notice.format)
|
||||||
is_personal = False
|
is_personal = False
|
||||||
is_huddle = False
|
is_huddle = False
|
||||||
|
|
Loading…
Reference in a new issue