diff options
author | nicolargo <nicolas@nicolargo.com> | 2021-06-19 08:34:41 +0200 |
---|---|---|
committer | nicolargo <nicolas@nicolargo.com> | 2021-06-19 08:34:41 +0200 |
commit | 4873f06387f8f803dba58c31567313ce72758160 (patch) | |
tree | 55c8d718d9fdd4091b677298c6d97d2b278cd992 | |
parent | 4522a236b6ddc69089c5902d4b86037cc6854956 (diff) |
Reindent audodiscover.py file
-rw-r--r-- | glances/autodiscover.py | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/glances/autodiscover.py b/glances/autodiscover.py index e4dfdaf6..bf77bd61 100644 --- a/glances/autodiscover.py +++ b/glances/autodiscover.py @@ -2,7 +2,7 @@ # # This file is part of Glances. # -# Copyright (C) 2019 Nicolargo <nicolas@nicolargo.com> +# Copyright (C) 2021 Nicolargo <nicolas@nicolargo.com> # # Glances is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by @@ -211,21 +211,30 @@ class GlancesAutoDiscoverClient(object): # Start the zeroconf service try: self.info = ServiceInfo( - zeroconf_type, '{}:{}.{}'.format( - hostname, args.port, zeroconf_type), - address=socket.inet_pton( - address_family, zeroconf_bind_address), - port=args.port, weight=0, priority=0, properties={}, server=hostname) + zeroconf_type, + '{}:{}.{}'.format(hostname, + args.port, + zeroconf_type), + address=socket.inet_pton(address_family, zeroconf_bind_address), + port=args.port, + weight=0, + priority=0, + properties={}, + server=hostname) except TypeError: # Manage issue 1663 with breaking change on ServiceInfo method # address (only one address) is replaced by addresses (list of addresses) self.info = ServiceInfo( - zeroconf_type, '{}:{}.{}'.format( - hostname, args.port, zeroconf_type), - addresses=[socket.inet_pton( - address_family, zeroconf_bind_address)], - port=args.port, weight=0, priority=0, properties={}, server=hostname) - + zeroconf_type, + '{}:{}.{}'.format(hostname, + args.port, + zeroconf_type), + addresses=[socket.inet_pton(address_family, zeroconf_bind_address)], + port=args.port, + weight=0, + priority=0, + properties={}, + server=hostname) try: self.zeroconf.register_service(self.info) except socket.error as e: |