From ed7c869c667013d4a862d2951beb2fc74f3e5274 Mon Sep 17 00:00:00 2001 From: pwt <1089749+pwt@users.noreply.github.com> Date: Fri, 21 Oct 2022 17:50:13 +0100 Subject: [PATCH] Additional warning suppressions for pylint (#927) --- soco/music_services/accounts.py | 2 ++ soco/soap.py | 2 ++ soco/zonegroupstate.py | 24 ++++-------------------- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/soco/music_services/accounts.py b/soco/music_services/accounts.py index e2064daa3..61dff7e04 100644 --- a/soco/music_services/accounts.py +++ b/soco/music_services/accounts.py @@ -75,6 +75,8 @@ def _get_account_xml(soco): device = soco or discovery.any_soco() log.debug("Fetching account data from %s", device) settings_url = "http://{}:1400/status/accounts".format(device.ip_address) + # Remove this as part of PR #925 + # pylint: disable=W3101 result = requests.get(settings_url).content log.debug("Account data: %s", result) return result diff --git a/soco/soap.py b/soco/soap.py index 4c9e47057..1bec9d7f5 100644 --- a/soco/soap.py +++ b/soco/soap.py @@ -287,6 +287,8 @@ def call(self): if _LOG.isEnabledFor(logging.DEBUG): _LOG.debug("Sending %s, %s", headers, prettify(data)) + # Remove this as part of PR #925 + # pylint: disable=W3101 response = requests.post( self.endpoint, headers=headers, diff --git a/soco/zonegroupstate.py b/soco/zonegroupstate.py index 1eebe06a9..770198bc9 100755 --- a/soco/zonegroupstate.py +++ b/soco/zonegroupstate.py @@ -61,25 +61,9 @@ """ import logging -import sys import time -# pylint: disable=I1101 -try: - from lxml import etree as LXML - -except ImportError: - print( - """ - SoCo Error: Import of dependency 'lxml' failed. Please install it. - - Depending on your platform you may also need to install - system libraries 'libxml2' and 'libxslt'. - - Please refer to: https://lxml.de/installation.html for more details. - """ - ) - sys.exit(1) +from lxml import etree as LXML from . import config from .groups import ZoneGroup @@ -110,7 +94,7 @@ """ -ZGS_TRANSFORM = LXML.XSLT(LXML.fromstring(ZGS_XSLT)) +ZGS_TRANSFORM = LXML.XSLT(LXML.fromstring(ZGS_XSLT)) # pylint:disable=I1101 _LOG = logging.getLogger(__name__) @@ -285,6 +269,6 @@ def update_soco_instances(self, tree): def normalize_zgs_xml(xml): """Normalize the ZoneGroupState payload and return an lxml ElementTree instance.""" - parser = LXML.XMLParser(remove_blank_text=True) - tree = LXML.fromstring(xml, parser) + parser = LXML.XMLParser(remove_blank_text=True) # pylint:disable=I1101 + tree = LXML.fromstring(xml, parser) # pylint:disable=I1101 return ZGS_TRANSFORM(tree)