From cb693093075d43d8e84e09c4bf0571bedf3a66cc Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Tue, 10 Dec 2024 20:28:00 +0300 Subject: [PATCH] [+] update repo 1. add asyncio.handle_task_result; 2. improve pass_ssh_osx; 3. update vpn dependency; --- deps/com.github.aiortc.aiortc | 2 +- python/online/fxreader/pr34/commands.py | 4 ++-- .../online/fxreader/pr34/commands_typed/asyncio.py | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 python/online/fxreader/pr34/commands_typed/asyncio.py diff --git a/deps/com.github.aiortc.aiortc b/deps/com.github.aiortc.aiortc index 1c8f054..53fcbd8 160000 --- a/deps/com.github.aiortc.aiortc +++ b/deps/com.github.aiortc.aiortc @@ -1 +1 @@ -Subproject commit 1c8f054d29bfa9dae897f6101f95e8eb4f920305 +Subproject commit 53fcbd80363b2eb93b520babeecb8b0f736d3dbf diff --git a/python/online/fxreader/pr34/commands.py b/python/online/fxreader/pr34/commands.py index 7364cc7..dfc8be0 100644 --- a/python/online/fxreader/pr34/commands.py +++ b/python/online/fxreader/pr34/commands.py @@ -1637,9 +1637,9 @@ def pass_ssh_osx(argv): clipboard_set('') print('\rcleared cliboard\n', end='') elif options.mode is pass_ssh_osx_t.kwargs_t.Mode.qrcode: - assert subprocess.check_call(r''' + assert subprocess.run(r''' qrencode -t PNG -o - | feh - - ''', stdin=password, shell=True) == 0 + ''', input=password.encode('utf-8'), shell=True).returncode == 0 else: raise NotImplementedError diff --git a/python/online/fxreader/pr34/commands_typed/asyncio.py b/python/online/fxreader/pr34/commands_typed/asyncio.py new file mode 100644 index 0000000..b69718f --- /dev/null +++ b/python/online/fxreader/pr34/commands_typed/asyncio.py @@ -0,0 +1,14 @@ +import logging +import asyncio + +from typing import (Any,) + +logger = logging.getLogger(__name__) + +def handle_task_result(fut: asyncio.Future[Any]) -> None: + try: + fut.result() + + logger.debug(dict(fut=fut, msg='done'), stacklevel=2,) + except: + logger.exception('', stacklevel=2,)