mirror of
https://github.com/matrix-org/pantalaimon.git
synced 2024-10-01 03:35:38 -04:00
pantalaimon: Mypy fixes.
This commit is contained in:
parent
5b58294a95
commit
c7ca5d9851
@ -51,9 +51,9 @@ def parse_address(value):
|
||||
return ip_address(value)
|
||||
|
||||
|
||||
def parse_url(value):
|
||||
def parse_url(v):
|
||||
# type: (str) -> ParseResult
|
||||
value = urlparse(value)
|
||||
value = urlparse(v)
|
||||
|
||||
if value.scheme not in ('http', 'https'):
|
||||
raise ValueError(f"Invalid URL scheme {value.scheme}. "
|
||||
|
@ -390,7 +390,7 @@ class ProxyDaemon:
|
||||
self,
|
||||
request, # type: aiohttp.web.BaseRequest
|
||||
params=None, # type: CIMultiDict
|
||||
data=None, # type: Dict[Any, Any]
|
||||
data=None, # type: bytes
|
||||
session=None, # type: aiohttp.ClientSession
|
||||
token=None # type: str
|
||||
):
|
||||
|
@ -36,7 +36,8 @@ class Searcher:
|
||||
self.room_field = room_field
|
||||
self.timestamp_field = timestamp_field
|
||||
|
||||
def search(self, search_term, room=None, max_results=10, order_by_date=False):
|
||||
def search(self, search_term, room=None, max_results=10,
|
||||
order_by_date=False):
|
||||
# type (str, str, int, bool) -> List[int, int]
|
||||
"""Search for events in the index.
|
||||
|
||||
|
@ -123,7 +123,7 @@ async def message_router(receive_queue, send_queue, proxies):
|
||||
"connect to pantalaimon.")
|
||||
|
||||
)
|
||||
@click.version_option(version=0.1, prog_name="pantalaimon")
|
||||
@click.version_option(version="0.1", prog_name="pantalaimon")
|
||||
@click.option("--log-level", type=click.Choice([
|
||||
"error",
|
||||
"warning",
|
||||
|
@ -659,7 +659,7 @@ class PanCtl:
|
||||
help=("panctl is a small interactive repl to introspect and control"
|
||||
"the pantalaimon daemon.")
|
||||
)
|
||||
@click.version_option(version=0.1, prog_name="panctl")
|
||||
@click.version_option(version="0.1", prog_name="panctl")
|
||||
def main():
|
||||
loop = asyncio.get_event_loop()
|
||||
glib_loop = GLib.MainLoop()
|
||||
|
@ -184,8 +184,6 @@ class PanStore:
|
||||
profile=profile_id
|
||||
).on_conflict_ignore().execute()
|
||||
|
||||
# TODO why do we get a 0 on conflict here, the test show that we get the
|
||||
# existing event id.
|
||||
if event_id <= 0:
|
||||
return None
|
||||
|
||||
@ -207,7 +205,7 @@ class PanStore:
|
||||
column, # type: List[int]
|
||||
include_profile=False # type: bool
|
||||
):
|
||||
# type: (...) -> Union[List[Dict[Any, Any]], List[Tuple[Dict, Dict]]]
|
||||
# type: (...) -> Optional[Dict]
|
||||
server = Servers.get(name=server)
|
||||
user = ServerUsers.get(server=server, user_id=pan_user)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user