浏览代码

[fix] pep8 fix for faroo engine

misnyo 7 年前
父节点
当前提交
20d2d4dab1
共有 1 个文件被更改,包括 10 次插入11 次删除
  1. 10
    11
      searx/engines/faroo.py

+ 10
- 11
searx/engines/faroo.py 查看文件

@@ -24,12 +24,12 @@ number_of_results = 10
24 24
 # search-url
25 25
 url = 'http://www.faroo.com/'
26 26
 search_url = url + 'instant.json?{query}'\
27
-                      '&start={offset}'\
28
-                      '&length={number_of_results}'\
29
-                      '&l={language}'\
30
-                      '&src={categorie}'\
31
-                      '&i=false'\
32
-                      '&c=false'
27
+    '&start={offset}'\
28
+    '&length={number_of_results}'\
29
+    '&l={language}'\
30
+    '&src={categorie}'\
31
+    '&i=false'\
32
+    '&c=false'
33 33
 
34 34
 search_category = {'general': 'web',
35 35
                    'news': 'news'}
@@ -79,16 +79,15 @@ def response(resp):
79 79
     # parse results
80 80
     for result in search_res['results']:
81 81
         publishedDate = None
82
-        result_json = {'url': result['url'],
83
-                        'title': result['title'],
84
-                        'content': result['kwic']}
82
+        result_json = {'url': result['url'], 'title': result['title'],
83
+                       'content': result['kwic']}
85 84
         if result['news']:
86 85
             result_json['publishedDate'] = \
87
-                    datetime.datetime.fromtimestamp(result['date'] / 1000.0)
86
+                datetime.datetime.fromtimestamp(result['date'] / 1000.0)
88 87
 
89 88
         # append image result if image url is set
90 89
         if result['iurl']:
91
-            result_json['template'] ='videos.html'
90
+            result_json['template'] = 'videos.html'
92 91
             result_json['thumbnail'] = result['iurl']
93 92
 
94 93
         results.append(result_json)