Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _read_services(self, services):
"""Get actions from services."""
for service in services:
parser = FritzSCDPParser(self.address, self.port, service)
actions = parser.get_actions(self.action_parameters)
service.actions = {action.name: action for action in actions}
self.services[service.name] = service
def __init__(self, address, port, service, filename=None):
"""
Reads and parses a SCDP.xml-file from FritzBox.
'service' is a tuple of containing:
(serviceType, controlURL, SCPDURL)
'service' is a FritzService object:
"""
self.state_variables = {}
self.service = service
if filename is None:
# access the FritzBox
super(FritzSCDPParser, self).__init__(address, port,
service.scpd_url)
else:
# for testing read the xml-data from a file
super(FritzSCDPParser, self).__init__(None, None, filename=filename)