summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrançois Andriot <francois.andriot@thalesgroup.com>2023-04-09 19:03:24 +0200
committerFrançois Andriot <francois.andriot@thalesgroup.com>2023-04-09 19:51:22 +0200
commitb2b1acd4153c417a30e1fea092a34a512e196001 (patch)
tree4b1d9b8d36f9a25e10a24eca578ce31cc8fc7400
parentcde36fb6b3551be272b25fd105b460995fd7e2c1 (diff)
downloadamarok-b2b1acd4.tar.gz
amarok-b2b1acd4.zip
Fix python3 indentationr14.1.0
Signed-off-by: François Andriot <francois.andriot@thalesgroup.com>
-rw-r--r--amarok/src/scripts/common/Publisher.py40
1 files 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()
-
-