Restyled by black

This commit is contained in:
Restyled.io 2021-05-15 00:02:04 +00:00
parent f03c100f06
commit 1c2c6b5b94
1 changed files with 24 additions and 15 deletions

View File

@ -16,8 +16,7 @@ class ZeroconfServer(Closeable):
__keys: DiffieHellman
__inner: ZeroconfServer.Inner
def __init__(self, inner: ZeroconfServer.Inner, listen_port: int,
listen_all: bool):
def __init__(self, inner: ZeroconfServer.Inner, listen_port: int, listen_all: bool):
self.__inner = inner
self.__keys = DiffieHellman()
@ -41,10 +40,16 @@ class ZeroconfServer(Closeable):
def create(self) -> ZeroconfServer:
return ZeroconfServer(
ZeroconfServer.Inner(self.device_type, self.device_name,
self.preferred_locale, self.conf,
self.device_id), self.__listenPort,
self.__listenAll)
ZeroconfServer.Inner(
self.device_type,
self.device_name,
self.preferred_locale,
self.conf,
self.device_id,
),
self.__listenPort,
self.__listenAll,
)
class Inner:
device_type: Connect.DeviceType = None
@ -53,22 +58,26 @@ class ZeroconfServer(Closeable):
preferred_locale: str = None
conf = None
def __init__(self,
device_type: Connect.DeviceType,
device_name: str,
preferred_locale: str,
conf: Session.Configuration,
device_id: str = None):
def __init__(
self,
device_type: Connect.DeviceType,
device_name: str,
preferred_locale: str,
conf: Session.Configuration,
device_id: str = None,
):
self.preferred_locale = preferred_locale
self.conf = conf
self.device_type = device_type
self.device_name = device_name
self.device_id = device_id if device_id is not None else Utils.random_hex_string(
40)
self.device_id = (
device_id if device_id is not None else Utils.random_hex_string(40)
)
class HttpRunner(Runnable, Closeable):
__sock: socket
__executorService: concurrent.futures.ThreadPoolExecutor = concurrent.futures.ThreadPoolExecutor(
__executorService: concurrent.futures.ThreadPoolExecutor = (
concurrent.futures.ThreadPoolExecutor()
)
__shouldStop: bool = False