Merge lp:~ralsina/ubuntu-rest-scopes/add-missing-lat-long into lp:ubuntu-rest-scopes

Proposed by Roberto Alsina
Status: Needs review
Proposed branch: lp:~ralsina/ubuntu-rest-scopes/add-missing-lat-long
Merge into: lp:ubuntu-rest-scopes
Diff against target: 43 lines (+10/-2)
1 file modified
src/scopes/weatherchannel.py (+10/-2)
To merge this branch: bzr merge lp:~ralsina/ubuntu-rest-scopes/add-missing-lat-long
Reviewer Review Type Date Requested Status
Facundo Batista (community) Disapprove
Review via email: mp+288794@code.launchpad.net

Commit message

Add latitude/longitude to TWC previews

Description of the change

Add latitude/longitude to TWC previews

To post a comment you must log in.
Revision history for this message
Facundo Batista (facundo) wrote :

I think we do NOT need this, let's talk

review: Disapprove

Unmerged revisions

511. By Roberto Alsina

Add lat/long to all previews

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/scopes/weatherchannel.py'
2--- src/scopes/weatherchannel.py 2016-03-11 14:39:17 +0000
3+++ src/scopes/weatherchannel.py 2016-03-11 15:49:47 +0000
4@@ -511,6 +511,9 @@
5 result['wind_sentence'])
6 humm = u"%s: %s" % (translator("Humidity", locale),
7 result['humidity'])
8+ preview_info = result.copy()
9+ preview_info['latitude'] = latitude
10+ preview_info['longitude'] = longitude
11 yield dict(result={
12 'cat_id': CATEGORY_GRID_MAIN['id'],
13 'uri': result['url'],
14@@ -526,7 +529,7 @@
15 {'style': 'default', 'value': wind},
16 {'style': 'default', 'value': ""},
17 ],
18- 'preview_info': result,
19+ 'preview_info': preview_info,
20 })
21
22 # finally the rest
23@@ -535,6 +538,9 @@
24 result.update(type='full', latitude=latitude, longitude=longitude)
25 title = u', '.join(filter(None,
26 (result['conditions'], result['current_temp'])))
27+ preview_info = result.copy()
28+ preview_info['latitude'] = latitude
29+ preview_info['longitude'] = longitude
30 yield dict(result={
31 'cat_id': CATEGORY_GRID_REST['id'],
32 'uri': result['url'],
33@@ -542,7 +548,9 @@
34 'title': title,
35 'subtitle': result['day'],
36 'art': result['art'],
37- 'preview_info': result,
38+ 'latitude': latitude,
39+ 'longitude': longitude,
40+ 'preview_info': preview_info,
41 })
42
43 def _get_location_search(self, twci, query, country):

Subscribers

People subscribed via source and target branches