replaced part of duration parsing with function call
authorFlorian Schweikert <kelvan@logic.at>
Thu, 17 Mar 2011 01:49:01 +0000 (02:49 +0100)
committerFlorian Schweikert <kelvan@logic.at>
Thu, 17 Mar 2011 01:49:01 +0000 (02:49 +0100)
parseHtml.py

index c89d1c2..4d481e2 100644 (file)
@@ -95,7 +95,7 @@ class Parser:
                                'date': get_date(x),
                                'time': map(lambda x: time(*map(int, x.strip().split(':'))) if x else None, # extract times or set to None if empty
                                            x.find('td', {'class': 'col_time'}).text.split('-')) if x.find('td', {'class': 'col_time'}) else [],
-                               'duration': time(*map(int, x.find('td', {'class': 'col_duration'}).text.split(':'))), # grab duration
+                               'duration': time(*map(int, get_tdtext(x, 'col_duration').split(':'))), # grab duration
                                'change': get_change(x),
                                'price': get_price(x),
                            },