on master help sign in
Fix whitespaces
commitd9231d173ad873c1d014cf947d77f32037832784 authorstepshal <nessento@openmailbox.org> dateMon 11 Jul 2016, 18:52 (10 years ago) parentbaab6bc
3 files changed+11−11
examples/basic_engine.py+1−1 utils/fabfile.py+1−1 utils/fetch_currencies.py+9−9
examples/basic_engine.py+1−1
@@ -1,5 +1,5 @@
11
2−categories = ['general'] # optional
2+categories = ['general'] # optional
33
44
55def request(query, params):
utils/fabfile.py+1−1
@@ -89,7 +89,7 @@ def init():
8989 sudo('git clone https://github.com/asciimoo/searx')
9090
9191 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')
9393 sudo('ln -s {0}/uwsgi.ini /etc/uwsgi/apps-enabled/searx.ini'.format(searx_dir))
9494
9595 run('virtualenv {0}'.format(searx_ve_dir))
utils/fetch_currencies.py+9−9
@@ -10,17 +10,17 @@ languages = {'de', 'en', 'es', 'fr', 'hu', 'it', 'nl', 'jp'}
1010
1111url_template = 'https://www.wikidata.org/w/api.php?action=wbgetentities&format=json&{query}&props=labels%7Cdatatype%7Cclaims%7Caliases&languages=' + '|'.join(languages)
1212url_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}'
1414
1515wmflabs_queries = [
16− 'CLAIM[31:8142]', # all devise
16+ 'CLAIM[31:8142]', # all devise
1717]
1818
1919db = {
20− 'iso4217' : {
21− },
22− 'names' : {
23− }
20+ 'iso4217': {
21+ },
22+ 'names': {
23+ }
2424}
2525
2626
@@ -29,7 +29,7 @@ def remove_accents(data):
2929
3030
3131def normalize_name(name):
32− return re.sub(' +',' ', remove_accents(name.lower()).replace('-', ' '))
32+ return re.sub(' +', ' ', remove_accents(name.lower()).replace('-', ' '))
3333
3434
3535def add_currency_name(name, iso4217):
@@ -51,7 +51,7 @@ def add_currency_name(name, iso4217):
5151 if iso4217_set is not None and iso4217 not in iso4217_set:
5252 db_names[name].append(iso4217)
5353 else:
54− db_names[name] = [ iso4217 ]
54+ db_names[name] = [iso4217]
5555
5656
5757def add_currency_label(label, iso4217, language):
@@ -96,7 +96,7 @@ def parse_currency(data):
9696
9797
9898def 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)}))
100100 htmlresponse = get(url)
101101 jsonresponse = json.loads(htmlresponse.content)
102102 entities = jsonresponse.get('entities', {})