mirror of https://github.com/zulip/zulip.git
zerver/lib/narrow.py: Fix annotations.
This commit is contained in:
parent
95b6e668a7
commit
192663edcf
|
@ -1,7 +1,7 @@
|
||||||
from zerver.lib.request import JsonableError
|
from zerver.lib.request import JsonableError
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
|
|
||||||
from typing import Iterable, Sequence, Callable, Dict
|
from typing import Any, Callable, Iterable, Mapping, Sequence
|
||||||
from six import text_type
|
from six import text_type
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,9 +13,10 @@ def check_supported_events_narrow_filter(narrow):
|
||||||
raise JsonableError(_("Operator %s not supported.") % (operator,))
|
raise JsonableError(_("Operator %s not supported.") % (operator,))
|
||||||
|
|
||||||
def build_narrow_filter(narrow):
|
def build_narrow_filter(narrow):
|
||||||
# type: (Iterable[Sequence[text_type]]) -> Callable[[Dict[text_type, text_type]], bool]
|
# type: (Iterable[Sequence[text_type]]) -> Callable[[Mapping[str, Any]], bool]
|
||||||
check_supported_events_narrow_filter(narrow)
|
check_supported_events_narrow_filter(narrow)
|
||||||
def narrow_filter(event):
|
def narrow_filter(event):
|
||||||
|
# type: (Mapping[str, Any]) -> bool
|
||||||
message = event["message"]
|
message = event["message"]
|
||||||
flags = event["flags"]
|
flags = event["flags"]
|
||||||
for element in narrow:
|
for element in narrow:
|
||||||
|
|
Loading…
Reference in New Issue