diff options
author | Devaev Maxim <[email protected]> | 2018-07-10 03:17:33 +0000 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-07-10 03:17:33 +0000 |
commit | db56bf90db213f994dc3c433638dc497ead94096 (patch) | |
tree | be215256aaeb0747726ae37e83a90f41b44173c6 | |
parent | 646d2cd996f8f07bceaa03a81157edda5a4bf4f0 (diff) |
refactoring
-rw-r--r-- | kvmd/kvmd/atx.py | 1 | ||||
-rw-r--r-- | kvmd/kvmd/keyboard.py | 8 | ||||
-rw-r--r-- | kvmd/kvmd/server.py | 4 | ||||
-rw-r--r-- | kvmd/kvmd/streamer.py | 3 |
4 files changed, 15 insertions, 1 deletions
diff --git a/kvmd/kvmd/atx.py b/kvmd/kvmd/atx.py index cbf8b34b..87a4d3ae 100644 --- a/kvmd/kvmd/atx.py +++ b/kvmd/kvmd/atx.py @@ -13,6 +13,7 @@ class Atx: self, power_led: int, hdd_led: int, + power_switch: int, reset_switch: int, click_delay: float, diff --git a/kvmd/kvmd/keyboard.py b/kvmd/kvmd/keyboard.py index 516a7baa..f8307d32 100644 --- a/kvmd/kvmd/keyboard.py +++ b/kvmd/kvmd/keyboard.py @@ -79,7 +79,13 @@ def _key_event_to_ps2_codes(event: _KeyEvent) -> List[int]: class Keyboard(multiprocessing.Process): # http://dkudrow.blogspot.com/2013/08/ps2-keyboard-emulation-with-arduino-uno.html - def __init__(self, clock: int, data: int, pulse: float) -> None: + def __init__( + self, + clock: int, + data: int, + pulse: float, + ) -> None: + super().__init__(daemon=True) self.__clock = gpio.set_output(clock, initial=True) diff --git a/kvmd/kvmd/server.py b/kvmd/kvmd/server.py index 34350507..ed26ec1b 100644 --- a/kvmd/kvmd/server.py +++ b/kvmd/kvmd/server.py @@ -70,10 +70,12 @@ class Server: # pylint: disable=too-many-instance-attributes atx: Atx, msd: MassStorageDevice, streamer: Streamer, + heartbeat: float, atx_state_poll: float, streamer_shutdown_delay: float, msd_chunk_size: int, + loop: asyncio.AbstractEventLoop, ) -> None: @@ -81,10 +83,12 @@ class Server: # pylint: disable=too-many-instance-attributes self.__atx = atx self.__msd = msd self.__streamer = streamer + self.__heartbeat = heartbeat self.__streamer_shutdown_delay = streamer_shutdown_delay self.__atx_state_poll = atx_state_poll self.__msd_chunk_size = msd_chunk_size + self.__loop = loop self.__sockets: Set[aiohttp.web.WebSocketResponse] = set() diff --git a/kvmd/kvmd/streamer.py b/kvmd/kvmd/streamer.py index 14bf8159..941519ab 100644 --- a/kvmd/kvmd/streamer.py +++ b/kvmd/kvmd/streamer.py @@ -18,9 +18,11 @@ class Streamer: # pylint: disable=too-many-instance-attributes conv_power: int, sync_delay: float, init_delay: float, + width: int, height: int, cmd: List[str], + loop: asyncio.AbstractEventLoop, ) -> None: @@ -28,6 +30,7 @@ class Streamer: # pylint: disable=too-many-instance-attributes self.__conv_power = (gpio.set_output(conv_power) if conv_power > 0 else conv_power) self.__sync_delay = sync_delay self.__init_delay = init_delay + self.__width = width self.__height = height self.__cmd = cmd |