From f652043c3a193ac2c366692d3b17fea808350554 Mon Sep 17 00:00:00 2001 From: Stefan Gmeiner Date: Thu, 5 Dec 2024 19:52:25 +0100 Subject: [PATCH] Fixed mypy Errors --- pykoplenti/cli.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pykoplenti/cli.py b/pykoplenti/cli.py index b8b0d00..9677802 100644 --- a/pykoplenti/cli.py +++ b/pykoplenti/cli.py @@ -59,7 +59,7 @@ async def prepare_client(self, key: Optional[str], service_code: Optional[str]): session_id = self._session_cache.read_session_id() if session_id is not None: self.client.session_id = session_id - print_formatted_text("Trying to reuse existing session... ", end=None) + print_formatted_text("Trying to reuse existing session... ", end="") me = await self.client.get_me() if me.is_authenticated: print_formatted_text("Success") @@ -68,8 +68,9 @@ async def prepare_client(self, key: Optional[str], service_code: Optional[str]): print_formatted_text("Failed") if key is not None: - print_formatted_text("Logging in... ", end=None) + print_formatted_text("Logging in... ", end="") await self.client.login(key=key, service_code=service_code) + assert self.client.session_id is not None self._session_cache.write_session_id(self.client.session_id) print_formatted_text("Success") else: @@ -80,7 +81,7 @@ def print_exception(self): print_formatted_text(traceback.format_exc()) async def run(self, key: Optional[str], service_code: Optional[str]): - session = PromptSession() + session = PromptSession[str]() print_formatted_text(flush=True) # Initialize output # Test commands: