瀏覽代碼

[fix] unused globals removed

Adam Tauber 10 年之前
父節點
當前提交
66f02dc2b6

+ 0
- 1
searx/engines/bing.py 查看文件

27
 
27
 
28
 
28
 
29
 def response(resp):
29
 def response(resp):
30
-    global base_url
31
     results = []
30
     results = []
32
     dom = html.fromstring(resp.content)
31
     dom = html.fromstring(resp.content)
33
     for result in dom.xpath('//div[@class="sa_cc"]'):
32
     for result in dom.xpath('//div[@class="sa_cc"]'):

+ 0
- 1
searx/engines/bing_news.py 查看文件

29
 
29
 
30
 
30
 
31
 def response(resp):
31
 def response(resp):
32
-    global base_url
33
     results = []
32
     results = []
34
     dom = html.fromstring(resp.content)
33
     dom = html.fromstring(resp.content)
35
     for result in dom.xpath('//div[@class="sa_cc"]'):
34
     for result in dom.xpath('//div[@class="sa_cc"]'):

+ 0
- 1
searx/engines/currency_convert.py 查看文件

31
 
31
 
32
 
32
 
33
 def response(resp):
33
 def response(resp):
34
-    global base_url
35
     results = []
34
     results = []
36
     try:
35
     try:
37
         _, conversion_rate, _ = resp.text.split(',', 2)
36
         _, conversion_rate, _ = resp.text.split(',', 2)

+ 0
- 1
searx/engines/deviantart.py 查看文件

18
 
18
 
19
 
19
 
20
 def response(resp):
20
 def response(resp):
21
-    global base_url
22
     results = []
21
     results = []
23
     if resp.status_code == 302:
22
     if resp.status_code == 302:
24
         return results
23
         return results

+ 0
- 1
searx/engines/github.py 查看文件

10
 
10
 
11
 
11
 
12
 def request(query, params):
12
 def request(query, params):
13
-    global search_url
14
     params['url'] = search_url.format(query=urlencode({'q': query}))
13
     params['url'] = search_url.format(query=urlencode({'q': query}))
15
     params['headers']['Accept'] = accept_header
14
     params['headers']['Accept'] = accept_header
16
     return params
15
     return params

+ 0
- 1
searx/engines/soundcloud.py 查看文件

18
 
18
 
19
 
19
 
20
 def response(resp):
20
 def response(resp):
21
-    global base_url
22
     results = []
21
     results = []
23
     search_res = loads(resp.text)
22
     search_res = loads(resp.text)
24
     for result in search_res.get('collection', []):
23
     for result in search_res.get('collection', []):

+ 0
- 2
searx/engines/twitter.py 查看文件

12
 
12
 
13
 
13
 
14
 def request(query, params):
14
 def request(query, params):
15
-    global search_url
16
     params['url'] = search_url + urlencode({'q': query})
15
     params['url'] = search_url + urlencode({'q': query})
17
     return params
16
     return params
18
 
17
 
19
 
18
 
20
 def response(resp):
19
 def response(resp):
21
-    global base_url
22
     results = []
20
     results = []
23
     dom = html.fromstring(resp.text)
21
     dom = html.fromstring(resp.text)
24
     for tweet in dom.xpath('//li[@data-item-type="tweet"]'):
22
     for tweet in dom.xpath('//li[@data-item-type="tweet"]'):