Merge lp:~mvo/software-center/utf8-fixes into lp:software-center

Proposed by Michael Vogt
Status: Merged
Merged at revision: 2991
Proposed branch: lp:~mvo/software-center/utf8-fixes
Merge into: lp:software-center
Diff against target: 81 lines (+10/-7)
4 files modified
softwarecenter/backend/ubuntusso.py (+2/-1)
softwarecenter/db/application.py (+1/-1)
softwarecenter/distro/Ubuntu.py (+2/-1)
softwarecenter/ui/gtk3/review_gui_helper.py (+5/-4)
To merge this branch: bzr merge lp:~mvo/software-center/utf8-fixes
Reviewer Review Type Date Requested Status
Gary Lasker (community) Approve
Review via email: mp+103089@code.launchpad.net

Description of the change

This branch fixes some missing utf8(). I was not always able to reproduce but the risk is tiny.

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Uh, I should add that the last commit is for bug #917755

Revision history for this message
Gary Lasker (gary-lasker) wrote :

Hi Michael, and thanks for this! I think that the small change in softwarecenter/backend/ubuntusso.py may be left over from a different (your no-relogin?) branch. As it's not related to the utf8 fixes currently I'll remove that before merging. Please let me know if it should not be removed, etc.

Many thanks!

Revision history for this message
Gary Lasker (gary-lasker) wrote :

Thank you, Michael!

review: Approve
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your review.

About ubuntusso.py: you are right, thanks for the catching of this one and reverting it.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/backend/ubuntusso.py'
2--- softwarecenter/backend/ubuntusso.py 2012-03-19 13:35:47 +0000
3+++ softwarecenter/backend/ubuntusso.py 2012-04-23 12:32:29 +0000
4@@ -54,7 +54,7 @@
5 def _on_whoami_data(self, spawner, piston_whoami):
6 self.emit("whoami", piston_whoami)
7
8- def whoami(self):
9+ def whoami(self, no_relogin=False):
10 """ trigger request for the getting account information, this
11 will also verify if the current token is valid and if not
12 trigger a cleanup/re-authenticate
13@@ -64,6 +64,7 @@
14 spawner.connect("data-available", self._on_whoami_data)
15 spawner.connect("error", lambda spawner, err: self.emit("error", err))
16 spawner.needs_auth = True
17+ spawner.no_relogin = no_relogin
18 spawner.run_generic_piston_helper("UbuntuSsoAPI", "whoami")
19
20
21
22=== modified file 'softwarecenter/db/application.py'
23--- softwarecenter/db/application.py 2012-04-13 12:41:03 +0000
24+++ softwarecenter/db/application.py 2012-04-23 12:32:29 +0000
25@@ -127,7 +127,7 @@
26
27 # special methods
28 def __hash__(self):
29- return ("%s:%s" % (self.appname, self.pkgname)).__hash__()
30+ return utf8("%s:%s" % (utf8(self.appname), utf8(self.pkgname))).__hash__()
31
32 def __cmp__(self, other):
33 return self.apps_cmp(self, other)
34
35=== modified file 'softwarecenter/distro/Ubuntu.py'
36--- softwarecenter/distro/Ubuntu.py 2012-03-16 18:51:40 +0000
37+++ softwarecenter/distro/Ubuntu.py 2012-04-23 12:32:29 +0000
38@@ -28,6 +28,7 @@
39 from gettext import gettext as _
40 from softwarecenter.distro.Debian import Debian
41 from softwarecenter.enums import BUY_SOMETHING_HOST
42+from softwarecenter.utils import utf8
43
44 LOG = logging.getLogger(__name__)
45
46@@ -87,7 +88,7 @@
47
48 def get_removal_warning_text(self, cache, pkg, appname, depends):
49 primary = _("To remove %s, these items must be removed "
50- "as well:") % appname
51+ "as well:") % utf8(appname)
52 button_text = _("Remove All")
53
54 # alter it if a meta-package is affected
55
56=== modified file 'softwarecenter/ui/gtk3/review_gui_helper.py'
57--- softwarecenter/ui/gtk3/review_gui_helper.py 2012-03-16 09:02:42 +0000
58+++ softwarecenter/ui/gtk3/review_gui_helper.py 2012-04-23 12:32:29 +0000
59@@ -59,7 +59,7 @@
60 from softwarecenter.ui.gtk3.SimpleGtkbuilderApp import SimpleGtkbuilderApp
61 from softwarecenter.ui.gtk3.dialogs import SimpleGtkbuilderDialog
62 from softwarecenter.ui.gtk3.widgets.stars import ReactiveStar
63-from softwarecenter.utils import make_string_from_list
64+from softwarecenter.utils import make_string_from_list, utf8
65
66 from softwarecenter.backend.piston.rnrclient import RatingsAndReviewsAPI
67 from softwarecenter.backend.piston.rnrclient_pristine import ReviewRequest
68@@ -725,9 +725,10 @@
69 self.review_appicon.set_from_pixbuf(icon)
70
71 # title
72- m = '<b><span size="x-large">%s</span></b>\n%s'
73- self.review_title.set_markup(m % (
74- gettext.dgettext("app-install-data", app.name), version))
75+ app = utf8(gettext.dgettext("app-install-data", app.name))
76+ version = utf8(version)
77+ self.review_title.set_markup(
78+ '<b><span size="x-large">%s</span></b>\n%s' % (app, version))
79
80 # review label
81 self.review_label.set_markup(_('Review by: %s') %

Subscribers

People subscribed via source and target branches