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