Skip to content

Commit

Permalink
Additional warning suppressions for pylint (#927)
Browse files Browse the repository at this point in the history
  • Loading branch information
pwt committed Oct 21, 2022
1 parent f265fa5 commit ed7c869
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 20 deletions.
2 changes: 2 additions & 0 deletions soco/music_services/accounts.py
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions soco/soap.py
Expand Up @@ -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,
Expand Down
24 changes: 4 additions & 20 deletions soco/zonegroupstate.py
Expand Up @@ -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
Expand Down Expand Up @@ -110,7 +94,7 @@
</xsl:template>
</xsl:stylesheet>
"""
ZGS_TRANSFORM = LXML.XSLT(LXML.fromstring(ZGS_XSLT))
ZGS_TRANSFORM = LXML.XSLT(LXML.fromstring(ZGS_XSLT)) # pylint:disable=I1101

_LOG = logging.getLogger(__name__)

Expand Down Expand Up @@ -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)

0 comments on commit ed7c869

Please sign in to comment.