[mod] len() removed from conditions

This commit is contained in:
asciimoo 2014-02-11 13:13:51 +01:00
parent 239299d45e
commit c1d7d30b8e
8 changed files with 19 additions and 17 deletions

View file

@ -13,7 +13,7 @@ def request(query, params):
def response(resp):
raw_search_results = loads(resp.text)
if not len(raw_search_results):
if not raw_search_results:
return []
search_results = raw_search_results.get('channels', {})[0].get('items', [])
@ -26,10 +26,10 @@ def response(resp):
tmp_result['url'] = result['link']
tmp_result['content'] = ''
if len(result['description']):
if result['description']:
tmp_result['content'] += result['description'] + "<br/>"
if len(result['pubDate']):
if result['pubDate']:
tmp_result['content'] += result['pubDate'] + "<br/>"
if result['size'] != '-1':