From 2e1f4a20bb67cd67031e40a2d7fd26e11bf57296 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Wed, 19 May 2021 11:34:45 +0000 Subject: [PATCH] Format code with yapf This commit fixes the style issues introduced in 5a2f8ee according to the output from yapf. Details: https://deepsource.io/gh/kokarare1212/librespot-python/transform/c73e35c2-ae77-4ca4-ad95-979d1370b03c/ --- librespot/zeroconf/Record.py | 2 -- librespot/zeroconf/Zeroconf.py | 10 +++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/librespot/zeroconf/Record.py b/librespot/zeroconf/Record.py index 91217e7..d03fc3a 100644 --- a/librespot/zeroconf/Record.py +++ b/librespot/zeroconf/Record.py @@ -34,5 +34,3 @@ class Record: start = i + 1 out += bytes([0]) return out, len(name) + 2 - - diff --git a/librespot/zeroconf/Zeroconf.py b/librespot/zeroconf/Zeroconf.py index bb88f44..4392531 100644 --- a/librespot/zeroconf/Zeroconf.py +++ b/librespot/zeroconf/Zeroconf.py @@ -16,9 +16,11 @@ class Zeroconf(Closeable): def __init__(self): try: - self.__BROADCAST4 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + self.__BROADCAST4 = socket.socket(socket.AF_INET, + socket.SOCK_DGRAM) self.__BROADCAST4.connect(("224.0.0.251", 5353)) - self.__BROADCAST6 = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM) + self.__BROADCAST6 = socket.socket(socket.AF_INET6, + socket.SOCK_DGRAM) self.__BROADCAST6.connect(("FF02::FB", 5353)) except Exception as e: pass @@ -29,7 +31,9 @@ class Zeroconf(Closeable): def get_or_create_local_host_name() -> str: host = socket.gethostname() if host == "localhost": - host = base64.b64encode(random.randint(-9223372036854775808, 9223372036854775807)).decode() + ".local" + host = base64.b64encode( + random.randint(-9223372036854775808, + 9223372036854775807)).decode() + ".local" return host def set_use_ipv4(self, ipv4: bool) -> Zeroconf: