Integrate pycodestyle

This commit is contained in:
Falco Duersch
2018-10-23 13:11:51 +02:00
committed by f4lco
parent 523cc8ba62
commit 57c75b02e5
12 changed files with 64 additions and 22 deletions
+5 -3
View File
@@ -5,9 +5,11 @@ from xml.etree import ElementTree
def meal_names(response):
"""Extract meal names from OpenMensa XML.
By no means below parsing is robust or complete. Below just helps ensuring that the parser indeed returns proper XML
instead of arbitrary responses."""
By no means below parsing is robust or complete. Below just helps ensuring
that the parser indeed returns proper XML instead of arbitrary responses.
"""
root = ElementTree.fromstring(response)
namespace = {'om': 'http://openmensa.org/open-mensa-v2'}
nodes = root.findall('om:canteen/om:day/om:category/om:meal/om:name', namespace)
nodes = root.findall('om:canteen/om:day/om:category/om:meal/om:name',
namespace)
return [node.text for node in nodes]