From 21ac8d7899340c8637035ec292f5d50a50ed0ea6 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 13 May 2018 20:15:25 +0000 Subject: [PATCH] Build the address as street + street_number if they are both available --- platypush/plugins/google/maps.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platypush/plugins/google/maps.py b/platypush/plugins/google/maps.py index 84511d52c8..55eb7f5f15 100644 --- a/platypush/plugins/google/maps.py +++ b/platypush/plugins/google/maps.py @@ -35,14 +35,18 @@ class GoogleMapsPlugin(GooglePlugin): if component_type == 'street_number': address['street_number'] = addr_component['long_name'] elif component_type == 'route': - address['street'] = addr_component['long_name'] + address['address'] = addr_component['long_name'] elif component_type == 'locality': address['locality'] = addr_component['long_name'] elif component_type == 'country': - address['country'] = addr_component['short_name'] + address['country'] = addr_component['short_name'].lower() elif component_type == 'postal_code': address['postal_code'] = addr_component['long_name'] + if 'address' in address and 'street_number' in address: + address['address'] += ' ' + address['street_number'] + del(address['street_number']) + return Response(output=address)