Browse Source

Fix whitespaces

stepshal 8 years ago
parent
commit
d9231d173a
3 changed files with 11 additions and 11 deletions
  1. 1
    1
      examples/basic_engine.py
  2. 1
    1
      utils/fabfile.py
  3. 9
    9
      utils/fetch_currencies.py

+ 1
- 1
examples/basic_engine.py View File

@@ -1,5 +1,5 @@
1 1
 
2
-categories = ['general'] # optional
2
+categories = ['general']  # optional
3 3
 
4 4
 
5 5
 def request(query, params):

+ 1
- 1
utils/fabfile.py View File

@@ -89,7 +89,7 @@ def init():
89 89
         sudo('git clone https://github.com/asciimoo/searx')
90 90
 
91 91
     sudo('chown -R {user}:{user} {searx_dir}'.format(user=current_user, searx_dir=searx_dir))
92
-    put(StringIO(uwsgi_file), searx_dir+'/uwsgi.ini')
92
+    put(StringIO(uwsgi_file), searx_dir + '/uwsgi.ini')
93 93
     sudo('ln -s {0}/uwsgi.ini /etc/uwsgi/apps-enabled/searx.ini'.format(searx_dir))
94 94
 
95 95
     run('virtualenv {0}'.format(searx_ve_dir))

+ 9
- 9
utils/fetch_currencies.py View File

@@ -10,17 +10,17 @@ languages = {'de', 'en', 'es', 'fr', 'hu', 'it', 'nl', 'jp'}
10 10
 
11 11
 url_template = 'https://www.wikidata.org/w/api.php?action=wbgetentities&format=json&{query}&props=labels%7Cdatatype%7Cclaims%7Caliases&languages=' + '|'.join(languages)
12 12
 url_wmflabs_template = 'http://wdq.wmflabs.org/api?q='
13
-url_wikidata_search_template='http://www.wikidata.org/w/api.php?action=query&list=search&format=json&srnamespace=0&srprop=sectiontitle&{query}'
13
+url_wikidata_search_template = 'http://www.wikidata.org/w/api.php?action=query&list=search&format=json&srnamespace=0&srprop=sectiontitle&{query}'
14 14
 
15 15
 wmflabs_queries = [
16
-    'CLAIM[31:8142]', # all devise
16
+    'CLAIM[31:8142]',  # all devise
17 17
 ]
18 18
 
19 19
 db = {
20
-    'iso4217' : {
21
-        },
22
-    'names' : {
23
-        }
20
+    'iso4217': {
21
+    },
22
+    'names': {
23
+    }
24 24
 }
25 25
 
26 26
 
@@ -29,7 +29,7 @@ def remove_accents(data):
29 29
 
30 30
 
31 31
 def normalize_name(name):
32
-    return re.sub(' +',' ', remove_accents(name.lower()).replace('-', ' '))
32
+    return re.sub(' +', ' ', remove_accents(name.lower()).replace('-', ' '))
33 33
 
34 34
 
35 35
 def add_currency_name(name, iso4217):
@@ -51,7 +51,7 @@ def add_currency_name(name, iso4217):
51 51
     if iso4217_set is not None and iso4217 not in iso4217_set:
52 52
         db_names[name].append(iso4217)
53 53
     else:
54
-        db_names[name] = [ iso4217 ]
54
+        db_names[name] = [iso4217]
55 55
 
56 56
 
57 57
 def add_currency_label(label, iso4217, language):
@@ -96,7 +96,7 @@ def parse_currency(data):
96 96
 
97 97
 
98 98
 def fetch_data(wikidata_ids):
99
-    url = url_template.format(query=urlencode({'ids' : '|'.join(wikidata_ids)}))
99
+    url = url_template.format(query=urlencode({'ids': '|'.join(wikidata_ids)}))
100 100
     htmlresponse = get(url)
101 101
     jsonresponse = json.loads(htmlresponse.content)
102 102
     entities = jsonresponse.get('entities', {})