Skip to content

Commit

Permalink
Fix whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
stepshal committed Jul 11, 2016
1 parent baab6bc commit d9231d1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/basic_engine.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

categories = ['general'] # optional
categories = ['general'] # optional


def request(query, params):
Expand Down
2 changes: 1 addition & 1 deletion utils/fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
18 changes: 9 additions & 9 deletions utils/fetch_currencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@

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': {
}
}


Expand All @@ -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):
Expand All @@ -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):
Expand Down Expand Up @@ -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', {})
Expand Down

0 comments on commit d9231d1

Please sign in to comment.