projects
/
pywienerlinien
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5a2e406
)
fixing lowfloor bug
author
Florian Schweikert
<kelvan@logic.at>
Fri, 25 Nov 2011 18:01:36 +0000
(19:01 +0100)
committer
Florian Schweikert
<kelvan@logic.at>
Fri, 25 Nov 2011 18:01:36 +0000
(19:01 +0100)
gotovienna/realtime.py
patch
|
blob
|
history
diff --git
a/gotovienna/realtime.py
b/gotovienna/realtime.py
index
8e665e3
..
5a48327
100644
(file)
--- a/
gotovienna/realtime.py
+++ b/
gotovienna/realtime.py
@@
-215,6
+215,7
@@
class ITipParser:
for tr in result_lines[1:]:
d = {'station': station}
th = tr.findAll('th')
for tr in result_lines[1:]:
d = {'station': station}
th = tr.findAll('th')
+
if len(th) < 2:
#TODO replace with logger
print "[DEBUG] Unable to find th in:\n%s" % str(tr)
if len(th) < 2:
#TODO replace with logger
print "[DEBUG] Unable to find th in:\n%s" % str(tr)
@@
-226,7
+227,8
@@
class ITipParser:
t = th[-1]
else:
# all other lines
t = th[-1]
else:
# all other lines
- d['lowfloor'] = th[-1].has_key('img') and th[-1].img.has_key('alt')
+ print th[-1].find('img') and th[-1].img.has_key('alt')
+ d['lowfloor'] = th[-1].find('img') and th[-1].img.has_key('alt')
d['line'] = th[0].text.replace(' ', '')
d['direction'] = th[1].text.replace(' ', '')
t = th[-2]
d['line'] = th[0].text.replace(' ', '')
d['direction'] = th[1].text.replace(' ', '')
t = th[-2]