From ff5121b7512f4677ddca1e922e4c66ca6b546694 Mon Sep 17 00:00:00 2001 From: Gabriel Pérez-Cerezo Date: Thu, 26 Oct 2017 12:37:52 +0200 Subject: Fixed error handling --- mensa/backends/satyam.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mensa/backends/satyam.py') diff --git a/mensa/backends/satyam.py b/mensa/backends/satyam.py index 7ac53a0..e01b546 100644 --- a/mensa/backends/satyam.py +++ b/mensa/backends/satyam.py @@ -21,6 +21,7 @@ class Satyam(IPlugin): response = urllib.request.urlopen(req) the_page = response.read() document = html5lib.parse(the_page, treebuilder="lxml") + sys.stderr = s groupsel = CSSSelector('.news-latest-item-content') k = etree.tostring(groupsel(document)[0]) name = re.sub(r'<.+?>', ' ', str(k)) @@ -29,7 +30,7 @@ class Satyam(IPlugin): name = " ".join(name.split()) name = name.replace("5,95 €", "") - sys.stderr = s + return [Food("Mittagstisch Express", "5,95 €", "Mittagstisch", 2, name[3:-1])] -- cgit v1.2.3