From 1c2c6b5b94bfe1e34e36202813eed117a928ffe0 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Sat, 15 May 2021 00:02:04 +0000 Subject: [PATCH 1/4] Restyled by black --- librespot/ZeroconfServer.py | 39 +++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/librespot/ZeroconfServer.py b/librespot/ZeroconfServer.py index 36590ba..d0ee0ad 100644 --- a/librespot/ZeroconfServer.py +++ b/librespot/ZeroconfServer.py @@ -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 From 74c1d9d3e8422bdaf791db417d05366686276a91 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Sat, 15 May 2021 00:02:06 +0000 Subject: [PATCH 2/4] Restyled by isort --- librespot/ZeroconfServer.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/librespot/ZeroconfServer.py b/librespot/ZeroconfServer.py index d0ee0ad..353a74c 100644 --- a/librespot/ZeroconfServer.py +++ b/librespot/ZeroconfServer.py @@ -1,13 +1,15 @@ from __future__ import annotations -from librespot.common import Utils -from librespot.core import Session -from librespot.crypto import DiffieHellman -from librespot.standard import Closeable, Runnable -from librespot.proto import Connect + import concurrent.futures import random import socket +from librespot.common import Utils +from librespot.core import Session +from librespot.crypto import DiffieHellman +from librespot.proto import Connect +from librespot.standard import Closeable, Runnable + class ZeroconfServer(Closeable): __MAX_PORT = 65536 From 4aa72c73696b74718727898e7ef2ca1f240092d3 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Sat, 15 May 2021 00:02:10 +0000 Subject: [PATCH 3/4] Restyled by reorder-python-imports --- librespot/ZeroconfServer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/librespot/ZeroconfServer.py b/librespot/ZeroconfServer.py index 353a74c..b691ad2 100644 --- a/librespot/ZeroconfServer.py +++ b/librespot/ZeroconfServer.py @@ -8,7 +8,8 @@ from librespot.common import Utils from librespot.core import Session from librespot.crypto import DiffieHellman from librespot.proto import Connect -from librespot.standard import Closeable, Runnable +from librespot.standard import Closeable +from librespot.standard import Runnable class ZeroconfServer(Closeable): From f81b4bcf53270131a72369ca62723acb6fb94ec8 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Sat, 15 May 2021 00:02:15 +0000 Subject: [PATCH 4/4] Restyled by yapf --- librespot/ZeroconfServer.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/librespot/ZeroconfServer.py b/librespot/ZeroconfServer.py index b691ad2..bb2c6f4 100644 --- a/librespot/ZeroconfServer.py +++ b/librespot/ZeroconfServer.py @@ -19,7 +19,8 @@ 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() @@ -73,15 +74,13 @@ class ZeroconfServer(Closeable): 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() - ) + concurrent.futures.ThreadPoolExecutor()) __shouldStop: bool = False def __init__(self, port: int):