Merge lp:~verterok/unity-scope-openweathermap/use-new-style-unicode into lp:unity-scope-openweathermap

Proposed by Guillermo Gonzalez
Status: Merged
Approved by: David Callé
Approved revision: 28
Merged at revision: 28
Proposed branch: lp:~verterok/unity-scope-openweathermap/use-new-style-unicode
Merge into: lp:unity-scope-openweathermap
Diff against target: 113 lines (+19/-19)
1 file modified
src/unity_openweathermap_daemon.py (+19/-19)
To merge this branch: bzr merge lp:~verterok/unity-scope-openweathermap/use-new-style-unicode
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
David Callé Approve
Review via email: mp+165241@code.launchpad.net

Commit message

Remove u"" usage for unicode literals, in order to support python3.2 (required for the server side scope runner)

Description of the change

Remove u"" usage for unicode literals, in order to support python3.2 (required for the server side scope runner)

To post a comment you must log in.
Revision history for this message
David Callé (davidc3) wrote :

LGTM +1

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:28
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~verterok/unity-scope-openweathermap/use-new-style-unicode/+merge/165241/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/unity-scope-openweathermap-ci/7/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-scope-openweathermap-raring-amd64-ci/7
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-scope-openweathermap-raring-armhf-ci/2
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-scope-openweathermap-raring-i386-ci/2

Click here to trigger a rebuild:
http://s-jenkins:8080/job/unity-scope-openweathermap-ci/7/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/unity_openweathermap_daemon.py'
2--- src/unity_openweathermap_daemon.py 2013-04-17 17:00:03 +0000
3+++ src/unity_openweathermap_daemon.py 2013-05-22 20:18:50 +0000
4@@ -2,16 +2,16 @@
5 # -*- coding: utf-8 -*-
6
7 # Copyright (C) 2013 David Callé <davidc@framli.eu>
8-# This program is free software: you can redistribute it and/or modify it
9-# under the terms of the GNU General Public License version 3, as published
10+# This program is free software: you can redistribute it and/or modify it
11+# under the terms of the GNU General Public License version 3, as published
12 # by the Free Software Foundation.
13-#
14-# This program is distributed in the hope that it will be useful, but
15-# WITHOUT ANY WARRANTY; without even the implied warranties of
16-# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
17+#
18+# This program is distributed in the hope that it will be useful, but
19+# WITHOUT ANY WARRANTY; without even the implied warranties of
20+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
21 # PURPOSE. See the GNU General Public License for more details.
22-#
23-# You should have received a copy of the GNU General Public License along
24+#
25+# You should have received a copy of the GNU General Public License along
26 # with this program. If not, see <http://www.gnu.org/licenses/>.
27
28 from gi.repository import Unity, UnityExtras
29@@ -31,7 +31,7 @@
30
31 GROUP_NAME = 'com.canonical.Unity.Scope.Info.Openweathermap'
32 UNIQUE_PATH = '/com/canonical/unity/scope/info/openweathermap'
33-SEARCH_URI = ['http://openweathermap.org/data/2.1/find/',
34+SEARCH_URI = ['http://openweathermap.org/data/2.1/find/',
35 'http://openweathermap.org/data/2.1/forecast/city/']
36 SEARCH_HINT = _('Search OpenWeatherMap')
37 NO_RESULTS_HINT = _('Sorry, there is no OpenwWeatherMap forecast that matches your search.')
38@@ -141,7 +141,7 @@
39 wind = place_data['list'][0]['wind']['speed']
40 temp_c = float(place_data['list'][0]['main']['temp'])
41 temp_f = temp_c*(9.0/5.0)+32
42- temp = '%i%sC / %i%sF' % (int(temp_c), u"\u00B0", int(temp_f), u"\u00B0")
43+ temp = '%i%sC / %i%sF' % (int(temp_c), "\u00B0", int(temp_f), "\u00B0")
44 name = place_data['list'][0]['name']
45 country = place_data['list'][0]['sys']['country']
46 title = name + ', ' + country + '\n' + temp
47@@ -149,10 +149,10 @@
48 uri = place_data['list'][0]['url']
49 min_temp_c = float(place_data['list'][0]['main']['temp_min'])
50 min_temp_f = min_temp_c*(9.0/5.0)+32
51- min_temp = '%i%sC / %i%sF' % (int(min_temp_c), u"\u00B0", int(min_temp_f), u"\u00B0")
52+ min_temp = '%i%sC / %i%sF' % (int(min_temp_c), "\u00B0", int(min_temp_f), "\u00B0")
53 max_temp_c = float(place_data['list'][0]['main']['temp_max'])
54 max_temp_f = max_temp_c*(9.0/5.0)+32
55- max_temp = '%i%sC / %i%sF' % (int(max_temp_c), u"\u00B0", int(max_temp_f), u"\u00B0")
56+ max_temp = '%i%sC / %i%sF' % (int(max_temp_c), "\u00B0", int(max_temp_f), "\u00B0")
57 try:
58 pressure = place_data['list'][0]['main']['pressure']
59 except:
60@@ -200,14 +200,14 @@
61 icon = get_icon(forecast['list'][i]['weather'][0]['icon'])
62 temp_c = float(forecast['list'][i]['temp'])
63 temp_f = temp_c*(9.0/5.0)+32
64- temp = '%i%sC / %i%sF' % (int(temp_c), u"\u00B0", int(temp_f), u"\u00B0")
65+ temp = '%i%sC / %i%sF' % (int(temp_c), "\u00B0", int(temp_f), "\u00B0")
66 title = day_name + '\n' + temp
67 min_temp_c = float(forecast['list'][i]['morn'])
68 min_temp_f = min_temp_c*(9.0/5.0)+32
69- min_temp = '%i%sC / %i%sF' % (int(min_temp_c), u"\u00B0", int(min_temp_f), u"\u00B0")
70+ min_temp = '%i%sC / %i%sF' % (int(min_temp_c), "\u00B0", int(min_temp_f), "\u00B0")
71 max_temp_c = float(forecast['list'][i]['eve'])
72 max_temp_f = max_temp_c*(9.0/5.0)+32
73- max_temp = '%i%sC / %i%sF' % (int(max_temp_c), u"\u00B0", int(max_temp_f), u"\u00B0")
74+ max_temp = '%i%sC / %i%sF' % (int(max_temp_c), "\u00B0", int(max_temp_f), "\u00B0")
75 pressure = forecast['list'][i]['pressure']
76 humidity = forecast['list'][i]['humidity']
77 wind_speed = forecast['list'][i]['speed']
78@@ -305,7 +305,7 @@
79 image = None
80 query = urllib.parse.quote(flick_map[q])
81 key = 'd87224f0b467093b2a87fd788d950e27'
82- uri = 'http://secure.flickr.com/services/rest/?method=flickr.photos.search&nojsoncallback=1&per_page=20&api_key=%s&extras=url_m,owner_name,license&group_id=1463451@N25&format=json&tag_mode=all&tags=%s&bbox=%f,%f,%f,%f' % (key,
83+ uri = 'http://secure.flickr.com/services/rest/?method=flickr.photos.search&nojsoncallback=1&per_page=20&api_key=%s&extras=url_m,owner_name,license&group_id=1463451@N25&format=json&tag_mode=all&tags=%s&bbox=%f,%f,%f,%f' % (key,
84 query,
85 round(float(lon) - 0.1, 2), round(float(lat) - 0.1, 2),
86 round(float(lon) + 0.1, 2), round(float(lat) +0.1, 2))
87@@ -324,7 +324,7 @@
88 return image, owner, license, link
89
90 def do_run(self):
91-
92+
93 preview = Unity.GenericPreview.new(self.result.title.split('\n')[0], '', None)
94 preview.props.subtitle = self.result.comment.capitalize()
95 image, owner, license, link = self.get_image(self.result.metadata['photo_hint'].get_int32(),
96@@ -339,7 +339,7 @@
97 preview.add_info(Unity.InfoHint.new("min_temp", _("Minimum Temperature"), None, self.result.metadata['min_temp'].get_string()))
98 preview.add_info(Unity.InfoHint.new("max_temp", _("Maximum Temperature"), None, self.result.metadata['max_temp'].get_string()))
99 preview.add_info(Unity.InfoHint.new("wind_speed", _("Wind Speed"), None, self.result.metadata['wind_speed'].get_string() + ' m/s'))
100- preview.add_info(Unity.InfoHint.new("wind_direction", _("Wind Direction"), None, self.result.metadata['wind_direction'].get_string() + u"\u00B0"))
101+ preview.add_info(Unity.InfoHint.new("wind_direction", _("Wind Direction"), None, self.result.metadata['wind_direction'].get_string() + "\u00B0"))
102 if self.result.metadata['pressure'].get_string() != '':
103 preview.add_info(Unity.InfoHint.new("pressure", _("Pressure"), None, self.result.metadata['pressure'].get_string() + ' hPa'))
104 if self.result.metadata['humidity'].get_string() != '':
105@@ -397,7 +397,7 @@
106 '''
107 fs = Unity.FilterSet.new ()
108 # if FILTERS:
109-#
110+#
111 return fs
112
113 def do_get_group_name (self):

Subscribers

People subscribed via source and target branches