diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2022-06-28 03:22:30 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2022-06-30 03:47:49 +0300 |
commit | 8f20c9b825cabab7a3f0f5dd2cfe000cc7f72c28 (patch) | |
tree | b5d7446e7b2fcfd42b1e5029aeef33ecb5f9715f /src/home/util.py | |
parent | ee09bc98aedfc6a65a5026432b399345a30a39c8 (diff) |
polaris pwk 1725cgld full support
- significant improvements, correctnesses and stability fixes in
protocol implementation
- correct handling of device appearances and disappearances
- flawlessly functioning telegram bot that re-renders kettle's state
(temperature and other) in real time
Diffstat (limited to 'src/home/util.py')
-rw-r--r-- | src/home/util.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/home/util.py b/src/home/util.py index 9dd84f6..5050ebb 100644 --- a/src/home/util.py +++ b/src/home/util.py @@ -9,7 +9,7 @@ import random from enum import Enum from datetime import datetime -from typing import Tuple, Optional +from typing import Tuple, Optional, List Addr = Tuple[str, int] # network address type (host, port) @@ -96,7 +96,7 @@ def send_datagram(message: str, addr: Addr) -> None: sock.sendto(message.encode(), addr) -def format_tb(exc) -> Optional[list[str]]: +def format_tb(exc) -> Optional[List[str]]: tb = traceback.format_tb(exc.__traceback__) if not tb: return None @@ -120,7 +120,7 @@ class ChildProcessInfo: self.cmd = cmd -def find_child_processes(ppid: int) -> list[ChildProcessInfo]: +def find_child_processes(ppid: int) -> List[ChildProcessInfo]: p = subprocess.run(['pgrep', '-P', str(ppid), '--list-full'], capture_output=True) if p.returncode != 0: raise OSError(f'pgrep returned {p.returncode}') |