cleanup iParser
authorFlorian Schweikert <kelvan@logic.at>
Thu, 17 Mar 2011 01:51:08 +0000 (02:51 +0100)
committerFlorian Schweikert <kelvan@logic.at>
Thu, 17 Mar 2011 01:51:08 +0000 (02:51 +0100)
parseHtml.py

index 4d481e2..6f21e1a 100644 (file)
@@ -134,22 +134,21 @@ class Parser:
 
 
 class iParser:
-    _stations = {}
-    _lines = []
 
     def __init__(self):
-        pass
+        self._stations = {}
+        self._lines = []
 
     def get_stations(self, letter):
         if not self._stations.has_key(letter):
-            bs = BeautifulSoup(urllib2.urlopen(settings.stations % letter).read())
+            bs = BeautifulSoup(urllib2.urlopen(settings.stations % letter))
             self._stations[letter] = map(lambda x: x['value'], bs.find('select', {'id': 'letter'}).findAll('option'))
 
         return self._stations[letter]
 
     def get_lines(self):
         if not self._lines:
-            bs = BeautifulSoup(urllib2.urlopen(settings.line_overview).read())
+            bs = BeautifulSoup(urllib2.urlopen(settings.line_overview))
             # get tables
             lines = bs.findAll('table', {'class': 'linie'})
             # cut line parameter out of href