summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorstepshal <nessento@openmailbox.org>2016-07-11 18:52:37 +0700
committerstepshal <nessento@openmailbox.org>2016-07-11 18:52:37 +0700
commitd9231d173ad873c1d014cf947d77f32037832784 (patch)
tree29035decc6c150aaefb9a6b94f46ac3a1e0f58cd /utils
parentbaab6bcb9150c765c6e87a558388046ebc419017 (diff)
Fix whitespaces
Diffstat (limited to 'utils')
-rw-r--r--utils/fabfile.py2
-rw-r--r--utils/fetch_currencies.py18
2 files changed, 10 insertions, 10 deletions
diff --git a/utils/fabfile.py b/utils/fabfile.py
index 4b356c54..559e2ab6 100644
--- a/utils/fabfile.py
+++ b/utils/fabfile.py
@@ -89,7 +89,7 @@ def init():
sudo('git clone https://github.com/asciimoo/searx')
sudo('chown -R {user}:{user} {searx_dir}'.format(user=current_user, searx_dir=searx_dir))
- put(StringIO(uwsgi_file), searx_dir+'/uwsgi.ini')
+ put(StringIO(uwsgi_file), searx_dir + '/uwsgi.ini')
sudo('ln -s {0}/uwsgi.ini /etc/uwsgi/apps-enabled/searx.ini'.format(searx_dir))
run('virtualenv {0}'.format(searx_ve_dir))
diff --git a/utils/fetch_currencies.py b/utils/fetch_currencies.py
index 46d98c35..ebd0895a 100644
--- a/utils/fetch_currencies.py
+++ b/utils/fetch_currencies.py
@@ -10,17 +10,17 @@ languages = {'de', 'en', 'es', 'fr', 'hu', 'it', 'nl', 'jp'}
url_template = 'https://www.wikidata.org/w/api.php?action=wbgetentities&format=json&{query}&props=labels%7Cdatatype%7Cclaims%7Caliases&languages=' + '|'.join(languages)
url_wmflabs_template = 'http://wdq.wmflabs.org/api?q='
-url_wikidata_search_template='http://www.wikidata.org/w/api.php?action=query&list=search&format=json&srnamespace=0&srprop=sectiontitle&{query}'
+url_wikidata_search_template = 'http://www.wikidata.org/w/api.php?action=query&list=search&format=json&srnamespace=0&srprop=sectiontitle&{query}'
wmflabs_queries = [
- 'CLAIM[31:8142]', # all devise
+ 'CLAIM[31:8142]', # all devise
]
db = {
- 'iso4217' : {
- },
- 'names' : {
- }
+ 'iso4217': {
+ },
+ 'names': {
+ }
}
@@ -29,7 +29,7 @@ def remove_accents(data):
def normalize_name(name):
- return re.sub(' +',' ', remove_accents(name.lower()).replace('-', ' '))
+ return re.sub(' +', ' ', remove_accents(name.lower()).replace('-', ' '))
def add_currency_name(name, iso4217):
@@ -51,7 +51,7 @@ def add_currency_name(name, iso4217):
if iso4217_set is not None and iso4217 not in iso4217_set:
db_names[name].append(iso4217)
else:
- db_names[name] = [ iso4217 ]
+ db_names[name] = [iso4217]
def add_currency_label(label, iso4217, language):
@@ -96,7 +96,7 @@ def parse_currency(data):
def fetch_data(wikidata_ids):
- url = url_template.format(query=urlencode({'ids' : '|'.join(wikidata_ids)}))
+ url = url_template.format(query=urlencode({'ids': '|'.join(wikidata_ids)}))
htmlresponse = get(url)
jsonresponse = json.loads(htmlresponse.content)
entities = jsonresponse.get('entities', {})