Merge lp:~nataliabidart/ubuntu-sso-client/no-hardcode-appname into lp:ubuntu-sso-client

Proposed by Natalia Bidart
Status: Merged
Approved by: Natalia Bidart
Approved revision: 824
Merged at revision: 824
Proposed branch: lp:~nataliabidart/ubuntu-sso-client/no-hardcode-appname
Merge into: lp:ubuntu-sso-client
Diff against target: 40 lines (+4/-4)
3 files modified
ubuntu_sso/gtk/gui.py (+1/-1)
ubuntu_sso/gtk/tests/test_gui.py (+1/-1)
ubuntu_sso/utils/ui.py (+2/-2)
To merge this branch: bzr merge lp:~nataliabidart/ubuntu-sso-client/no-hardcode-appname
Reviewer Review Type Date Requested Status
dobey (community) Approve
Review via email: mp+85956@code.launchpad.net

Commit message

- Do not hardcode the app_name when showing the TC_NOT_ACCEPTED message
  (LP: #TC_NOT_ACCEPTED).

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

Can you use the new .format() notation for string formatting, as % notation is deprecated?

review: Needs Fixing
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

We should migrate the whole code to use .format(). I prefer to remain consistent with the current code.

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Reported bug #904960 to track the migration.

Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_sso/gtk/gui.py'
2--- ubuntu_sso/gtk/gui.py 2011-11-14 12:02:39 +0000
3+++ ubuntu_sso/gtk/gui.py 2011-12-15 20:47:25 +0000
4@@ -743,7 +743,7 @@
5 # check T&C
6 if not self.yes_to_tc_checkbutton.get_active():
7 self._set_warning_message(self.tc_warning_label,
8- TC_NOT_ACCEPTED)
9+ TC_NOT_ACCEPTED % {'app_name': self.app_name})
10 error = True
11
12 captcha_solution = self.captcha_solution_entry.get_text()
13
14=== modified file 'ubuntu_sso/gtk/tests/test_gui.py'
15--- ubuntu_sso/gtk/tests/test_gui.py 2011-11-11 17:12:19 +0000
16+++ ubuntu_sso/gtk/tests/test_gui.py 2011-12-15 20:47:25 +0000
17@@ -1420,7 +1420,7 @@
18 self.ui.join_ok_button.clicked()
19
20 self.assert_correct_label_warning(self.ui.tc_warning_label,
21- gui.TC_NOT_ACCEPTED)
22+ gui.TC_NOT_ACCEPTED % {'app_name': APP_NAME})
23 self.assertNotIn('register_user', self.ui.backend._called)
24
25 def test_warning_is_shown_if_not_captcha_solution(self):
26
27=== modified file 'ubuntu_sso/utils/ui.py'
28--- ubuntu_sso/utils/ui.py 2011-10-20 14:15:46 +0000
29+++ ubuntu_sso/utils/ui.py 2011-12-15 20:47:25 +0000
30@@ -88,8 +88,8 @@
31 SUCCESS = _('You are now logged into %(app_name)s.')
32 SURNAME_ENTRY = _('Surname')
33 TC_BUTTON = _('Show Terms & Conditions')
34-TC_NOT_ACCEPTED = _('Agreeing to the Ubuntu One Terms & Conditions is ' \
35- 'required to subscribe.')
36+TC_NOT_ACCEPTED = _('Agreeing to the %(app_name)s Terms & Conditions is ' \
37+ 'required to subscribe.')
38 TOS_LABEL = _("You can also find these terms at <a href='%(url)s'>%(url)s</a>")
39 TRY_AGAIN_BUTTON = _('Try again')
40 UNKNOWN_ERROR = _('There was an error when trying to complete the ' \

Subscribers

People subscribed via source and target branches