From b2b1acd4153c417a30e1fea092a34a512e196001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sun, 9 Apr 2023 19:03:24 +0200 Subject: [PATCH] Fix python3 indentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Andriot --- amarok/src/scripts/common/Publisher.py | 40 ++++++++++++-------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/amarok/src/scripts/common/Publisher.py b/amarok/src/scripts/common/Publisher.py index 06f28e59..9d16f29b 100644 --- a/amarok/src/scripts/common/Publisher.py +++ b/amarok/src/scripts/common/Publisher.py @@ -18,7 +18,7 @@ from string import split publisher = None # SIGTERM handler must be able to reach this class Publisher: - + active = False zeroconf = None localip = None @@ -26,31 +26,29 @@ class Publisher: def services(self): # override this to provide list of services to register return [] - - def run(self): - + + def run(self): self.localhostname = split(socket.gethostname(),'.')[0]+'.local.' - try: - self.localip = socket.gethostbyname(self.localhostname) - self.zeroconf = Zeroconf.Zeroconf(self.localip) - except: - return - self.active = True + try: + self.localip = socket.gethostbyname(self.localhostname) + self.zeroconf = Zeroconf.Zeroconf(self.localip) + except: + return + + self.active = True toRegister = self.services() for i in toRegister: service = Zeroconf.ServiceInfo( - i["type"]+".local.", - i["name"]+"."+i["type"]+".local.", - socket.inet_aton(self.localip), - i["port"], - 0, - 0, - i["properties"], - self.localhostname) - self.zeroconf.registerService(service) + i["type"]+".local.", + i["name"]+"."+i["type"]+".local.", + socket.inet_aton(self.localip), + i["port"], + 0, + 0, + i["properties"], + self.localhostname) + self.zeroconf.registerService(service) def shutdown(self): if self.active: self.zeroconf.close() - -