refactoring

This commit is contained in:
Devaev Maxim 2018-07-10 03:17:33 +00:00
parent 646d2cd996
commit db56bf90db
4 changed files with 15 additions and 1 deletions

View File

@ -13,6 +13,7 @@ class Atx:
self,
power_led: int,
hdd_led: int,
power_switch: int,
reset_switch: int,
click_delay: float,

View File

@ -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)

View File

@ -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()

View File

@ -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