summaryrefslogtreecommitdiff
path: root/searx/engines/openstreetmap.py
diff options
context:
space:
mode:
authorThomas Pointhuber <thomas.pointhuber@gmx.at>2014-12-16 17:01:25 +0100
committerThomas Pointhuber <thomas.pointhuber@gmx.at>2014-12-16 17:01:25 +0100
commit672f1c674ca63b7589c1bc6b0c32caf439bd16db (patch)
tree868b8bedfc3e146c8bc133b30f9ccd13e2f71680 /searx/engines/openstreetmap.py
parent48058075c06af1f4a0a21045b983dffe14ab9bff (diff)
downloadsearxng-672f1c674ca63b7589c1bc6b0c32caf439bd16db.tar.gz
searxng-672f1c674ca63b7589c1bc6b0c32caf439bd16db.zip
[fix] pep8
Diffstat (limited to 'searx/engines/openstreetmap.py')
-rw-r--r--searx/engines/openstreetmap.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/searx/engines/openstreetmap.py b/searx/engines/openstreetmap.py
index be775122a..68446ef5f 100644
--- a/searx/engines/openstreetmap.py
+++ b/searx/engines/openstreetmap.py
@@ -16,13 +16,14 @@ categories = ['map']
paging = False
# search-url
-base_url = 'https://nominatim.openstreetmap.org/search/{query}?format=json&polygon_geojson=1&addressdetails=1'
+base_url = 'https://nominatim.openstreetmap.org/'
+search_string = 'search/{query}?format=json&polygon_geojson=1&addressdetails=1'
result_base_url = 'https://openstreetmap.org/{osm_type}/{osm_id}'
# do search-request
def request(query, params):
- params['url'] = base_url.format(query=query)
+ params['url'] = base_url + search_string.format(query=query)
# using searx User-Agent
params['headers']['User-Agent'] = searx_useragent()
@@ -71,8 +72,8 @@ def response(resp):
address.update({'house_number': address_raw.get('house_number'),
'road': address_raw.get('road'),
'locality': address_raw.get('city',
- address_raw.get('town',
- address_raw.get('village'))),
+ address_raw.get('town', # noqa
+ address_raw.get('village'))), # noqa
'postcode': address_raw.get('postcode'),
'country': address_raw.get('country'),
'country_code': address_raw.get('country_code')})