diff options
| author | asciimoo <asciimoo@gmail.com> | 2014-02-11 13:13:51 +0100 |
|---|---|---|
| committer | asciimoo <asciimoo@gmail.com> | 2014-02-11 13:13:51 +0100 |
| commit | c1d7d30b8ec2950a6338f0b99ebe9bdc094fdb73 (patch) | |
| tree | bc2a38ccacc7d94721ab4b3942d83617ef3662f6 /searx/webapp.py | |
| parent | 239299d45ec7698e45451b617f2ef52bfb2c2e88 (diff) | |
[mod] len() removed from conditions
Diffstat (limited to 'searx/webapp.py')
| -rw-r--r-- | searx/webapp.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/searx/webapp.py b/searx/webapp.py index 84d9c3f03..7477e1722 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -91,7 +91,7 @@ def render(template_name, **kwargs): for ccateg in cookie_categories: if ccateg in categories: kwargs['selected_categories'].append(ccateg) - if not len(kwargs['selected_categories']): + if not kwargs['selected_categories']: kwargs['selected_categories'] = ['general'] return render_template(template_name, **kwargs) @@ -150,12 +150,12 @@ def index(): elif search.request_data.get('format') == 'csv': csv = UnicodeWriter(cStringIO.StringIO()) keys = ('title', 'url', 'content', 'host', 'engine', 'score') - if len(search.results): + if search.results: csv.writerow(keys) for row in search.results: row['host'] = row['parsed_url'].netloc csv.writerow([row.get(key, '') for key in keys]) - csv.stream.seek(0) + csv.stream.seek(0) response = Response(csv.stream.read(), mimetype='application/csv') cont_disp = 'attachment;Filename=searx_-_{0}.csv'.format(search.query) response.headers.add('Content-Disposition', cont_disp) |