Code review comment for lp:~marco-gallotta/ibid/flight

Revision history for this message
Stefano Rivera (stefanor) wrote :

If Vhata is being pedantic, here are some more pedantisms:

> query = [unicode(q) for q in query.lower().split(' ') if q]

There are a few more of those. Also, that probably doesn't need to be unicode()d.

While you are at it, convert all the unicode-touching string to u'string'

> [d for d in etree.getiterator('div') if d.get(u'class') == 'e_content']

that can be etree.findAll('div', attrs={'class': u'e_content'})

> for td in tr.getiterator('td'):
> if td.get(u'class').strip() in ['tfPrice', 'tfPriceOrButton']:

another very similar one

> table = [t for t in etree.getiterator('table') if t.get(u'id') == 'tfGrid'][0]
> trs = [t for t in table.getiterator('tr')]

and again. and 223

> if priority == 'cheapest':

priority.lower()

« Back to merge proposal