Merge lp:~dobey/ubuntu/oneiric/ubuntu-sso-client/release-1-3-1 into lp:ubuntu/oneiric/ubuntu-sso-client

Proposed by dobey
Status: Merged
Merged at revision: 33
Proposed branch: lp:~dobey/ubuntu/oneiric/ubuntu-sso-client/release-1-3-1
Merge into: lp:ubuntu/oneiric/ubuntu-sso-client
Diff against target: 9779 lines (+7580/-1135)
45 files modified
PKG-INFO (+18/-1)
README.windows (+56/-0)
bin/windows-ubuntu-sso-login (+74/-0)
data/gtk/ui.glade (+786/-0)
data/qt/choose_sign_in.ui (+121/-0)
data/qt/current_user_sign_in.ui (+154/-0)
data/qt/email_verification.ui (+105/-0)
data/qt/error_message.ui (+31/-0)
data/qt/forgotten_password.ui (+191/-0)
data/qt/reset_password.ui (+109/-0)
data/qt/setup_account.ui (+290/-0)
data/qt/success_message.ui (+31/-0)
data/qt/terms_and_conditions.ui (+128/-0)
data/ui.glade (+0/-786)
debian/changelog (+11/-0)
debian/watch (+1/-1)
pylintrc (+1/-1)
run-tests (+9/-3)
run-tests.bat (+23/-15)
setup.py (+314/-26)
ubuntu_sso/gtk/gui.py (+2/-39)
ubuntu_sso/gtk/tests/test_gui.py (+2/-0)
ubuntu_sso/keyring/tests/test_windows.py (+13/-2)
ubuntu_sso/keyring/windows.py (+2/-1)
ubuntu_sso/main/__init__.py (+50/-9)
ubuntu_sso/main/linux.py (+27/-49)
ubuntu_sso/main/tests/test_common.py (+5/-6)
ubuntu_sso/main/tests/test_linux.py (+42/-40)
ubuntu_sso/main/tests/test_windows.py (+1208/-0)
ubuntu_sso/main/windows.py (+926/-0)
ubuntu_sso/networkstate/linux.py (+27/-8)
ubuntu_sso/networkstate/tests/test_linux.py (+106/-90)
ubuntu_sso/qt/__init__.py (+1/-0)
ubuntu_sso/qt/controllers.py (+772/-0)
ubuntu_sso/qt/gui.py (+429/-0)
ubuntu_sso/qt/tests/__init__.py (+1/-0)
ubuntu_sso/qt/tests/show_gui.py (+45/-0)
ubuntu_sso/qt/tests/test_qt_views.py (+219/-0)
ubuntu_sso/qt/tests/test_windows.py (+768/-0)
ubuntu_sso/tests/test_account.py (+1/-1)
ubuntu_sso/tests/test_credentials.py (+2/-1)
ubuntu_sso/utils/tests/test_txsecrets.py (+114/-43)
ubuntu_sso/utils/tests/test_ui.py (+125/-0)
ubuntu_sso/utils/txsecrets.py (+57/-13)
ubuntu_sso/utils/ui.py (+183/-0)
To merge this branch: bzr merge lp:~dobey/ubuntu/oneiric/ubuntu-sso-client/release-1-3-1
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+65827@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'PKG-INFO'
--- PKG-INFO 2011-04-12 16:42:48 +0000
+++ PKG-INFO 2011-06-24 19:23:07 +0000
@@ -1,6 +1,6 @@
1Metadata-Version: 1.11Metadata-Version: 1.1
2Name: ubuntu-sso-client2Name: ubuntu-sso-client
3Version: 1.2.13Version: 1.3.1
4Summary: Ubuntu Single Sign-On client4Summary: Ubuntu Single Sign-On client
5Home-page: https://launchpad.net/ubuntu-sso-client5Home-page: https://launchpad.net/ubuntu-sso-client
6Author: Natalia Bidart6Author: Natalia Bidart
@@ -8,4 +8,21 @@
8License: GPL v38License: GPL v3
9Description: Desktop service to allow applications to sign into Ubuntu services via SSO9Description: Desktop service to allow applications to sign into Ubuntu services via SSO
10Platform: UNKNOWN10Platform: UNKNOWN
11Requires: Image
12Requires: PIL
13Requires: PyQt4.QtCore
14Requires: PyQt4.QtGui
15Requires: dbus
16Requires: gobject
17Requires: gtk
18Requires: keyring
19Requires: mocker
20Requires: oauth
21Requires: twisted.internet
22Requires: twisted.spread.pb
23Requires: twisted.trial
24Requires: ubuntuone.devtools.handlers
25Requires: ubuntuone.devtools.testcase
26Requires: webkit
27Requires: xdg
11Provides: ubuntu_sso28Provides: ubuntu_sso
1229
=== added file 'README.windows'
--- README.windows 1970-01-01 00:00:00 +0000
+++ README.windows 2011-06-24 19:23:07 +0000
@@ -0,0 +1,56 @@
1= Ubuntu Single Sign-On Client =
2
3Ubuntu Single Sign-On Client has been ported to windows to allow Windows
4applications to take advantage of the service. This README contains instructions
5on how to build the project so that it can be distributed as a .exe file.
6
7In order to be able to build a .exe for the client py2exe is used. The
8following are a number of recommendations to follow to ensure that your
9environment is correctly setup in order to use py2exe successfully.
10
11== Egg support ==
12
13As version 0.6.5 py2exe does not have egg support out of the box an therefore
14when building the .exe file you have to work around this limitation. At the
15moment the recommended way to work around this issue is to tell easy_install
16to always unzip the eggs so that py2xe can work with them. In order to
17unzip an egg when installing it with easy_install you can use the
18--always-unzip option.
19
20Example:
21
22easy_install --always-unzip oauth
23
24== PyQt issues ==
25
26Do to the way that py2exe works, there are a number of issues that may happen
27depending on the setup of you system.
28
29=== PyQt and PySide ===
30
31If you have PyQt and PySide py2exe will try to include both of them. The reason
32for this to happen is due to the way in which py2exe looks for dependencies. The
33module_finder form py2exe does not distinguish between normal imports and those
34that are wrapped around a try/except block. This means that the following code
35from the qtreactor will make py2exe believe that both are needed:
36
37This is a dangerous situation because PyQt and PySide do have different release
38cycles and normally do not depend on the same version of Qt. If in you system
39you have the two libraries using different version of Qt the build package
40might import dlls from different version which results in a runtime error.
41
42There are two ways to solve this issue:
43
44* Uninstall PySide
45* Ensure that both libs do depend on the same version of Qt.
46
47== PyQt and PyInstaller ===
48
49PyInstaller has support for PyQt application out of the box. This means that
50PyInstaller has the Qt dlls in its installation. As with the issue with PySide
51it might happen that the dlls used by PyInstaller and the ones used by the PyQt
52version installed in you machine differ in their version. In cases where
53PyInstaller is present in you python path (for example in C:\Python27\Scripts)
54py2exe will copy the dlls found in the PyInstaller directory for an unknown
55reason. This will raise a runtime error complaining about the use of dlls from
56different versions.
0\ No newline at end of file57\ No newline at end of file
158
=== added file 'bin/windows-ubuntu-sso-login'
--- bin/windows-ubuntu-sso-login 1970-01-01 00:00:00 +0000
+++ bin/windows-ubuntu-sso-login 2011-06-24 19:23:07 +0000
@@ -0,0 +1,74 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3# Author: Manuel de la Pena <manuel@canonical.com>
4#
5# Copyright 2011 Canonical Ltd.
6#
7# This program is free software: you can redistribute it and/or modify it
8# under the terms of the GNU General Public License version 3, as published
9# by the Free Software Foundation.
10#
11# This program is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranties of
13# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
14# PURPOSE. See the GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License along
17# with this program. If not, see <http://www.gnu.org/licenses/>.
18"""Start the sso service on a windows machine."""
19
20# disable the name warning and complains about twisted
21# pylint: disable=C0103, E1101
22import sys
23
24# pylint: disable=F0401
25from win32api import GetUserNameEx
26from win32con import NameSamCompatible
27# pylint: enable=F0401
28
29# import the qt reactor so that the qt ui can be used
30# pylint: disable=F0401
31from txnamedpipes import threadedreactor
32threadedreactor.install()
33from txnamedpipes.qt import Interleaver
34# pylint: enable=F0401
35
36from PyQt4.QtGui import QApplication
37from twisted.internet import reactor
38from twisted.spread.pb import PBServerFactory
39from twisted.internet.task import LoopingCall
40
41from ubuntu_sso.main.windows import (
42 CredentialsManagement,
43 SSOCredentials,
44 SSOLogin,
45 UbuntuSSORoot,
46 NAMED_PIPE_URL)
47
48# pylint: disable=W0702
49
50def add_timeout(interval, callback, *args, **kwargs):
51 """Add a timeout callback as a task."""
52 time_out_task = LoopingCall(callback, *args, **kwargs)
53 time_out_task.start(interval/1000, now=False)
54
55
56def shutdown():
57 """Shutdown all the running processes and threads."""
58 reactor.stop()
59
60
61if __name__ == '__main__':
62 # check if the service is running by calling the named pipe, if not
63 # start it.
64 login = SSOLogin('ignored')
65 creds = SSOCredentials()
66 creds_management = CredentialsManagement(add_timeout, shutdown)
67 root = UbuntuSSORoot(login, creds, creds_management)
68 named_pipe = NAMED_PIPE_URL % GetUserNameEx(NameSamCompatible)
69 listener = reactor.listenPipe(named_pipe, PBServerFactory(root))
70 # instantiated an qapp so that we can show the ui
71 ii = Interleaver()
72 reactor.interleave(ii.toInterleave)
73 app = QApplication(sys.argv)
74 app.exec_()
075
=== added directory 'data/gtk'
=== added file 'data/gtk/ui.glade'
--- data/gtk/ui.glade 1970-01-01 00:00:00 +0000
+++ data/gtk/ui.glade 2011-06-24 19:23:07 +0000
@@ -0,0 +1,786 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<interface>
3 <requires lib="gtk+" version="2.16"/>
4 <!-- interface-naming-policy project-wide -->
5 <object class="GtkWindow" id="window">
6 <property name="border_width">10</property>
7 <property name="window_position">center</property>
8 <signal name="delete_event" handler="on_close_clicked"/>
9 <child>
10 <object class="GtkVBox" id="window_vbox">
11 <property name="visible">True</property>
12 <property name="spacing">5</property>
13 <child>
14 <object class="GtkLabel" id="header_label">
15 <property name="visible">True</property>
16 <property name="xalign">0</property>
17 <property name="label" translatable="yes">Header Label </property>
18 <property name="wrap">True</property>
19 </object>
20 <packing>
21 <property name="expand">False</property>
22 <property name="padding">5</property>
23 <property name="position">0</property>
24 </packing>
25 </child>
26 <child>
27 <object class="GtkLabel" id="help_label">
28 <property name="visible">True</property>
29 <property name="xalign">0</property>
30 <property name="label" translatable="yes">help label</property>
31 <property name="wrap">True</property>
32 </object>
33 <packing>
34 <property name="expand">False</property>
35 <property name="position">1</property>
36 </packing>
37 </child>
38 <child>
39 <object class="GtkLabel" id="warning_label">
40 <property name="visible">True</property>
41 <property name="xalign">0</property>
42 <property name="label" translatable="yes">warning label</property>
43 <property name="wrap">True</property>
44 </object>
45 <packing>
46 <property name="expand">False</property>
47 <property name="position">2</property>
48 </packing>
49 </child>
50 <child>
51 <object class="GtkNotebook" id="content">
52 <property name="visible">True</property>
53 <property name="can_focus">True</property>
54 <property name="show_tabs">False</property>
55 <property name="show_border">False</property>
56 </object>
57 <packing>
58 <property name="position">3</property>
59 </packing>
60 </child>
61 </object>
62 </child>
63 </object>
64 <object class="GtkVBox" id="enter_details_vbox">
65 <property name="visible">True</property>
66 <property name="spacing">5</property>
67 <child>
68 <object class="GtkHBox" id="emails_hbox">
69 <property name="visible">True</property>
70 <property name="spacing">5</property>
71 <property name="homogeneous">True</property>
72 <child>
73 <placeholder/>
74 </child>
75 <child>
76 <placeholder/>
77 </child>
78 </object>
79 <packing>
80 <property name="expand">False</property>
81 <property name="position">0</property>
82 </packing>
83 </child>
84 <child>
85 <object class="GtkHBox" id="passwords_hbox">
86 <property name="visible">True</property>
87 <property name="spacing">5</property>
88 <property name="homogeneous">True</property>
89 <child>
90 <placeholder/>
91 </child>
92 <child>
93 <placeholder/>
94 </child>
95 </object>
96 <packing>
97 <property name="expand">False</property>
98 <property name="position">1</property>
99 </packing>
100 </child>
101 <child>
102 <object class="GtkLabel" id="password_help_label">
103 <property name="visible">True</property>
104 <property name="label">password help</property>
105 <property name="wrap">True</property>
106 </object>
107 <packing>
108 <property name="expand">False</property>
109 <property name="position">2</property>
110 </packing>
111 </child>
112 <child>
113 <object class="GtkAlignment" id="alignment5">
114 <property name="visible">True</property>
115 <property name="xscale">0</property>
116 <property name="yscale">0</property>
117 <child>
118 <object class="GtkHBox" id="hbox1">
119 <property name="visible">True</property>
120 <child>
121 <object class="GtkVBox" id="captcha_vbox">
122 <property name="width_request">300</property>
123 <property name="height_request">60</property>
124 <property name="visible">True</property>
125 <child>
126 <object class="GtkEventBox" id="captcha_loading">
127 <property name="width_request">300</property>
128 <property name="height_request">60</property>
129 <property name="visible">True</property>
130 <child>
131 <placeholder/>
132 </child>
133 </object>
134 <packing>
135 <property name="expand">False</property>
136 <property name="fill">False</property>
137 <property name="position">0</property>
138 </packing>
139 </child>
140 <child>
141 <object class="GtkImage" id="captcha_image">
142 <property name="width_request">300</property>
143 <property name="visible">True</property>
144 <property name="stock">gtk-missing-image</property>
145 </object>
146 <packing>
147 <property name="position">1</property>
148 </packing>
149 </child>
150 </object>
151 <packing>
152 <property name="expand">False</property>
153 <property name="fill">False</property>
154 <property name="position">0</property>
155 </packing>
156 </child>
157 <child>
158 <object class="GtkVBox" id="vbox1">
159 <property name="visible">True</property>
160 <child>
161 <object class="GtkButton" id="captcha_reload_button">
162 <property name="visible">True</property>
163 <property name="can_focus">True</property>
164 <property name="receives_default">True</property>
165 <property name="relief">none</property>
166 <property name="focus_on_click">False</property>
167 <signal name="clicked" handler="on_captcha_reload_button_clicked"/>
168 <child>
169 <object class="GtkImage" id="image1">
170 <property name="visible">True</property>
171 <property name="icon_name">reload</property>
172 </object>
173 </child>
174 </object>
175 <packing>
176 <property name="expand">False</property>
177 <property name="position">0</property>
178 </packing>
179 </child>
180 <child>
181 <placeholder/>
182 </child>
183 <child>
184 <placeholder/>
185 </child>
186 </object>
187 <packing>
188 <property name="expand">False</property>
189 <property name="position">1</property>
190 </packing>
191 </child>
192 </object>
193 </child>
194 </object>
195 <packing>
196 <property name="expand">False</property>
197 <property name="position">3</property>
198 </packing>
199 </child>
200 <child>
201 <object class="GtkVBox" id="captcha_solution_vbox">
202 <property name="visible">True</property>
203 <child>
204 <placeholder/>
205 </child>
206 </object>
207 <packing>
208 <property name="expand">False</property>
209 <property name="position">4</property>
210 </packing>
211 </child>
212 <child>
213 <object class="GtkCheckButton" id="yes_to_updates_checkbutton">
214 <property name="label" translatable="yes">yes to updates</property>
215 <property name="visible">True</property>
216 <property name="can_focus">True</property>
217 <property name="receives_default">False</property>
218 <property name="active">True</property>
219 <property name="draw_indicator">True</property>
220 </object>
221 <packing>
222 <property name="expand">False</property>
223 <property name="position">5</property>
224 </packing>
225 </child>
226 <child>
227 <object class="GtkVBox" id="tc_vbox">
228 <property name="visible">True</property>
229 <property name="spacing">5</property>
230 <child>
231 <object class="GtkCheckButton" id="yes_to_tc_checkbutton">
232 <property name="label" translatable="yes">yes to tc</property>
233 <property name="visible">True</property>
234 <property name="can_focus">True</property>
235 <property name="receives_default">False</property>
236 <property name="active">True</property>
237 <property name="draw_indicator">True</property>
238 </object>
239 <packing>
240 <property name="expand">False</property>
241 <property name="position">0</property>
242 </packing>
243 </child>
244 <child>
245 <object class="GtkHButtonBox" id="hbuttonbox3">
246 <property name="visible">True</property>
247 <property name="layout_style">start</property>
248 <child>
249 <object class="GtkButton" id="tc_button">
250 <property name="label">show tc</property>
251 <property name="visible">True</property>
252 <property name="can_focus">True</property>
253 <property name="receives_default">True</property>
254 <signal name="clicked" handler="on_tc_button_clicked"/>
255 </object>
256 <packing>
257 <property name="expand">False</property>
258 <property name="fill">False</property>
259 <property name="position">1</property>
260 </packing>
261 </child>
262 </object>
263 <packing>
264 <property name="expand">False</property>
265 <property name="position">1</property>
266 </packing>
267 </child>
268 <child>
269 <object class="GtkLabel" id="tc_warning_label">
270 <property name="visible">True</property>
271 <property name="xalign">0</property>
272 <property name="label">tc warning</property>
273 <property name="wrap">True</property>
274 </object>
275 <packing>
276 <property name="position">2</property>
277 </packing>
278 </child>
279 </object>
280 <packing>
281 <property name="expand">False</property>
282 <property name="position">6</property>
283 </packing>
284 </child>
285 <child>
286 <object class="GtkHBox" id="hbox2">
287 <property name="visible">True</property>
288 <property name="spacing">5</property>
289 <child>
290 <object class="GtkHButtonBox" id="hbuttonbox9">
291 <property name="visible">True</property>
292 <property name="layout_style">start</property>
293 <child>
294 <object class="GtkLinkButton" id="login_button">
295 <property name="label">login button</property>
296 <property name="visible">True</property>
297 <property name="can_focus">True</property>
298 <property name="receives_default">True</property>
299 <property name="relief">none</property>
300 <signal name="clicked" handler="on_sign_in_button_clicked"/>
301 </object>
302 <packing>
303 <property name="expand">False</property>
304 <property name="fill">False</property>
305 <property name="position">0</property>
306 </packing>
307 </child>
308 </object>
309 <packing>
310 <property name="expand">False</property>
311 <property name="position">0</property>
312 </packing>
313 </child>
314 <child>
315 <object class="GtkHButtonBox" id="hbuttonbox1">
316 <property name="visible">True</property>
317 <property name="spacing">5</property>
318 <property name="layout_style">end</property>
319 <child>
320 <object class="GtkButton" id="join_cancel_button">
321 <property name="label">gtk-cancel</property>
322 <property name="visible">True</property>
323 <property name="can_focus">True</property>
324 <property name="receives_default">True</property>
325 <property name="use_stock">True</property>
326 </object>
327 <packing>
328 <property name="expand">False</property>
329 <property name="fill">False</property>
330 <property name="position">0</property>
331 </packing>
332 </child>
333 <child>
334 <object class="GtkButton" id="join_ok_button">
335 <property name="label">gtk-go-forward</property>
336 <property name="visible">True</property>
337 <property name="can_focus">True</property>
338 <property name="receives_default">True</property>
339 <property name="use_stock">True</property>
340 <signal name="clicked" handler="on_join_ok_button_clicked"/>
341 </object>
342 <packing>
343 <property name="expand">False</property>
344 <property name="fill">False</property>
345 <property name="position">1</property>
346 </packing>
347 </child>
348 </object>
349 <packing>
350 <property name="expand">False</property>
351 <property name="pack_type">end</property>
352 <property name="position">1</property>
353 </packing>
354 </child>
355 </object>
356 <packing>
357 <property name="expand">False</property>
358 <property name="pack_type">end</property>
359 <property name="position">7</property>
360 </packing>
361 </child>
362 </object>
363 <object class="GtkVBox" id="processing_vbox">
364 <property name="visible">True</property>
365 <property name="spacing">10</property>
366 <child>
367 <placeholder/>
368 </child>
369 </object>
370 <object class="GtkVBox" id="verify_email_vbox">
371 <property name="visible">True</property>
372 <property name="spacing">10</property>
373 <child>
374 <object class="GtkAlignment" id="alignment4">
375 <property name="visible">True</property>
376 <property name="xscale">0</property>
377 <property name="yscale">0</property>
378 <child>
379 <object class="GtkVBox" id="verify_email_details_vbox">
380 <property name="visible">True</property>
381 <child>
382 <placeholder/>
383 </child>
384 </object>
385 </child>
386 </object>
387 <packing>
388 <property name="position">0</property>
389 </packing>
390 </child>
391 <child>
392 <object class="GtkHButtonBox" id="hbuttonbox2">
393 <property name="visible">True</property>
394 <property name="spacing">5</property>
395 <property name="layout_style">end</property>
396 <child>
397 <object class="GtkButton" id="verify_token_button">
398 <property name="label">gtk-ok</property>
399 <property name="visible">True</property>
400 <property name="can_focus">True</property>
401 <property name="receives_default">True</property>
402 <property name="use_stock">True</property>
403 <signal name="clicked" handler="on_verify_token_button_clicked"/>
404 </object>
405 <packing>
406 <property name="expand">False</property>
407 <property name="fill">False</property>
408 <property name="position">0</property>
409 </packing>
410 </child>
411 </object>
412 <packing>
413 <property name="expand">False</property>
414 <property name="position">1</property>
415 </packing>
416 </child>
417 </object>
418 <object class="GtkVBox" id="tc_browser_vbox">
419 <property name="visible">True</property>
420 <signal name="hide" handler="on_tc_browser_vbox_hide"/>
421 <child>
422 <object class="GtkScrolledWindow" id="tc_browser_window">
423 <property name="visible">True</property>
424 <property name="can_focus">True</property>
425 <property name="border_width">10</property>
426 <property name="hscrollbar_policy">never</property>
427 <property name="vscrollbar_policy">automatic</property>
428 <property name="shadow_type">in</property>
429 <child>
430 <placeholder/>
431 </child>
432 </object>
433 <packing>
434 <property name="position">0</property>
435 </packing>
436 </child>
437 <child>
438 <object class="GtkHButtonBox" id="hbuttonbox4">
439 <property name="visible">True</property>
440 <property name="layout_style">end</property>
441 <child>
442 <object class="GtkButton" id="tc_back_button">
443 <property name="label">gtk-go-back</property>
444 <property name="visible">True</property>
445 <property name="can_focus">True</property>
446 <property name="receives_default">True</property>
447 <property name="use_stock">True</property>
448 <signal name="clicked" handler="on_tc_back_button_clicked"/>
449 </object>
450 <packing>
451 <property name="expand">False</property>
452 <property name="fill">False</property>
453 <property name="position">0</property>
454 </packing>
455 </child>
456 </object>
457 <packing>
458 <property name="expand">False</property>
459 <property name="position">1</property>
460 </packing>
461 </child>
462 </object>
463 <object class="GtkVBox" id="login_vbox">
464 <property name="visible">True</property>
465 <property name="spacing">10</property>
466 <child>
467 <object class="GtkAlignment" id="alignment3">
468 <property name="visible">True</property>
469 <property name="xscale">0</property>
470 <property name="yscale">0</property>
471 <child>
472 <object class="GtkVBox" id="login_details_vbox">
473 <property name="visible">True</property>
474 <property name="spacing">5</property>
475 <child>
476 <placeholder/>
477 </child>
478 <child>
479 <placeholder/>
480 </child>
481 </object>
482 </child>
483 </object>
484 <packing>
485 <property name="position">0</property>
486 </packing>
487 </child>
488 <child>
489 <object class="GtkHBox" id="hbox3">
490 <property name="visible">True</property>
491 <property name="spacing">5</property>
492 <child>
493 <object class="GtkHButtonBox" id="hbuttonbox10">
494 <property name="visible">True</property>
495 <property name="layout_style">start</property>
496 <child>
497 <object class="GtkLinkButton" id="forgotten_password_button">
498 <property name="label" translatable="yes">button</property>
499 <property name="visible">True</property>
500 <property name="can_focus">True</property>
501 <property name="receives_default">True</property>
502 <property name="has_tooltip">True</property>
503 <property name="relief">none</property>
504 <signal name="clicked" handler="on_forgotten_password_button_clicked"/>
505 </object>
506 <packing>
507 <property name="expand">False</property>
508 <property name="fill">False</property>
509 <property name="padding">10</property>
510 <property name="position">0</property>
511 </packing>
512 </child>
513 </object>
514 <packing>
515 <property name="expand">False</property>
516 <property name="position">0</property>
517 </packing>
518 </child>
519 <child>
520 <object class="GtkHButtonBox" id="hbuttonbox5">
521 <property name="visible">True</property>
522 <property name="spacing">5</property>
523 <property name="layout_style">end</property>
524 <child>
525 <object class="GtkButton" id="login_cancel_button">
526 <property name="label">gtk-cancel</property>
527 <property name="visible">True</property>
528 <property name="can_focus">True</property>
529 <property name="receives_default">True</property>
530 <property name="use_stock">True</property>
531 </object>
532 <packing>
533 <property name="expand">False</property>
534 <property name="fill">False</property>
535 <property name="position">0</property>
536 </packing>
537 </child>
538 <child>
539 <object class="GtkButton" id="login_back_button">
540 <property name="label">gtk-go-back</property>
541 <property name="visible">True</property>
542 <property name="can_focus">True</property>
543 <property name="receives_default">True</property>
544 <property name="use_stock">True</property>
545 <signal name="clicked" handler="on_login_back_button_clicked"/>
546 </object>
547 <packing>
548 <property name="expand">False</property>
549 <property name="fill">False</property>
550 <property name="position">1</property>
551 </packing>
552 </child>
553 <child>
554 <object class="GtkButton" id="login_ok_button">
555 <property name="label">gtk-connect</property>
556 <property name="visible">True</property>
557 <property name="can_focus">True</property>
558 <property name="receives_default">True</property>
559 <property name="use_stock">True</property>
560 <signal name="clicked" handler="on_login_connect_button_clicked"/>
561 </object>
562 <packing>
563 <property name="expand">False</property>
564 <property name="fill">False</property>
565 <property name="position">2</property>
566 </packing>
567 </child>
568 </object>
569 <packing>
570 <property name="expand">False</property>
571 <property name="pack_type">end</property>
572 <property name="position">1</property>
573 </packing>
574 </child>
575 </object>
576 <packing>
577 <property name="expand">False</property>
578 <property name="position">1</property>
579 </packing>
580 </child>
581 </object>
582 <object class="GtkVBox" id="request_password_token_vbox">
583 <property name="visible">True</property>
584 <property name="spacing">10</property>
585 <child>
586 <object class="GtkAlignment" id="alignment2">
587 <property name="visible">True</property>
588 <property name="xscale">0</property>
589 <property name="yscale">0</property>
590 <child>
591 <object class="GtkVBox" id="request_password_token_details_vbox">
592 <property name="visible">True</property>
593 <property name="spacing">5</property>
594 <child>
595 <placeholder/>
596 </child>
597 </object>
598 </child>
599 </object>
600 <packing>
601 <property name="position">0</property>
602 </packing>
603 </child>
604 <child>
605 <object class="GtkHButtonBox" id="hbuttonbox7">
606 <property name="visible">True</property>
607 <property name="spacing">5</property>
608 <property name="layout_style">end</property>
609 <child>
610 <object class="GtkButton" id="request_password_token_cancel_button">
611 <property name="label">gtk-cancel</property>
612 <property name="visible">True</property>
613 <property name="can_focus">True</property>
614 <property name="receives_default">True</property>
615 <property name="use_stock">True</property>
616 </object>
617 <packing>
618 <property name="expand">False</property>
619 <property name="fill">False</property>
620 <property name="position">0</property>
621 </packing>
622 </child>
623 <child>
624 <object class="GtkButton" id="request_password_token_back_button">
625 <property name="label">gtk-go-back</property>
626 <property name="visible">True</property>
627 <property name="can_focus">True</property>
628 <property name="receives_default">True</property>
629 <property name="use_stock">True</property>
630 <signal name="clicked" handler="on_request_password_token_back_button_clicked"/>
631 </object>
632 <packing>
633 <property name="expand">False</property>
634 <property name="fill">False</property>
635 <property name="position">1</property>
636 </packing>
637 </child>
638 <child>
639 <object class="GtkButton" id="request_password_token_ok_button">
640 <property name="label">gtk-ok</property>
641 <property name="visible">True</property>
642 <property name="can_focus">True</property>
643 <property name="receives_default">True</property>
644 <property name="use_stock">True</property>
645 <signal name="clicked" handler="on_request_password_token_ok_button_clicked"/>
646 </object>
647 <packing>
648 <property name="expand">False</property>
649 <property name="fill">False</property>
650 <property name="position">2</property>
651 </packing>
652 </child>
653 </object>
654 <packing>
655 <property name="expand">False</property>
656 <property name="position">1</property>
657 </packing>
658 </child>
659 </object>
660 <object class="GtkVBox" id="set_new_password_vbox">
661 <property name="visible">True</property>
662 <property name="spacing">10</property>
663 <child>
664 <object class="GtkVBox" id="vbox2">
665 <property name="visible">True</property>
666 <child>
667 <object class="GtkLabel" id="reset_password_help_label">
668 <property name="visible">True</property>
669 <property name="label">label</property>
670 <property name="wrap">True</property>
671 </object>
672 <packing>
673 <property name="expand">False</property>
674 <property name="position">0</property>
675 </packing>
676 </child>
677 <child>
678 <object class="GtkAlignment" id="alignment1">
679 <property name="visible">True</property>
680 <property name="xscale">0</property>
681 <property name="yscale">0</property>
682 <child>
683 <object class="GtkVBox" id="set_new_password_details_vbox">
684 <property name="visible">True</property>
685 <property name="spacing">5</property>
686 <child>
687 <placeholder/>
688 </child>
689 <child>
690 <placeholder/>
691 </child>
692 <child>
693 <placeholder/>
694 </child>
695 </object>
696 </child>
697 </object>
698 <packing>
699 <property name="position">1</property>
700 </packing>
701 </child>
702 </object>
703 <packing>
704 <property name="position">0</property>
705 </packing>
706 </child>
707 <child>
708 <object class="GtkHButtonBox" id="hbuttonbox6">
709 <property name="visible">True</property>
710 <property name="spacing">5</property>
711 <property name="layout_style">end</property>
712 <child>
713 <object class="GtkButton" id="set_new_password_cancel_button">
714 <property name="label">gtk-cancel</property>
715 <property name="visible">True</property>
716 <property name="can_focus">True</property>
717 <property name="receives_default">True</property>
718 <property name="use_stock">True</property>
719 </object>
720 <packing>
721 <property name="expand">False</property>
722 <property name="fill">False</property>
723 <property name="position">0</property>
724 </packing>
725 </child>
726 <child>
727 <object class="GtkButton" id="set_new_password_ok_button">
728 <property name="label">gtk-ok</property>
729 <property name="visible">True</property>
730 <property name="can_focus">True</property>
731 <property name="receives_default">True</property>
732 <property name="use_stock">True</property>
733 <signal name="clicked" handler="on_set_new_password_ok_button_clicked"/>
734 </object>
735 <packing>
736 <property name="expand">False</property>
737 <property name="fill">False</property>
738 <property name="position">1</property>
739 </packing>
740 </child>
741 </object>
742 <packing>
743 <property name="expand">False</property>
744 <property name="position">1</property>
745 </packing>
746 </child>
747 </object>
748 <object class="GtkVBox" id="finish_vbox">
749 <property name="visible">True</property>
750 <property name="spacing">10</property>
751 <child>
752 <object class="GtkLabel" id="finish_label">
753 <property name="visible">True</property>
754 <property name="wrap">True</property>
755 </object>
756 <packing>
757 <property name="position">0</property>
758 </packing>
759 </child>
760 <child>
761 <object class="GtkHButtonBox" id="hbuttonbox8">
762 <property name="visible">True</property>
763 <property name="layout_style">end</property>
764 <child>
765 <object class="GtkButton" id="finish_close_button">
766 <property name="label">gtk-close</property>
767 <property name="visible">True</property>
768 <property name="can_focus">True</property>
769 <property name="receives_default">True</property>
770 <property name="use_stock">True</property>
771 <signal name="clicked" handler="on_close_clicked"/>
772 </object>
773 <packing>
774 <property name="expand">False</property>
775 <property name="fill">False</property>
776 <property name="position">0</property>
777 </packing>
778 </child>
779 </object>
780 <packing>
781 <property name="expand">False</property>
782 <property name="position">1</property>
783 </packing>
784 </child>
785 </object>
786</interface>
0787
=== added directory 'data/qt'
=== added file 'data/qt/choose_sign_in.ui'
--- data/qt/choose_sign_in.ui 1970-01-01 00:00:00 +0000
+++ data/qt/choose_sign_in.ui 2011-06-24 19:23:07 +0000
@@ -0,0 +1,121 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<ui version="4.0">
3 <class>ChooseSignInPage</class>
4 <widget class="QWizardPage" name="ChooseSingInPage">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>400</width>
10 <height>300</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>WizardPage</string>
15 </property>
16 <layout class="QHBoxLayout" name="horizontalLayout">
17 <item>
18 <layout class="QHBoxLayout" name="horizontalLayout_3">
19 <item>
20 <spacer name="horizontalSpacer_2">
21 <property name="orientation">
22 <enum>Qt::Horizontal</enum>
23 </property>
24 <property name="sizeType">
25 <enum>QSizePolicy::Expanding</enum>
26 </property>
27 <property name="sizeHint" stdset="0">
28 <size>
29 <width>40</width>
30 <height>20</height>
31 </size>
32 </property>
33 </spacer>
34 </item>
35 <item>
36 <layout class="QVBoxLayout" name="verticalLayout">
37 <item>
38 <spacer name="verticalSpacer_3">
39 <property name="orientation">
40 <enum>Qt::Vertical</enum>
41 </property>
42 <property name="sizeHint" stdset="0">
43 <size>
44 <width>20</width>
45 <height>40</height>
46 </size>
47 </property>
48 </spacer>
49 </item>
50 <item>
51 <layout class="QHBoxLayout" name="horizontalLayout_2">
52 <item>
53 <widget class="QPushButton" name="existing_account_button">
54 <property name="text">
55 <string/>
56 </property>
57 </widget>
58 </item>
59 </layout>
60 </item>
61 <item>
62 <spacer name="verticalSpacer">
63 <property name="orientation">
64 <enum>Qt::Vertical</enum>
65 </property>
66 <property name="sizeType">
67 <enum>QSizePolicy::Fixed</enum>
68 </property>
69 <property name="sizeHint" stdset="0">
70 <size>
71 <width>20</width>
72 <height>10</height>
73 </size>
74 </property>
75 </spacer>
76 </item>
77 <item>
78 <widget class="QPushButton" name="setup_account_button">
79 <property name="text">
80 <string/>
81 </property>
82 </widget>
83 </item>
84 <item>
85 <spacer name="verticalSpacer_2">
86 <property name="orientation">
87 <enum>Qt::Vertical</enum>
88 </property>
89 <property name="sizeHint" stdset="0">
90 <size>
91 <width>20</width>
92 <height>40</height>
93 </size>
94 </property>
95 </spacer>
96 </item>
97 </layout>
98 </item>
99 <item>
100 <spacer name="horizontalSpacer">
101 <property name="orientation">
102 <enum>Qt::Horizontal</enum>
103 </property>
104 <property name="sizeType">
105 <enum>QSizePolicy::Expanding</enum>
106 </property>
107 <property name="sizeHint" stdset="0">
108 <size>
109 <width>40</width>
110 <height>20</height>
111 </size>
112 </property>
113 </spacer>
114 </item>
115 </layout>
116 </item>
117 </layout>
118 </widget>
119 <resources/>
120 <connections/>
121</ui>
0122
=== added file 'data/qt/current_user_sign_in.ui'
--- data/qt/current_user_sign_in.ui 1970-01-01 00:00:00 +0000
+++ data/qt/current_user_sign_in.ui 2011-06-24 19:23:07 +0000
@@ -0,0 +1,154 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<ui version="4.0">
3 <class>CurrentUserSignInPage</class>
4 <widget class="QWizardPage" name="CurrentUserSignInPage">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>400</width>
10 <height>300</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>WizardPage</string>
15 </property>
16 <layout class="QHBoxLayout" name="horizontalLayout">
17 <item>
18 <layout class="QHBoxLayout" name="horizontalLayout_3">
19 <item>
20 <spacer name="horizontalSpacer_2">
21 <property name="orientation">
22 <enum>Qt::Horizontal</enum>
23 </property>
24 <property name="sizeType">
25 <enum>QSizePolicy::Fixed</enum>
26 </property>
27 <property name="sizeHint" stdset="0">
28 <size>
29 <width>40</width>
30 <height>20</height>
31 </size>
32 </property>
33 </spacer>
34 </item>
35 <item>
36 <layout class="QVBoxLayout" name="verticalLayout">
37 <item>
38 <spacer name="verticalSpacer_3">
39 <property name="orientation">
40 <enum>Qt::Vertical</enum>
41 </property>
42 <property name="sizeHint" stdset="0">
43 <size>
44 <width>20</width>
45 <height>40</height>
46 </size>
47 </property>
48 </spacer>
49 </item>
50 <item>
51 <widget class="QFrame" name="_signInFrame">
52 <property name="frameShape">
53 <enum>QFrame::NoFrame</enum>
54 </property>
55 <layout class="QVBoxLayout" name="verticalLayout_3">
56 <item>
57 <layout class="QVBoxLayout" name="verticalLayout_2">
58 <item>
59 <widget class="QLineEdit" name="email_edit">
60 <property name="placeholderText">
61 <string/>
62 </property>
63 </widget>
64 </item>
65 <item>
66 <widget class="QLineEdit" name="password_edit">
67 <property name="echoMode">
68 <enum>QLineEdit::Password</enum>
69 </property>
70 <property name="placeholderText">
71 <string/>
72 </property>
73 </widget>
74 </item>
75 <item>
76 <widget class="QLabel" name="forgot_password_label">
77 <property name="sizePolicy">
78 <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
79 <horstretch>0</horstretch>
80 <verstretch>0</verstretch>
81 </sizepolicy>
82 </property>
83 <property name="text">
84 <string/>
85 </property>
86 </widget>
87 </item>
88 <item>
89 <layout class="QHBoxLayout" name="horizontalLayout_4">
90 <item>
91 <spacer name="horizontalSpacer_3">
92 <property name="orientation">
93 <enum>Qt::Horizontal</enum>
94 </property>
95 <property name="sizeHint" stdset="0">
96 <size>
97 <width>40</width>
98 <height>20</height>
99 </size>
100 </property>
101 </spacer>
102 </item>
103 <item>
104 <widget class="QPushButton" name="sign_in_button">
105 <property name="text">
106 <string/>
107 </property>
108 </widget>
109 </item>
110 </layout>
111 </item>
112 </layout>
113 </item>
114 </layout>
115 </widget>
116 </item>
117 <item>
118 <spacer name="verticalSpacer_2">
119 <property name="orientation">
120 <enum>Qt::Vertical</enum>
121 </property>
122 <property name="sizeHint" stdset="0">
123 <size>
124 <width>20</width>
125 <height>40</height>
126 </size>
127 </property>
128 </spacer>
129 </item>
130 </layout>
131 </item>
132 <item>
133 <spacer name="horizontalSpacer">
134 <property name="orientation">
135 <enum>Qt::Horizontal</enum>
136 </property>
137 <property name="sizeType">
138 <enum>QSizePolicy::Fixed</enum>
139 </property>
140 <property name="sizeHint" stdset="0">
141 <size>
142 <width>40</width>
143 <height>20</height>
144 </size>
145 </property>
146 </spacer>
147 </item>
148 </layout>
149 </item>
150 </layout>
151 </widget>
152 <resources/>
153 <connections/>
154</ui>
0155
=== added file 'data/qt/email_verification.ui'
--- data/qt/email_verification.ui 1970-01-01 00:00:00 +0000
+++ data/qt/email_verification.ui 2011-06-24 19:23:07 +0000
@@ -0,0 +1,105 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<ui version="4.0">
3 <class>EmailVerificationPage</class>
4 <widget class="QWizardPage" name="EmailVerificationPage">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>400</width>
10 <height>300</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>WizardPage</string>
15 </property>
16 <layout class="QHBoxLayout" name="horizontalLayout">
17 <item>
18 <layout class="QHBoxLayout" name="horizontalLayout_3">
19 <item>
20 <spacer name="horizontalSpacer_2">
21 <property name="orientation">
22 <enum>Qt::Horizontal</enum>
23 </property>
24 <property name="sizeType">
25 <enum>QSizePolicy::Fixed</enum>
26 </property>
27 <property name="sizeHint" stdset="0">
28 <size>
29 <width>40</width>
30 <height>20</height>
31 </size>
32 </property>
33 </spacer>
34 </item>
35 <item>
36 <layout class="QVBoxLayout" name="verticalLayout">
37 <item>
38 <widget class="QLineEdit" name="verification_code_edit">
39 <property name="placeholderText">
40 <string/>
41 </property>
42 </widget>
43 </item>
44 <item>
45 <layout class="QHBoxLayout" name="horizontalLayout_2">
46 <item>
47 <spacer name="horizontalSpacer_3">
48 <property name="orientation">
49 <enum>Qt::Horizontal</enum>
50 </property>
51 <property name="sizeHint" stdset="0">
52 <size>
53 <width>40</width>
54 <height>20</height>
55 </size>
56 </property>
57 </spacer>
58 </item>
59 <item>
60 <widget class="QPushButton" name="next_button">
61 <property name="text">
62 <string>Next</string>
63 </property>
64 </widget>
65 </item>
66 </layout>
67 </item>
68 <item>
69 <spacer name="verticalSpacer_2">
70 <property name="orientation">
71 <enum>Qt::Vertical</enum>
72 </property>
73 <property name="sizeHint" stdset="0">
74 <size>
75 <width>20</width>
76 <height>40</height>
77 </size>
78 </property>
79 </spacer>
80 </item>
81 </layout>
82 </item>
83 <item>
84 <spacer name="horizontalSpacer">
85 <property name="orientation">
86 <enum>Qt::Horizontal</enum>
87 </property>
88 <property name="sizeType">
89 <enum>QSizePolicy::Fixed</enum>
90 </property>
91 <property name="sizeHint" stdset="0">
92 <size>
93 <width>40</width>
94 <height>20</height>
95 </size>
96 </property>
97 </spacer>
98 </item>
99 </layout>
100 </item>
101 </layout>
102 </widget>
103 <resources/>
104 <connections/>
105</ui>
0106
=== added file 'data/qt/error_message.ui'
--- data/qt/error_message.ui 1970-01-01 00:00:00 +0000
+++ data/qt/error_message.ui 2011-06-24 19:23:07 +0000
@@ -0,0 +1,31 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<ui version="4.0">
3 <class>ErrorPage</class>
4 <widget class="QWizardPage" name="ErrorPage">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>400</width>
10 <height>300</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>WizardPage</string>
15 </property>
16 <layout class="QVBoxLayout" name="verticalLayout">
17 <item>
18 <widget class="QLabel" name="error_message_label">
19 <property name="text">
20 <string>TextLabel</string>
21 </property>
22 <property name="alignment">
23 <set>Qt::AlignCenter</set>
24 </property>
25 </widget>
26 </item>
27 </layout>
28 </widget>
29 <resources/>
30 <connections/>
31</ui>
032
=== added file 'data/qt/forgotten_password.ui'
--- data/qt/forgotten_password.ui 1970-01-01 00:00:00 +0000
+++ data/qt/forgotten_password.ui 2011-06-24 19:23:07 +0000
@@ -0,0 +1,191 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<ui version="4.0">
3 <class>ForgottenPasswordPage</class>
4 <widget class="QWizardPage" name="ForgottenPasswordPage">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>446</width>
10 <height>209</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>WizardPage</string>
15 </property>
16 <layout class="QVBoxLayout" name="verticalLayout_2">
17 <item>
18 <widget class="QLabel" name="error_label">
19 <property name="text">
20 <string/>
21 </property>
22 <property name="wordWrap">
23 <bool>true</bool>
24 </property>
25 </widget>
26 </item>
27 <item>
28 <widget class="QLabel" name="forgotted_password_intro_label">
29 <property name="text">
30 <string/>
31 </property>
32 <property name="wordWrap">
33 <bool>true</bool>
34 </property>
35 </widget>
36 </item>
37 <item>
38 <widget class="QWidget" name="email_widget" native="true">
39 <layout class="QHBoxLayout" name="horizontalLayout_2">
40 <item>
41 <spacer name="horizontalSpacer_2">
42 <property name="orientation">
43 <enum>Qt::Horizontal</enum>
44 </property>
45 <property name="sizeType">
46 <enum>QSizePolicy::Fixed</enum>
47 </property>
48 <property name="sizeHint" stdset="0">
49 <size>
50 <width>40</width>
51 <height>20</height>
52 </size>
53 </property>
54 </spacer>
55 </item>
56 <item>
57 <layout class="QVBoxLayout" name="verticalLayout">
58 <item>
59 <widget class="QLabel" name="email_address_label">
60 <property name="sizePolicy">
61 <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
62 <horstretch>0</horstretch>
63 <verstretch>0</verstretch>
64 </sizepolicy>
65 </property>
66 <property name="text">
67 <string/>
68 </property>
69 </widget>
70 </item>
71 <item>
72 <widget class="QLineEdit" name="email_line_edit"/>
73 </item>
74 </layout>
75 </item>
76 <item>
77 <spacer name="horizontalSpacer_3">
78 <property name="orientation">
79 <enum>Qt::Horizontal</enum>
80 </property>
81 <property name="sizeType">
82 <enum>QSizePolicy::Fixed</enum>
83 </property>
84 <property name="sizeHint" stdset="0">
85 <size>
86 <width>40</width>
87 <height>20</height>
88 </size>
89 </property>
90 </spacer>
91 </item>
92 </layout>
93 </widget>
94 </item>
95 <item>
96 <layout class="QHBoxLayout" name="horizontalLayout">
97 <item>
98 <spacer name="horizontalSpacer">
99 <property name="orientation">
100 <enum>Qt::Horizontal</enum>
101 </property>
102 <property name="sizeHint" stdset="0">
103 <size>
104 <width>40</width>
105 <height>20</height>
106 </size>
107 </property>
108 </spacer>
109 </item>
110 <item>
111 <widget class="QPushButton" name="send_button">
112 <property name="text">
113 <string/>
114 </property>
115 </widget>
116 </item>
117 <item>
118 <spacer name="horizontalSpacer_4">
119 <property name="orientation">
120 <enum>Qt::Horizontal</enum>
121 </property>
122 <property name="sizeType">
123 <enum>QSizePolicy::Fixed</enum>
124 </property>
125 <property name="sizeHint" stdset="0">
126 <size>
127 <width>40</width>
128 <height>20</height>
129 </size>
130 </property>
131 </spacer>
132 </item>
133 </layout>
134 </item>
135 <item>
136 <widget class="QWidget" name="try_again_widget" native="true">
137 <layout class="QHBoxLayout" name="horizontalLayout_3">
138 <item>
139 <spacer name="horizontalSpacer_5">
140 <property name="orientation">
141 <enum>Qt::Horizontal</enum>
142 </property>
143 <property name="sizeHint" stdset="0">
144 <size>
145 <width>40</width>
146 <height>20</height>
147 </size>
148 </property>
149 </spacer>
150 </item>
151 <item>
152 <widget class="QPushButton" name="try_again_button">
153 <property name="text">
154 <string/>
155 </property>
156 </widget>
157 </item>
158 <item>
159 <spacer name="horizontalSpacer_6">
160 <property name="orientation">
161 <enum>Qt::Horizontal</enum>
162 </property>
163 <property name="sizeHint" stdset="0">
164 <size>
165 <width>40</width>
166 <height>20</height>
167 </size>
168 </property>
169 </spacer>
170 </item>
171 </layout>
172 </widget>
173 </item>
174 <item>
175 <spacer name="verticalSpacer">
176 <property name="orientation">
177 <enum>Qt::Vertical</enum>
178 </property>
179 <property name="sizeHint" stdset="0">
180 <size>
181 <width>20</width>
182 <height>40</height>
183 </size>
184 </property>
185 </spacer>
186 </item>
187 </layout>
188 </widget>
189 <resources/>
190 <connections/>
191</ui>
0192
=== added file 'data/qt/reset_password.ui'
--- data/qt/reset_password.ui 1970-01-01 00:00:00 +0000
+++ data/qt/reset_password.ui 2011-06-24 19:23:07 +0000
@@ -0,0 +1,109 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<ui version="4.0">
3 <class>ResetPasswordPage</class>
4 <widget class="QWizardPage" name="ResetPasswordPage">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>476</width>
10 <height>282</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>WizardPage</string>
15 </property>
16 <layout class="QVBoxLayout" name="verticalLayout">
17 <item>
18 <layout class="QHBoxLayout" name="horizontalLayout">
19 <item>
20 <spacer name="horizontalSpacer_2">
21 <property name="orientation">
22 <enum>Qt::Horizontal</enum>
23 </property>
24 <property name="sizeHint" stdset="0">
25 <size>
26 <width>40</width>
27 <height>20</height>
28 </size>
29 </property>
30 </spacer>
31 </item>
32 <item>
33 <layout class="QVBoxLayout" name="verticalLayout_2">
34 <item>
35 <widget class="QLineEdit" name="reset_code_line_edit"/>
36 </item>
37 <item>
38 <widget class="QLineEdit" name="password_line_edit">
39 <property name="echoMode">
40 <enum>QLineEdit::Password</enum>
41 </property>
42 </widget>
43 </item>
44 <item>
45 <widget class="QLineEdit" name="confirm_password_line_edit">
46 <property name="echoMode">
47 <enum>QLineEdit::Password</enum>
48 </property>
49 </widget>
50 </item>
51 <item>
52 <layout class="QHBoxLayout" name="horizontalLayout_3">
53 <item>
54 <spacer name="horizontalSpacer_4">
55 <property name="orientation">
56 <enum>Qt::Horizontal</enum>
57 </property>
58 <property name="sizeHint" stdset="0">
59 <size>
60 <width>40</width>
61 <height>20</height>
62 </size>
63 </property>
64 </spacer>
65 </item>
66 <item>
67 <widget class="QPushButton" name="reset_password_button">
68 <property name="text">
69 <string/>
70 </property>
71 </widget>
72 </item>
73 </layout>
74 </item>
75 <item>
76 <spacer name="verticalSpacer">
77 <property name="orientation">
78 <enum>Qt::Vertical</enum>
79 </property>
80 <property name="sizeHint" stdset="0">
81 <size>
82 <width>379</width>
83 <height>222</height>
84 </size>
85 </property>
86 </spacer>
87 </item>
88 </layout>
89 </item>
90 <item>
91 <spacer name="horizontalSpacer">
92 <property name="orientation">
93 <enum>Qt::Horizontal</enum>
94 </property>
95 <property name="sizeHint" stdset="0">
96 <size>
97 <width>40</width>
98 <height>20</height>
99 </size>
100 </property>
101 </spacer>
102 </item>
103 </layout>
104 </item>
105 </layout>
106 </widget>
107 <resources/>
108 <connections/>
109</ui>
0110
=== added file 'data/qt/setup_account.ui'
--- data/qt/setup_account.ui 1970-01-01 00:00:00 +0000
+++ data/qt/setup_account.ui 2011-06-24 19:23:07 +0000
@@ -0,0 +1,290 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<ui version="4.0">
3 <class>SetUpAccountPage</class>
4 <widget class="QWizardPage" name="SetUpAccountPage">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>407</width>
10 <height>453</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>WizardPage</string>
15 </property>
16 <layout class="QHBoxLayout" name="horizontalLayout">
17 <item>
18 <layout class="QVBoxLayout" name="verticalLayout">
19 <item>
20 <spacer name="verticalSpacer_3">
21 <property name="orientation">
22 <enum>Qt::Vertical</enum>
23 </property>
24 <property name="sizeHint" stdset="0">
25 <size>
26 <width>20</width>
27 <height>40</height>
28 </size>
29 </property>
30 </spacer>
31 </item>
32 <item>
33 <widget class="QFrame" name="_signInFrame">
34 <property name="frameShape">
35 <enum>QFrame::NoFrame</enum>
36 </property>
37 <layout class="QVBoxLayout" name="verticalLayout_3">
38 <item>
39 <layout class="QVBoxLayout" name="verticalLayout_2">
40 <item>
41 <widget class="QLabel" name="password_info_label">
42 <property name="sizePolicy">
43 <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
44 <horstretch>0</horstretch>
45 <verstretch>0</verstretch>
46 </sizepolicy>
47 </property>
48 <property name="text">
49 <string/>
50 </property>
51 <property name="wordWrap">
52 <bool>true</bool>
53 </property>
54 </widget>
55 </item>
56 <item>
57 <layout class="QVBoxLayout" name="verticalLayout_4">
58 <item>
59 <widget class="QLabel" name="name_label">
60 <property name="text">
61 <string/>
62 </property>
63 </widget>
64 </item>
65 <item>
66 <widget class="QLineEdit" name="name_edit">
67 <property name="placeholderText">
68 <string/>
69 </property>
70 </widget>
71 </item>
72 <item>
73 <widget class="QLabel" name="email_label">
74 <property name="text">
75 <string/>
76 </property>
77 </widget>
78 </item>
79 <item>
80 <widget class="QLineEdit" name="email_edit">
81 <property name="placeholderText">
82 <string/>
83 </property>
84 </widget>
85 </item>
86 <item>
87 <widget class="QLabel" name="confirm_email_label">
88 <property name="text">
89 <string/>
90 </property>
91 </widget>
92 </item>
93 <item>
94 <widget class="QLineEdit" name="confirm_email_edit">
95 <property name="placeholderText">
96 <string/>
97 </property>
98 </widget>
99 </item>
100 <item>
101 <widget class="QLabel" name="password_label">
102 <property name="text">
103 <string/>
104 </property>
105 </widget>
106 </item>
107 <item>
108 <widget class="QLineEdit" name="password_edit">
109 <property name="toolTip">
110 <string>Your password must be at least 8 characters long and at least contain one number and one upper later.</string>
111 </property>
112 <property name="statusTip">
113 <string/>
114 </property>
115 <property name="echoMode">
116 <enum>QLineEdit::Password</enum>
117 </property>
118 <property name="placeholderText">
119 <string/>
120 </property>
121 </widget>
122 </item>
123 <item>
124 <widget class="QLabel" name="confirm_password_label">
125 <property name="text">
126 <string/>
127 </property>
128 </widget>
129 </item>
130 <item>
131 <widget class="QLineEdit" name="confirm_password_edit">
132 <property name="echoMode">
133 <enum>QLineEdit::Password</enum>
134 </property>
135 <property name="placeholderText">
136 <string/>
137 </property>
138 </widget>
139 </item>
140 </layout>
141 </item>
142 <item>
143 <layout class="QVBoxLayout" name="verticalLayout_9">
144 <item>
145 <widget class="QFrame" name="frame_2">
146 <property name="sizePolicy">
147 <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
148 <horstretch>0</horstretch>
149 <verstretch>0</verstretch>
150 </sizepolicy>
151 </property>
152 <property name="frameShape">
153 <enum>QFrame::StyledPanel</enum>
154 </property>
155 <property name="frameShadow">
156 <enum>QFrame::Raised</enum>
157 </property>
158 <layout class="QHBoxLayout" name="horizontalLayout_16">
159 <property name="leftMargin">
160 <number>0</number>
161 </property>
162 <item>
163 <widget class="QLabel" name="captcha_view">
164 <property name="minimumSize">
165 <size>
166 <width>0</width>
167 <height>57</height>
168 </size>
169 </property>
170 <property name="frameShape">
171 <enum>QFrame::Box</enum>
172 </property>
173 <property name="text">
174 <string/>
175 </property>
176 </widget>
177 </item>
178 <item>
179 <widget class="QLabel" name="refresh_label">
180 <property name="sizePolicy">
181 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
182 <horstretch>0</horstretch>
183 <verstretch>0</verstretch>
184 </sizepolicy>
185 </property>
186 <property name="locale">
187 <locale language="English" country="UnitedStates"/>
188 </property>
189 <property name="text">
190 <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
191&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
192p, li { white-space: pre-wrap; }
193&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
194&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;If you can't read this then &lt;/span&gt;&lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt; this page&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
195 </property>
196 <property name="wordWrap">
197 <bool>true</bool>
198 </property>
199 </widget>
200 </item>
201 </layout>
202 </widget>
203 </item>
204 <item>
205 <widget class="QLineEdit" name="captcha_solution_edit">
206 <property name="locale">
207 <locale language="English" country="UnitedStates"/>
208 </property>
209 <property name="inputMask">
210 <string/>
211 </property>
212 <property name="text">
213 <string/>
214 </property>
215 <property name="placeholderText">
216 <string/>
217 </property>
218 </widget>
219 </item>
220 </layout>
221 </item>
222 <item>
223 <widget class="QCheckBox" name="terms_checkbox">
224 <property name="text">
225 <string/>
226 </property>
227 </widget>
228 </item>
229 <item>
230 <layout class="QHBoxLayout" name="horizontalLayout_4">
231 <property name="spacing">
232 <number>0</number>
233 </property>
234 <item>
235 <widget class="QPushButton" name="terms_button">
236 <property name="text">
237 <string/>
238 </property>
239 </widget>
240 </item>
241 <item>
242 <spacer name="horizontalSpacer_3">
243 <property name="orientation">
244 <enum>Qt::Horizontal</enum>
245 </property>
246 <property name="sizeHint" stdset="0">
247 <size>
248 <width>40</width>
249 <height>20</height>
250 </size>
251 </property>
252 </spacer>
253 </item>
254 <item>
255 <widget class="QPushButton" name="set_up_button">
256 <property name="enabled">
257 <bool>false</bool>
258 </property>
259 <property name="text">
260 <string/>
261 </property>
262 </widget>
263 </item>
264 </layout>
265 </item>
266 </layout>
267 </item>
268 </layout>
269 </widget>
270 </item>
271 <item>
272 <spacer name="verticalSpacer_2">
273 <property name="orientation">
274 <enum>Qt::Vertical</enum>
275 </property>
276 <property name="sizeHint" stdset="0">
277 <size>
278 <width>20</width>
279 <height>40</height>
280 </size>
281 </property>
282 </spacer>
283 </item>
284 </layout>
285 </item>
286 </layout>
287 </widget>
288 <resources/>
289 <connections/>
290</ui>
0291
=== added file 'data/qt/success_message.ui'
--- data/qt/success_message.ui 1970-01-01 00:00:00 +0000
+++ data/qt/success_message.ui 2011-06-24 19:23:07 +0000
@@ -0,0 +1,31 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<ui version="4.0">
3 <class>SuccessPage</class>
4 <widget class="QWizardPage" name="SuccessPage">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>400</width>
10 <height>300</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>WizardPage</string>
15 </property>
16 <layout class="QVBoxLayout" name="verticalLayout">
17 <item>
18 <widget class="QLabel" name="success_message_label">
19 <property name="text">
20 <string>TextLabel</string>
21 </property>
22 <property name="alignment">
23 <set>Qt::AlignCenter</set>
24 </property>
25 </widget>
26 </item>
27 </layout>
28 </widget>
29 <resources/>
30 <connections/>
31</ui>
032
=== added file 'data/qt/terms_and_conditions.ui'
--- data/qt/terms_and_conditions.ui 1970-01-01 00:00:00 +0000
+++ data/qt/terms_and_conditions.ui 2011-06-24 19:23:07 +0000
@@ -0,0 +1,128 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<ui version="4.0">
3 <class>TosPage</class>
4 <widget class="QWizardPage" name="TosPage">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>400</width>
10 <height>300</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>WizardPage</string>
15 </property>
16 <layout class="QHBoxLayout" name="horizontalLayout">
17 <item>
18 <layout class="QHBoxLayout" name="horizontalLayout_3">
19 <item>
20 <spacer name="horizontalSpacer_2">
21 <property name="orientation">
22 <enum>Qt::Horizontal</enum>
23 </property>
24 <property name="sizeType">
25 <enum>QSizePolicy::Fixed</enum>
26 </property>
27 <property name="sizeHint" stdset="0">
28 <size>
29 <width>40</width>
30 <height>20</height>
31 </size>
32 </property>
33 </spacer>
34 </item>
35 <item>
36 <layout class="QVBoxLayout" name="verticalLayout">
37 <item>
38 <spacer name="verticalSpacer_3">
39 <property name="orientation">
40 <enum>Qt::Vertical</enum>
41 </property>
42 <property name="sizeType">
43 <enum>QSizePolicy::Fixed</enum>
44 </property>
45 <property name="sizeHint" stdset="0">
46 <size>
47 <width>20</width>
48 <height>40</height>
49 </size>
50 </property>
51 </spacer>
52 </item>
53 <item>
54 <widget class="QScrollArea" name="scrollArea">
55 <property name="widgetResizable">
56 <bool>true</bool>
57 </property>
58 <widget class="QWidget" name="scrollAreaWidgetContents">
59 <property name="geometry">
60 <rect>
61 <x>0</x>
62 <y>0</y>
63 <width>284</width>
64 <height>184</height>
65 </rect>
66 </property>
67 <layout class="QHBoxLayout" name="horizontalLayout_2">
68 <item>
69 <widget class="QWebView" name="terms_webkit">
70 <property name="url">
71 <url>
72 <string>about:blank</string>
73 </url>
74 </property>
75 </widget>
76 </item>
77 </layout>
78 </widget>
79 </widget>
80 </item>
81 <item>
82 <spacer name="verticalSpacer_2">
83 <property name="orientation">
84 <enum>Qt::Vertical</enum>
85 </property>
86 <property name="sizeType">
87 <enum>QSizePolicy::Fixed</enum>
88 </property>
89 <property name="sizeHint" stdset="0">
90 <size>
91 <width>20</width>
92 <height>40</height>
93 </size>
94 </property>
95 </spacer>
96 </item>
97 </layout>
98 </item>
99 <item>
100 <spacer name="horizontalSpacer">
101 <property name="orientation">
102 <enum>Qt::Horizontal</enum>
103 </property>
104 <property name="sizeType">
105 <enum>QSizePolicy::Fixed</enum>
106 </property>
107 <property name="sizeHint" stdset="0">
108 <size>
109 <width>40</width>
110 <height>20</height>
111 </size>
112 </property>
113 </spacer>
114 </item>
115 </layout>
116 </item>
117 </layout>
118 </widget>
119 <customwidgets>
120 <customwidget>
121 <class>QWebView</class>
122 <extends>QWidget</extends>
123 <header>QtWebKit/QWebView</header>
124 </customwidget>
125 </customwidgets>
126 <resources/>
127 <connections/>
128</ui>
0129
=== removed file 'data/ui.glade'
--- data/ui.glade 2010-11-30 13:21:17 +0000
+++ data/ui.glade 1970-01-01 00:00:00 +0000
@@ -1,786 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<interface>
3 <requires lib="gtk+" version="2.16"/>
4 <!-- interface-naming-policy project-wide -->
5 <object class="GtkWindow" id="window">
6 <property name="border_width">10</property>
7 <property name="window_position">center</property>
8 <signal name="delete_event" handler="on_close_clicked"/>
9 <child>
10 <object class="GtkVBox" id="window_vbox">
11 <property name="visible">True</property>
12 <property name="spacing">5</property>
13 <child>
14 <object class="GtkLabel" id="header_label">
15 <property name="visible">True</property>
16 <property name="xalign">0</property>
17 <property name="label" translatable="yes">Header Label </property>
18 <property name="wrap">True</property>
19 </object>
20 <packing>
21 <property name="expand">False</property>
22 <property name="padding">5</property>
23 <property name="position">0</property>
24 </packing>
25 </child>
26 <child>
27 <object class="GtkLabel" id="help_label">
28 <property name="visible">True</property>
29 <property name="xalign">0</property>
30 <property name="label" translatable="yes">help label</property>
31 <property name="wrap">True</property>
32 </object>
33 <packing>
34 <property name="expand">False</property>
35 <property name="position">1</property>
36 </packing>
37 </child>
38 <child>
39 <object class="GtkLabel" id="warning_label">
40 <property name="visible">True</property>
41 <property name="xalign">0</property>
42 <property name="label" translatable="yes">warning label</property>
43 <property name="wrap">True</property>
44 </object>
45 <packing>
46 <property name="expand">False</property>
47 <property name="position">2</property>
48 </packing>
49 </child>
50 <child>
51 <object class="GtkNotebook" id="content">
52 <property name="visible">True</property>
53 <property name="can_focus">True</property>
54 <property name="show_tabs">False</property>
55 <property name="show_border">False</property>
56 </object>
57 <packing>
58 <property name="position">3</property>
59 </packing>
60 </child>
61 </object>
62 </child>
63 </object>
64 <object class="GtkVBox" id="enter_details_vbox">
65 <property name="visible">True</property>
66 <property name="spacing">5</property>
67 <child>
68 <object class="GtkHBox" id="emails_hbox">
69 <property name="visible">True</property>
70 <property name="spacing">5</property>
71 <property name="homogeneous">True</property>
72 <child>
73 <placeholder/>
74 </child>
75 <child>
76 <placeholder/>
77 </child>
78 </object>
79 <packing>
80 <property name="expand">False</property>
81 <property name="position">0</property>
82 </packing>
83 </child>
84 <child>
85 <object class="GtkHBox" id="passwords_hbox">
86 <property name="visible">True</property>
87 <property name="spacing">5</property>
88 <property name="homogeneous">True</property>
89 <child>
90 <placeholder/>
91 </child>
92 <child>
93 <placeholder/>
94 </child>
95 </object>
96 <packing>
97 <property name="expand">False</property>
98 <property name="position">1</property>
99 </packing>
100 </child>
101 <child>
102 <object class="GtkLabel" id="password_help_label">
103 <property name="visible">True</property>
104 <property name="label">password help</property>
105 <property name="wrap">True</property>
106 </object>
107 <packing>
108 <property name="expand">False</property>
109 <property name="position">2</property>
110 </packing>
111 </child>
112 <child>
113 <object class="GtkAlignment" id="alignment5">
114 <property name="visible">True</property>
115 <property name="xscale">0</property>
116 <property name="yscale">0</property>
117 <child>
118 <object class="GtkHBox" id="hbox1">
119 <property name="visible">True</property>
120 <child>
121 <object class="GtkVBox" id="captcha_vbox">
122 <property name="width_request">300</property>
123 <property name="height_request">60</property>
124 <property name="visible">True</property>
125 <child>
126 <object class="GtkEventBox" id="captcha_loading">
127 <property name="width_request">300</property>
128 <property name="height_request">60</property>
129 <property name="visible">True</property>
130 <child>
131 <placeholder/>
132 </child>
133 </object>
134 <packing>
135 <property name="expand">False</property>
136 <property name="fill">False</property>
137 <property name="position">0</property>
138 </packing>
139 </child>
140 <child>
141 <object class="GtkImage" id="captcha_image">
142 <property name="width_request">300</property>
143 <property name="visible">True</property>
144 <property name="stock">gtk-missing-image</property>
145 </object>
146 <packing>
147 <property name="position">1</property>
148 </packing>
149 </child>
150 </object>
151 <packing>
152 <property name="expand">False</property>
153 <property name="fill">False</property>
154 <property name="position">0</property>
155 </packing>
156 </child>
157 <child>
158 <object class="GtkVBox" id="vbox1">
159 <property name="visible">True</property>
160 <child>
161 <object class="GtkButton" id="captcha_reload_button">
162 <property name="visible">True</property>
163 <property name="can_focus">True</property>
164 <property name="receives_default">True</property>
165 <property name="relief">none</property>
166 <property name="focus_on_click">False</property>
167 <signal name="clicked" handler="on_captcha_reload_button_clicked"/>
168 <child>
169 <object class="GtkImage" id="image1">
170 <property name="visible">True</property>
171 <property name="icon_name">reload</property>
172 </object>
173 </child>
174 </object>
175 <packing>
176 <property name="expand">False</property>
177 <property name="position">0</property>
178 </packing>
179 </child>
180 <child>
181 <placeholder/>
182 </child>
183 <child>
184 <placeholder/>
185 </child>
186 </object>
187 <packing>
188 <property name="expand">False</property>
189 <property name="position">1</property>
190 </packing>
191 </child>
192 </object>
193 </child>
194 </object>
195 <packing>
196 <property name="expand">False</property>
197 <property name="position">3</property>
198 </packing>
199 </child>
200 <child>
201 <object class="GtkVBox" id="captcha_solution_vbox">
202 <property name="visible">True</property>
203 <child>
204 <placeholder/>
205 </child>
206 </object>
207 <packing>
208 <property name="expand">False</property>
209 <property name="position">4</property>
210 </packing>
211 </child>
212 <child>
213 <object class="GtkCheckButton" id="yes_to_updates_checkbutton">
214 <property name="label" translatable="yes">yes to updates</property>
215 <property name="visible">True</property>
216 <property name="can_focus">True</property>
217 <property name="receives_default">False</property>
218 <property name="active">True</property>
219 <property name="draw_indicator">True</property>
220 </object>
221 <packing>
222 <property name="expand">False</property>
223 <property name="position">5</property>
224 </packing>
225 </child>
226 <child>
227 <object class="GtkVBox" id="tc_vbox">
228 <property name="visible">True</property>
229 <property name="spacing">5</property>
230 <child>
231 <object class="GtkCheckButton" id="yes_to_tc_checkbutton">
232 <property name="label" translatable="yes">yes to tc</property>
233 <property name="visible">True</property>
234 <property name="can_focus">True</property>
235 <property name="receives_default">False</property>
236 <property name="active">True</property>
237 <property name="draw_indicator">True</property>
238 </object>
239 <packing>
240 <property name="expand">False</property>
241 <property name="position">0</property>
242 </packing>
243 </child>
244 <child>
245 <object class="GtkHButtonBox" id="hbuttonbox3">
246 <property name="visible">True</property>
247 <property name="layout_style">start</property>
248 <child>
249 <object class="GtkButton" id="tc_button">
250 <property name="label">show tc</property>
251 <property name="visible">True</property>
252 <property name="can_focus">True</property>
253 <property name="receives_default">True</property>
254 <signal name="clicked" handler="on_tc_button_clicked"/>
255 </object>
256 <packing>
257 <property name="expand">False</property>
258 <property name="fill">False</property>
259 <property name="position">1</property>
260 </packing>
261 </child>
262 </object>
263 <packing>
264 <property name="expand">False</property>
265 <property name="position">1</property>
266 </packing>
267 </child>
268 <child>
269 <object class="GtkLabel" id="tc_warning_label">
270 <property name="visible">True</property>
271 <property name="xalign">0</property>
272 <property name="label">tc warning</property>
273 <property name="wrap">True</property>
274 </object>
275 <packing>
276 <property name="position">2</property>
277 </packing>
278 </child>
279 </object>
280 <packing>
281 <property name="expand">False</property>
282 <property name="position">6</property>
283 </packing>
284 </child>
285 <child>
286 <object class="GtkHBox" id="hbox2">
287 <property name="visible">True</property>
288 <property name="spacing">5</property>
289 <child>
290 <object class="GtkHButtonBox" id="hbuttonbox9">
291 <property name="visible">True</property>
292 <property name="layout_style">start</property>
293 <child>
294 <object class="GtkLinkButton" id="login_button">
295 <property name="label">login button</property>
296 <property name="visible">True</property>
297 <property name="can_focus">True</property>
298 <property name="receives_default">True</property>
299 <property name="relief">none</property>
300 <signal name="clicked" handler="on_sign_in_button_clicked"/>
301 </object>
302 <packing>
303 <property name="expand">False</property>
304 <property name="fill">False</property>
305 <property name="position">0</property>
306 </packing>
307 </child>
308 </object>
309 <packing>
310 <property name="expand">False</property>
311 <property name="position">0</property>
312 </packing>
313 </child>
314 <child>
315 <object class="GtkHButtonBox" id="hbuttonbox1">
316 <property name="visible">True</property>
317 <property name="spacing">5</property>
318 <property name="layout_style">end</property>
319 <child>
320 <object class="GtkButton" id="join_cancel_button">
321 <property name="label">gtk-cancel</property>
322 <property name="visible">True</property>
323 <property name="can_focus">True</property>
324 <property name="receives_default">True</property>
325 <property name="use_stock">True</property>
326 </object>
327 <packing>
328 <property name="expand">False</property>
329 <property name="fill">False</property>
330 <property name="position">0</property>
331 </packing>
332 </child>
333 <child>
334 <object class="GtkButton" id="join_ok_button">
335 <property name="label">gtk-go-forward</property>
336 <property name="visible">True</property>
337 <property name="can_focus">True</property>
338 <property name="receives_default">True</property>
339 <property name="use_stock">True</property>
340 <signal name="clicked" handler="on_join_ok_button_clicked"/>
341 </object>
342 <packing>
343 <property name="expand">False</property>
344 <property name="fill">False</property>
345 <property name="position">1</property>
346 </packing>
347 </child>
348 </object>
349 <packing>
350 <property name="expand">False</property>
351 <property name="pack_type">end</property>
352 <property name="position">1</property>
353 </packing>
354 </child>
355 </object>
356 <packing>
357 <property name="expand">False</property>
358 <property name="pack_type">end</property>
359 <property name="position">7</property>
360 </packing>
361 </child>
362 </object>
363 <object class="GtkVBox" id="processing_vbox">
364 <property name="visible">True</property>
365 <property name="spacing">10</property>
366 <child>
367 <placeholder/>
368 </child>
369 </object>
370 <object class="GtkVBox" id="verify_email_vbox">
371 <property name="visible">True</property>
372 <property name="spacing">10</property>
373 <child>
374 <object class="GtkAlignment" id="alignment4">
375 <property name="visible">True</property>
376 <property name="xscale">0</property>
377 <property name="yscale">0</property>
378 <child>
379 <object class="GtkVBox" id="verify_email_details_vbox">
380 <property name="visible">True</property>
381 <child>
382 <placeholder/>
383 </child>
384 </object>
385 </child>
386 </object>
387 <packing>
388 <property name="position">0</property>
389 </packing>
390 </child>
391 <child>
392 <object class="GtkHButtonBox" id="hbuttonbox2">
393 <property name="visible">True</property>
394 <property name="spacing">5</property>
395 <property name="layout_style">end</property>
396 <child>
397 <object class="GtkButton" id="verify_token_button">
398 <property name="label">gtk-ok</property>
399 <property name="visible">True</property>
400 <property name="can_focus">True</property>
401 <property name="receives_default">True</property>
402 <property name="use_stock">True</property>
403 <signal name="clicked" handler="on_verify_token_button_clicked"/>
404 </object>
405 <packing>
406 <property name="expand">False</property>
407 <property name="fill">False</property>
408 <property name="position">0</property>
409 </packing>
410 </child>
411 </object>
412 <packing>
413 <property name="expand">False</property>
414 <property name="position">1</property>
415 </packing>
416 </child>
417 </object>
418 <object class="GtkVBox" id="tc_browser_vbox">
419 <property name="visible">True</property>
420 <signal name="hide" handler="on_tc_browser_vbox_hide"/>
421 <child>
422 <object class="GtkScrolledWindow" id="tc_browser_window">
423 <property name="visible">True</property>
424 <property name="can_focus">True</property>
425 <property name="border_width">10</property>
426 <property name="hscrollbar_policy">never</property>
427 <property name="vscrollbar_policy">automatic</property>
428 <property name="shadow_type">in</property>
429 <child>
430 <placeholder/>
431 </child>
432 </object>
433 <packing>
434 <property name="position">0</property>
435 </packing>
436 </child>
437 <child>
438 <object class="GtkHButtonBox" id="hbuttonbox4">
439 <property name="visible">True</property>
440 <property name="layout_style">end</property>
441 <child>
442 <object class="GtkButton" id="tc_back_button">
443 <property name="label">gtk-go-back</property>
444 <property name="visible">True</property>
445 <property name="can_focus">True</property>
446 <property name="receives_default">True</property>
447 <property name="use_stock">True</property>
448 <signal name="clicked" handler="on_tc_back_button_clicked"/>
449 </object>
450 <packing>
451 <property name="expand">False</property>
452 <property name="fill">False</property>
453 <property name="position">0</property>
454 </packing>
455 </child>
456 </object>
457 <packing>
458 <property name="expand">False</property>
459 <property name="position">1</property>
460 </packing>
461 </child>
462 </object>
463 <object class="GtkVBox" id="login_vbox">
464 <property name="visible">True</property>
465 <property name="spacing">10</property>
466 <child>
467 <object class="GtkAlignment" id="alignment3">
468 <property name="visible">True</property>
469 <property name="xscale">0</property>
470 <property name="yscale">0</property>
471 <child>
472 <object class="GtkVBox" id="login_details_vbox">
473 <property name="visible">True</property>
474 <property name="spacing">5</property>
475 <child>
476 <placeholder/>
477 </child>
478 <child>
479 <placeholder/>
480 </child>
481 </object>
482 </child>
483 </object>
484 <packing>
485 <property name="position">0</property>
486 </packing>
487 </child>
488 <child>
489 <object class="GtkHBox" id="hbox3">
490 <property name="visible">True</property>
491 <property name="spacing">5</property>
492 <child>
493 <object class="GtkHButtonBox" id="hbuttonbox10">
494 <property name="visible">True</property>
495 <property name="layout_style">start</property>
496 <child>
497 <object class="GtkLinkButton" id="forgotten_password_button">
498 <property name="label" translatable="yes">button</property>
499 <property name="visible">True</property>
500 <property name="can_focus">True</property>
501 <property name="receives_default">True</property>
502 <property name="has_tooltip">True</property>
503 <property name="relief">none</property>
504 <signal name="clicked" handler="on_forgotten_password_button_clicked"/>
505 </object>
506 <packing>
507 <property name="expand">False</property>
508 <property name="fill">False</property>
509 <property name="padding">10</property>
510 <property name="position">0</property>
511 </packing>
512 </child>
513 </object>
514 <packing>
515 <property name="expand">False</property>
516 <property name="position">0</property>
517 </packing>
518 </child>
519 <child>
520 <object class="GtkHButtonBox" id="hbuttonbox5">
521 <property name="visible">True</property>
522 <property name="spacing">5</property>
523 <property name="layout_style">end</property>
524 <child>
525 <object class="GtkButton" id="login_cancel_button">
526 <property name="label">gtk-cancel</property>
527 <property name="visible">True</property>
528 <property name="can_focus">True</property>
529 <property name="receives_default">True</property>
530 <property name="use_stock">True</property>
531 </object>
532 <packing>
533 <property name="expand">False</property>
534 <property name="fill">False</property>
535 <property name="position">0</property>
536 </packing>
537 </child>
538 <child>
539 <object class="GtkButton" id="login_back_button">
540 <property name="label">gtk-go-back</property>
541 <property name="visible">True</property>
542 <property name="can_focus">True</property>
543 <property name="receives_default">True</property>
544 <property name="use_stock">True</property>
545 <signal name="clicked" handler="on_login_back_button_clicked"/>
546 </object>
547 <packing>
548 <property name="expand">False</property>
549 <property name="fill">False</property>
550 <property name="position">1</property>
551 </packing>
552 </child>
553 <child>
554 <object class="GtkButton" id="login_ok_button">
555 <property name="label">gtk-connect</property>
556 <property name="visible">True</property>
557 <property name="can_focus">True</property>
558 <property name="receives_default">True</property>
559 <property name="use_stock">True</property>
560 <signal name="clicked" handler="on_login_connect_button_clicked"/>
561 </object>
562 <packing>
563 <property name="expand">False</property>
564 <property name="fill">False</property>
565 <property name="position">2</property>
566 </packing>
567 </child>
568 </object>
569 <packing>
570 <property name="expand">False</property>
571 <property name="pack_type">end</property>
572 <property name="position">1</property>
573 </packing>
574 </child>
575 </object>
576 <packing>
577 <property name="expand">False</property>
578 <property name="position">1</property>
579 </packing>
580 </child>
581 </object>
582 <object class="GtkVBox" id="request_password_token_vbox">
583 <property name="visible">True</property>
584 <property name="spacing">10</property>
585 <child>
586 <object class="GtkAlignment" id="alignment2">
587 <property name="visible">True</property>
588 <property name="xscale">0</property>
589 <property name="yscale">0</property>
590 <child>
591 <object class="GtkVBox" id="request_password_token_details_vbox">
592 <property name="visible">True</property>
593 <property name="spacing">5</property>
594 <child>
595 <placeholder/>
596 </child>
597 </object>
598 </child>
599 </object>
600 <packing>
601 <property name="position">0</property>
602 </packing>
603 </child>
604 <child>
605 <object class="GtkHButtonBox" id="hbuttonbox7">
606 <property name="visible">True</property>
607 <property name="spacing">5</property>
608 <property name="layout_style">end</property>
609 <child>
610 <object class="GtkButton" id="request_password_token_cancel_button">
611 <property name="label">gtk-cancel</property>
612 <property name="visible">True</property>
613 <property name="can_focus">True</property>
614 <property name="receives_default">True</property>
615 <property name="use_stock">True</property>
616 </object>
617 <packing>
618 <property name="expand">False</property>
619 <property name="fill">False</property>
620 <property name="position">0</property>
621 </packing>
622 </child>
623 <child>
624 <object class="GtkButton" id="request_password_token_back_button">
625 <property name="label">gtk-go-back</property>
626 <property name="visible">True</property>
627 <property name="can_focus">True</property>
628 <property name="receives_default">True</property>
629 <property name="use_stock">True</property>
630 <signal name="clicked" handler="on_request_password_token_back_button_clicked"/>
631 </object>
632 <packing>
633 <property name="expand">False</property>
634 <property name="fill">False</property>
635 <property name="position">1</property>
636 </packing>
637 </child>
638 <child>
639 <object class="GtkButton" id="request_password_token_ok_button">
640 <property name="label">gtk-ok</property>
641 <property name="visible">True</property>
642 <property name="can_focus">True</property>
643 <property name="receives_default">True</property>
644 <property name="use_stock">True</property>
645 <signal name="clicked" handler="on_request_password_token_ok_button_clicked"/>
646 </object>
647 <packing>
648 <property name="expand">False</property>
649 <property name="fill">False</property>
650 <property name="position">2</property>
651 </packing>
652 </child>
653 </object>
654 <packing>
655 <property name="expand">False</property>
656 <property name="position">1</property>
657 </packing>
658 </child>
659 </object>
660 <object class="GtkVBox" id="set_new_password_vbox">
661 <property name="visible">True</property>
662 <property name="spacing">10</property>
663 <child>
664 <object class="GtkVBox" id="vbox2">
665 <property name="visible">True</property>
666 <child>
667 <object class="GtkLabel" id="reset_password_help_label">
668 <property name="visible">True</property>
669 <property name="label">label</property>
670 <property name="wrap">True</property>
671 </object>
672 <packing>
673 <property name="expand">False</property>
674 <property name="position">0</property>
675 </packing>
676 </child>
677 <child>
678 <object class="GtkAlignment" id="alignment1">
679 <property name="visible">True</property>
680 <property name="xscale">0</property>
681 <property name="yscale">0</property>
682 <child>
683 <object class="GtkVBox" id="set_new_password_details_vbox">
684 <property name="visible">True</property>
685 <property name="spacing">5</property>
686 <child>
687 <placeholder/>
688 </child>
689 <child>
690 <placeholder/>
691 </child>
692 <child>
693 <placeholder/>
694 </child>
695 </object>
696 </child>
697 </object>
698 <packing>
699 <property name="position">1</property>
700 </packing>
701 </child>
702 </object>
703 <packing>
704 <property name="position">0</property>
705 </packing>
706 </child>
707 <child>
708 <object class="GtkHButtonBox" id="hbuttonbox6">
709 <property name="visible">True</property>
710 <property name="spacing">5</property>
711 <property name="layout_style">end</property>
712 <child>
713 <object class="GtkButton" id="set_new_password_cancel_button">
714 <property name="label">gtk-cancel</property>
715 <property name="visible">True</property>
716 <property name="can_focus">True</property>
717 <property name="receives_default">True</property>
718 <property name="use_stock">True</property>
719 </object>
720 <packing>
721 <property name="expand">False</property>
722 <property name="fill">False</property>
723 <property name="position">0</property>
724 </packing>
725 </child>
726 <child>
727 <object class="GtkButton" id="set_new_password_ok_button">
728 <property name="label">gtk-ok</property>
729 <property name="visible">True</property>
730 <property name="can_focus">True</property>
731 <property name="receives_default">True</property>
732 <property name="use_stock">True</property>
733 <signal name="clicked" handler="on_set_new_password_ok_button_clicked"/>
734 </object>
735 <packing>
736 <property name="expand">False</property>
737 <property name="fill">False</property>
738 <property name="position">1</property>
739 </packing>
740 </child>
741 </object>
742 <packing>
743 <property name="expand">False</property>
744 <property name="position">1</property>
745 </packing>
746 </child>
747 </object>
748 <object class="GtkVBox" id="finish_vbox">
749 <property name="visible">True</property>
750 <property name="spacing">10</property>
751 <child>
752 <object class="GtkLabel" id="finish_label">
753 <property name="visible">True</property>
754 <property name="wrap">True</property>
755 </object>
756 <packing>
757 <property name="position">0</property>
758 </packing>
759 </child>
760 <child>
761 <object class="GtkHButtonBox" id="hbuttonbox8">
762 <property name="visible">True</property>
763 <property name="layout_style">end</property>
764 <child>
765 <object class="GtkButton" id="finish_close_button">
766 <property name="label">gtk-close</property>
767 <property name="visible">True</property>
768 <property name="can_focus">True</property>
769 <property name="receives_default">True</property>
770 <property name="use_stock">True</property>
771 <signal name="clicked" handler="on_close_clicked"/>
772 </object>
773 <packing>
774 <property name="expand">False</property>
775 <property name="fill">False</property>
776 <property name="position">0</property>
777 </packing>
778 </child>
779 </object>
780 <packing>
781 <property name="expand">False</property>
782 <property name="position">1</property>
783 </packing>
784 </child>
785 </object>
786</interface>
7870
=== modified file 'debian/changelog'
--- debian/changelog 2011-06-21 15:23:34 +0000
+++ debian/changelog 2011-06-24 19:23:07 +0000
@@ -1,3 +1,14 @@
1ubuntu-sso-client (1.3.1-0ubuntu1) oneiric; urgency=low
2
3 * New upstream release.
4 - Invalid signature for CreateItem call (LP: #745540)
5 - Never sees NetworkManager connection (LP: #791548)
6 - Support new property names in secrets API (LP: #800294)
7 - Deprecated DBus interfaces not marked as such (LP: #770269)
8 * Update the watch file to point at the correct place.
9
10 -- Rodney Dawes <rodney.dawes@ubuntu.com> Fri, 24 Jun 2011 15:14:18 -0400
11
1ubuntu-sso-client (1.2.1-0ubuntu3) oneiric; urgency=low12ubuntu-sso-client (1.2.1-0ubuntu3) oneiric; urgency=low
213
3 [ Michael Vogt ]14 [ Michael Vogt ]
415
=== modified file 'debian/watch'
--- debian/watch 2011-03-30 20:39:13 +0000
+++ debian/watch 2011-06-24 19:23:07 +0000
@@ -1,3 +1,3 @@
1version=31version=3
2http://launchpad.net/ubuntu-sso-client/+download?start=20 .*/ubuntu-sso-client-(1\.2\.[0-9]+)\.tar\.gz2http://launchpad.net/ubuntu-sso-client/+download .*/ubuntu-sso-client-([0-9.]+)\.tar\.gz
33
44
=== modified file 'pylintrc'
--- pylintrc 2011-04-12 16:42:48 +0000
+++ pylintrc 2011-06-24 19:23:07 +0000
@@ -20,7 +20,7 @@
2020
21# Add <file or directory> to the black list. It should be a base name, not a21# Add <file or directory> to the black list. It should be a base name, not a
22# path. You may set this option multiple times.22# path. You may set this option multiple times.
23#ignore=<somedir>23#ignore=qt
2424
25# Pickle collected data for later comparisons.25# Pickle collected data for later comparisons.
26persistent=no26persistent=no
2727
=== modified file 'run-tests'
--- run-tests 2011-03-22 23:29:20 +0000
+++ run-tests 2011-06-24 19:23:07 +0000
@@ -1,4 +1,5 @@
1#!/bin/bash1#! /bin/bash
2#
2# Author: Natalia Bidart <natalia.bidart@canonical.com>3# Author: Natalia Bidart <natalia.bidart@canonical.com>
3#4#
4# Copyright 2010 Canonical Ltd.5# Copyright 2010 Canonical Ltd.
@@ -15,8 +16,10 @@
15# You should have received a copy of the GNU General Public License along16# You should have received a copy of the GNU General Public License along
16# with this program. If not, see <http://www.gnu.org/licenses/>.17# with this program. If not, see <http://www.gnu.org/licenses/>.
1718
19set -e
20
18if [ $# -ne 0 ]; then21if [ $# -ne 0 ]; then
19 # an extra argument was given22 # run specific module given by the caller
20 MODULE="$@"23 MODULE="$@"
21else24else
22 # run all tests, useful for tarmac and reviews25 # run all tests, useful for tarmac and reviews
@@ -32,6 +35,9 @@
32 fi35 fi
33}36}
3437
38unset GTK_MODULES
39
35echo "Running test suite for ""$MODULE"40echo "Running test suite for ""$MODULE"
36`which xvfb-run` u1trial "$MODULE" -i "test_windows.py" && style_check41`which xvfb-run` u1trial "$MODULE" -i "test_windows.py, test_qt_views.py"
42style_check
37rm -rf _trial_temp43rm -rf _trial_temp
3844
=== modified file 'run-tests.bat'
--- run-tests.bat 2011-03-22 23:29:20 +0000
+++ run-tests.bat 2011-06-24 19:23:07 +0000
@@ -16,7 +16,7 @@
16@ECHO off16@ECHO off
17:: We could have Python 2.6 or 2.7 on Windows. In order to check availability,17:: We could have Python 2.6 or 2.7 on Windows. In order to check availability,
18:: we should first check for 2.7, and run the tests, otherwise fall back to 2.6.18:: we should first check for 2.7, and run the tests, otherwise fall back to 2.6.
19SET PYTHONPATH=""19SET PYTHONEXEPATH=""
20:: This is very annoying; FOR /F will work differently depending on the output20:: This is very annoying; FOR /F will work differently depending on the output
21:: of reg which is not consistent between OS versions (XP, 7). We must choose21:: of reg which is not consistent between OS versions (XP, 7). We must choose
22:: the tokens according to OS version.22:: the tokens according to OS version.
@@ -25,40 +25,48 @@
25IF %ERRORLEVEL% == 0 SET PYTHONPATHTOKENS=425IF %ERRORLEVEL% == 0 SET PYTHONPATHTOKENS=4
26ECHO Checking if python 2.7 is in the system26ECHO Checking if python 2.7 is in the system
27:: Look for python 2.727:: Look for python 2.7
28FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONPATH=%%A28FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A
29IF NOT %PYTHONPATH% == "" GOTO :PYTHONPRESENT29IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT
30ECHO Checking if python 2.6 is in the system30ECHO Checking if python 2.6 is in the system
31:: we do not have python 2.7 in the system, try to find 2.631:: we do not have python 2.7 in the system, try to find 2.6
32FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONPATH=%%A32FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A
33IF NOT %PYTHONPATH% == "" GOTO :PYTHONPRESENT33IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT
3434
35:: we do not have python (2.6 or 2.7) this could hapen in the case that the35:: we do not have python (2.6 or 2.7) this could hapen in the case that the
36:: user installed the 32version in a 64 machine, let check if the software was installed in the wow key36:: user installed the 32version in a 64 machine, let check if the software was installed in the wow key
3737
38:: Look for python 2.7 in WoW6438:: Look for python 2.7 in WoW64
39ECHO Checking if python 2.7 32 is in the system39ECHO Checking if python 2.7 32 is in the system
40FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONPATH=%%A40FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A
41IF NOT %PYTHONPATH% == "" GOTO :PYTHONPRESENT41IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT
42ECHO Checking if python 2.6 32 is in the system42ECHO Checking if python 2.6 32 is in the system
43:: we do not have python 2.7 in the system, try to find 2.643:: we do not have python 2.7 in the system, try to find 2.6
44FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONPATH=%%A44FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A
45IF NOT %PYTHONPATH% == "" GOTO :PYTHONPRESENT45IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT
4646
47ECHO Please ensure you have python installed47ECHO Please ensure you have python installed
48GOTO :END48GOTO :END
4949
5050
51:PYTHONPRESENT51:PYTHONPRESENT
52ECHO Python found, executing the tests...52ECHO Python found, building auto-generated modules...
53:: call setup.py build so that the qt uic is called
54::START "Build code" /D%CD% /WAIT "%PYTHONEXEPATH%\python.exe" setup.py build
55"%PYTHONEXEPATH%\python.exe" setup.py build
56ECHO Running tests
53:: execute the tests with a number of ignored linux only modules57:: execute the tests with a number of ignored linux only modules
54"%PYTHONPATH%\python.exe" "%PYTHONPATH%\Scripts\u1trial" -c ubuntu_sso -i "test_gui.py, test_linux.py, test_txsecrets.py"58"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1trial" -c ubuntu_sso -i "test_gui.py, test_linux.py, test_txsecrets.py" --reactor=txnp
55"%PYTHONPATH%\python.exe" "%PYTHONPATH%\Scripts\u1lint" ubuntu_sso59:: Clean the build from the setupt.py
60ECHO Cleaning the generated code before running the style checks...
61"%PYTHONEXEPATH%\python.exe" setup.py clean
62ECHO Performing style checks...
63"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1lint" ubuntu_sso
56:: test for style if we can, if pep8 is not present, move to the end64:: test for style if we can, if pep8 is not present, move to the end
57IF EXIST "%PYTHONPATH%Scripts\pep8.exe"65IF EXIST "%PYTHONEXEPATH%\Scripts\pep8.exe"
58"%PYTHONPATH%\Scripts\pep8.exe" --repeat ubuntu_sso66"%PYTHONEXEPATH%\Scripts\pep8.exe" --repeat ubuntu_sso
59ELSE67ELSE
60ECHO Style checks were not done68ECHO Style checks were not done
61:: Delete the temp folders69:: Delete the temp folders
62RMDIR /s /q _trial_temp70RMDIR /s /q _trial_temp
63RMDIR /s /q .coverage71RMDIR /s /q .coverage
64:END
65\ No newline at end of file72\ No newline at end of file
73:END
6674
=== modified file 'setup.py' (properties changed: +x to -x)
--- setup.py 2011-04-12 16:42:48 +0000
+++ setup.py 2011-06-24 19:23:07 +0000
@@ -2,6 +2,7 @@
2# setup.py - Build system for Ubuntu SSO Client package2# setup.py - Build system for Ubuntu SSO Client package
3#3#
4# Author: Natalia B. Bidart <natalia.bidart@canonical.com>4# Author: Natalia B. Bidart <natalia.bidart@canonical.com>
5# Author: Manuel de la Pena <manuel@canonical.com>
5#6#
6# Copyright 2010 Canonical Ltd.7# Copyright 2010 Canonical Ltd.
7#8#
@@ -18,6 +19,7 @@
18# with this program. If not, see <http://www.gnu.org/licenses/>.19# with this program. If not, see <http://www.gnu.org/licenses/>.
19"""setup.py"""20"""setup.py"""
2021
22import cgi
21import os23import os
22import sys24import sys
2325
@@ -31,20 +33,25 @@
31assert DistUtilsExtra.auto.__version__ >= '2.18', \33assert DistUtilsExtra.auto.__version__ >= '2.18', \
32 'needs DistUtilsExtra.auto >= 2.18'34 'needs DistUtilsExtra.auto >= 2.18'
3335
36from distutils import log
37from distutils.command import clean
34from distutils.spawn import find_executable38from distutils.spawn import find_executable
35from distutils.command import clean
3639
37# Defining variables for various rules here, similar to a Makefile.am40# Defining variables for various rules here, similar to a Makefile.am
38CLEANFILES = ['data/com.ubuntu.sso.service', 'po/ubuntu-sso-client.pot',41LINUX_CLEANFILES = ['data/com.ubuntu.sso.service', 'po/ubuntu-sso-client.pot',
39 'MANIFEST']42 'MANIFEST']
4043
4144
45# pylint: disable=W0511
42# This needs some serious cleanup46# This needs some serious cleanup
43class SSOBuild(build_extra.build_extra):47class SSOLinuxBuild(build_extra.build_extra):
44 """Class to build the extra files."""48 """Build the extra files required on Linux.."""
4549
46 description = 'build extra files needed by ubuntu-sso-client'50 description = 'build extra files needed by ubuntu-sso-client'
4751
52 def __init__(self, *args):
53 build_extra.build_extra.__init__(self, *args)
54
48 def run(self):55 def run(self):
49 """Do the build."""56 """Do the build."""
50 sed = find_executable('sed')57 sed = find_executable('sed')
@@ -69,14 +76,14 @@
69 build_extra.build_extra.run(self)76 build_extra.build_extra.run(self)
7077
7178
72class SSOClean(clean.clean):79class SSOLinuxClean(clean.clean):
73 """Class to clean up after the build."""80 """Class to clean up after the build."""
7481
75 description = 'Clean up built files.'82 description = 'Clean up built files.'
7683
77 def run(self):84 def run(self):
78 """Clean up the built files."""85 """Clean up the built files."""
79 for built_file in CLEANFILES:86 for built_file in LINUX_CLEANFILES:
80 if os.path.exists(built_file):87 if os.path.exists(built_file):
81 os.unlink(built_file)88 os.unlink(built_file)
8289
@@ -84,23 +91,304 @@
84 clean.clean.run(self)91 clean.clean.run(self)
8592
8693
87DistUtilsExtra.auto.setup(94class SSOWindowsBuild(build_extra.build_extra):
88 name='ubuntu-sso-client',95 """Build PyQt (.ui) files and resources."""
89 version='1.2.1',96
90 license='GPL v3',97 description = "build PyQt GUIs (.ui) and resources (.qrc)"
91 author='Natalia Bidart',98
92 author_email='natalia.bidart@canonical.com',99 def __init__(self, *args):
93 description='Ubuntu Single Sign-On client',100 build_extra.build_extra.__init__(self, *args)
94 long_description='Desktop service to allow applications to sign in' \101
95 'to Ubuntu services via SSO',102 def compile_ui(self, ui_file, py_file=None):
96 url='https://launchpad.net/ubuntu-sso-client',103 """Compile the .ui files to python modules."""
97 packages=['ubuntu_sso', 'ubuntu_sso.gtk', 'ubuntu_sso.utils',104 # Search for pyuic4 in python bin dir, then in the $Path.
98 'ubuntu_sso.keyring', 'ubuntu_sso.networkstate',105 if py_file is None:
99 'ubuntu_sso.main'],106 # go from the ui_file in the data folder to the
100 data_files=[107 # python file in the qt moodule
101 ('share/dbus-1/services', ['data/com.ubuntu.sso.service']),108 py_file = os.path.split(ui_file)[1]
102 ('lib/ubuntu-sso-client', ['bin/ubuntu-sso-login']),109 py_file = os.path.splitext(py_file)[0] + '_ui.py'
103 ('share/ubuntu-sso-client/data', ['data/ui.glade'])],110 py_file = os.path.join('ubuntu_sso', 'qt', py_file)
104 cmdclass={111 # we indeed want to catch Exception, is ugly but we need it
105 'build' : SSOBuild,112 # pylint: disable=W0703
106 'clean' : SSOClean})113 try:
114 # import the uic compiler from pyqt and generate the .py files
115 # something similar could be done with pyside but that is left
116 # as an exercise for the reader.
117 from PyQt4 import uic
118 fp = open(py_file, 'w')
119 uic.compileUi(ui_file, fp)
120 fp.close()
121 log.info('Compiled %s into %s', ui_file, py_file)
122 except Exception, e:
123 self.warn('Unable to compile user interface %s: %s', py_file, e)
124 if not os.path.exists(py_file) or not file(py_file).read():
125 raise SystemExit(1)
126 return
127 # pylint: enable=W0703
128
129 def compile_rc(self, qrc_file, py_file=None):
130 """Compile the resources that will be included with the project."""
131 import PyQt4
132 # Search for pyuic4 in python bin dir, then in the $Path.
133 if py_file is None:
134 py_file = os.path.split(qrc_file)[1]
135 py_file = os.path.splitext(py_file)[0] + '_rc.py'
136 py_file = os.path.join('ubuntu_sso', 'qt', py_file)
137 path = os.getenv('PATH')
138 os.putenv('PATH', path + ';' + os.path.join(
139 os.path.dirname(PyQt4.__file__),'bin'))
140 if os.system('pyrcc4 "%s" -o "%s"' % (qrc_file, py_file)) > 0:
141 self.warn('Unable to generate python module %s '
142 + 'for resource file %s', py_file, qrc_file)
143 if not os.path.exists(py_file) or not file(py_file).read():
144 raise SystemExit(1)
145 else:
146 log.info('compiled %s into %s' % (qrc_file, py_file))
147 os.putenv('PATH', path)
148
149 def _generate_qrc(self, qrc_file, srcfiles, prefix):
150 """Generate the qrc file for the given src files."""
151 basedir = os.path.dirname(qrc_file)
152 f = open(qrc_file, 'w')
153 try:
154 f.write('<!DOCTYPE RCC><RCC version="1.0">\n')
155 f.write(' <qresource prefix="%s">\n' % cgi.escape(prefix))
156 for e in srcfiles:
157 relpath = e[len(basedir) + 1:]
158 f.write(' <file>%s</file>\n'
159 % cgi.escape(relpath.replace(os.path.sep, '/')))
160 f.write(' </qresource>\n')
161 f.write('</RCC>\n')
162 finally:
163 f.close()
164
165 def build_rc(self, py_file, basedir, prefix='/'):
166 """Generate compiled resource including any files under basedir"""
167 # For details, see http://doc.qt.nokia.com/latest/resources.html
168 qrc_file = os.path.join(basedir, '%s.qrc' % os.path.basename(basedir))
169 srcfiles = [os.path.join(root, e)
170 for root, _dirs, files in os.walk(basedir) for e in files]
171 # NOTE: Here we cannot detect deleted files. In such cases, we need
172 # to remove .qrc manually.
173 try:
174 self._generate_qrc(qrc_file, srcfiles, prefix)
175 self.compile_rc(qrc_file, py_file)
176 finally:
177 os.unlink(qrc_file)
178
179 def run(self):
180 """Execute the command."""
181 self._wrapuic()
182 basepath = os.path.join('data', 'qt')
183 # TODO: build the resource files so that we can include them
184 #self.build_rc(os.path.join(basepath, 'icons_rc.py'),
185 # os.path.join(os.path.dirname(__file__), 'icons'),
186 # '/icons')
187 for dirpath, _, filenames in os.walk(basepath):
188 for filename in filenames:
189 if filename.endswith('.ui'):
190 self.compile_ui(os.path.join(dirpath, filename))
191 elif filename.endswith('.qrc'):
192 self.compile_rc(os.path.join(dirpath, filename))
193
194 # pylint: disable=E1002
195 _wrappeduic = False
196 @classmethod
197 def _wrapuic(cls):
198 """Wrap uic to use gettext's _() in place of tr()"""
199 if cls._wrappeduic:
200 return
201
202 from PyQt4.uic.Compiler import compiler, qtproxies, indenter
203
204 # pylint: disable=C0103
205 class _UICompiler(compiler.UICompiler):
206 """Speciallized compiler for qt .ui files."""
207 def createToplevelWidget(self, classname, widgetname):
208 o = indenter.getIndenter()
209 o.level = 0
210 o.write('from ubuntu_sso.utils.ui import _')
211 return super(_UICompiler, self).createToplevelWidget(classname,
212 widgetname)
213 compiler.UICompiler = _UICompiler
214
215 class _i18n_string(qtproxies.i18n_string):
216 """Provide a trnalated text."""
217
218 def __str__(self):
219 return "_('%s')" % self.string.encode('string-escape')
220
221 qtproxies.i18n_string = _i18n_string
222
223 cls._wrappeduic = True
224 # pylint: enable=C0103
225 # pylint: enable=E1002
226
227class SSOWindowsClean(clean.clean):
228 """Clean the files from a Windows build."""
229
230 description = 'Clean up built files.'
231
232 def run(self):
233 """Clean up the built files."""
234 # remove the generated ui files
235 for dirpath, _, filenames in os.walk(os.path.join('ubuntu_sso', 'qt')):
236 for current_file in filenames:
237 if current_file.endswith('_ui.py') or\
238 current_file.endswith('_rc.py'):
239 os.unlink(os.path.join(dirpath, current_file))
240
241def set_py2exe_paths():
242 """Set the path so that py2exe finds the required modules."""
243 # Pylint does not understand same spaced imports which is what lazr uses
244 # pylint: disable=F0401
245 import lazr
246 import win32com
247 # pylint: enable=F0401
248 try:
249 # pylint: disable=F0401
250 import py2exe.mf as modulefinder
251 # pylint: enable=F0401
252 except ImportError:
253 import modulefinder
254
255 # py2exe 0.6.4 introduced a replacement modulefinder.
256 # This means we have to add package paths there,
257 # not to the built-in one. If this new modulefinder gets
258 # integrated into Python, then we might be able to revert
259 # this some day. If this doesn't work, try import modulefinder
260 for package_path in win32com.__path__[1:]:
261 modulefinder.AddPackagePath("win32com", package_path)
262 for extra_mod in ["win32com.server" ,"win32com.client"]:
263 __import__(extra_mod)
264 module = sys.modules[extra_mod]
265 for module_path in module.__path__[1:]:
266 modulefinder.AddPackagePath(extra_mod, module_path)
267
268 # lazr uses namespaces packages, which does add some problems to py2exe
269 # the following is a way to work arround the issue
270 for path in lazr.__path__:
271 modulefinder.AddPackagePath(__name__, path)
272
273
274def get_py2exe_extension():
275 """Return an extension class of py2exe."""
276 import glob
277 # pylint: disable=F0401
278 from py2exe.build_exe import py2exe as build_exe
279 # pylint: enable=F0401
280
281 # pylint: disable=E1101
282 class MediaCollector(build_exe):
283 """Extension that copies lazr missing data."""
284
285 def __init__(self, *args, **kwargs):
286 """Create a new instance."""
287 build_exe.__init__(self, *args, **kwargs)
288
289 def _add_module_data(self, module_name):
290 """Add the data from a given path."""
291 # Create the media subdir where the
292 # Python files are collected.
293 media = module_name.replace('.', os.path.sep)
294 full = os.path.join(self.collect_dir, media)
295 if not os.path.exists(full):
296 self.mkpath(full)
297
298 # Copy the media files to the collection dir.
299 # Also add the copied file to the list of compiled
300 # files so it will be included in zipfile.
301 module = __import__(module_name, None, None, [''])
302 for path in module.__path__:
303 for f in glob.glob(path + '/*'): # does not like os.path.sep
304 log.info('Copying file %s', f)
305 name = os.path.basename(f)
306 if not os.path.isdir(f):
307 self.copy_file(f, os.path.join(full, name))
308 self.compiled_files.append(os.path.join(media, name))
309 else:
310 self.copy_tree(f, os.path.join(full, name))
311
312 def copy_extensions(self, extensions):
313 """Copy the missing extensions."""
314 build_exe.copy_extensions(self, extensions)
315 for module in ['lazr.uri', 'lazr.restfulclient',
316 'lazr.authentication', 'wadllib']:
317 self._add_module_data(module)
318 # pylint: enable=E1101
319
320 return MediaCollector
321
322def setup_windows():
323 """Provide the required info to setup the project on windows."""
324 set_py2exe_paths()
325 _scripts = []
326 _data_files = []
327 _packages = ['ubuntu_sso', 'ubuntu_sso.qt', 'ubuntu_sso.utils',
328 'ubuntu_sso.keyring', 'ubuntu_sso.networkstate',
329 'ubuntu_sso.main']
330 _extra = {}
331 _cmdclass = {'build' : SSOWindowsBuild,
332 'clean' : SSOWindowsClean,
333 'py2exe' : get_py2exe_extension()}
334
335 # for PyQt, see http://www.py2exe.org/index.cgi/Py2exeAndPyQt
336 _includes = ['sip', 'email', 'ubuntu_sso.qt.gui',
337 'ubuntu_sso.qt.controllers', 'PyQt4.QtNetwork', 'PIL']
338 # exclude the modules that are not part of windows, this will not do much
339 # besides the fact that the warnings wont be returned.
340 _excludes = ['dbus', 'dbus.mainloop.glib', 'osx_keychain', 'gobject',
341 'gnomekeyring']
342
343 _extra['options'] = {
344 'py2exe' : {
345 'bundle_files' : 1,
346 'skip_archive' : 0,
347 'includes' : _includes,
348 'optimize' : 1,
349 'dll_excludes': [ "mswsock.dll", "powrprof.dll" ]
350 }
351 }
352 # add the console script so that py2exe compiles it
353 _extra['console'] = ['bin/windows-ubuntu-sso-login',]
354 _extra['zipfile'] = None
355 return _scripts, _data_files, _packages, _extra, _cmdclass
356
357def setup_linux():
358 """Provide the required info to setup the project on linux."""
359 _scripts = []
360 _data_files = [('share/dbus-1/services', ['data/com.ubuntu.sso.service']),
361 ('lib/ubuntu-sso-client', ['bin/ubuntu-sso-login']),
362 ('share/ubuntu-sso-client/data/gtk', ['data/gtk/ui.glade'])]
363 _packages = ['ubuntu_sso', 'ubuntu_sso.gtk', 'ubuntu_sso.utils',
364 'ubuntu_sso.keyring', 'ubuntu_sso.networkstate',
365 'ubuntu_sso.main']
366 _extra = {}
367 _cmdclass = {'build' : SSOLinuxBuild,
368 'clean' : SSOLinuxClean}
369 return _scripts, _data_files, _packages, _extra, _cmdclass
370
371if __name__ == "__main__":
372
373 # pylint: disable=C0103
374 scripts = data_files = packages = extra = cmdclass = None
375 if sys.platform == 'win32':
376 scripts, data_files, packages, extra, cmdclass = setup_windows()
377 else:
378 scripts, data_files, packages, extra, cmdclass = setup_linux()
379
380 DistUtilsExtra.auto.setup(
381 name='ubuntu-sso-client',
382 version='1.3.1',
383 license='GPL v3',
384 author='Natalia Bidart',
385 author_email='natalia.bidart@canonical.com',
386 description='Ubuntu Single Sign-On client',
387 long_description='Desktop service to allow applications to sign in' \
388 'to Ubuntu services via SSO',
389 url='https://launchpad.net/ubuntu-sso-client',
390 scripts=scripts,
391 data_files=data_files,
392 packages=packages,
393 cmdclass=cmdclass,
394 **extra)
107395
=== modified file 'ubuntu_sso/gtk/gui.py'
--- ubuntu_sso/gtk/gui.py 2011-03-30 20:39:37 +0000
+++ ubuntu_sso/gtk/gui.py 2011-06-24 19:23:07 +0000
@@ -29,9 +29,7 @@
29from functools import wraps29from functools import wraps
3030
31import dbus31import dbus
32import gettext
33import gtk32import gtk
34import xdg
3533
36from dbus.mainloop.glib import DBusGMainLoop34from dbus.mainloop.glib import DBusGMainLoop
37from twisted.internet.defer import inlineCallbacks35from twisted.internet.defer import inlineCallbacks
@@ -39,15 +37,12 @@
39from ubuntu_sso import (DBUS_ACCOUNT_PATH, DBUS_BUS_NAME, DBUS_IFACE_USER_NAME,37from ubuntu_sso import (DBUS_ACCOUNT_PATH, DBUS_BUS_NAME, DBUS_IFACE_USER_NAME,
40 NO_OP)38 NO_OP)
41from ubuntu_sso.logger import setup_logging39from ubuntu_sso.logger import setup_logging
4240from ubuntu_sso.utils.ui import get_data_file, _
4341
44# Instance of 'UbuntuSSOClientGUI' has no 'yyy' member42# Instance of 'UbuntuSSOClientGUI' has no 'yyy' member
45# pylint: disable=E110143# pylint: disable=E1101
4644
4745
48_ = gettext.gettext
49gettext.textdomain('ubuntu-sso-client')
50
51DBusGMainLoop(set_as_default=True)46DBusGMainLoop(set_as_default=True)
52logger = setup_logging('ubuntu_sso.gui')47logger = setup_logging('ubuntu_sso.gui')
5348
@@ -73,38 +68,6 @@
73WARNING_TEXT_COLOR = gtk.gdk.Color("red")68WARNING_TEXT_COLOR = gtk.gdk.Color("red")
7469
7570
76def get_data_dir():
77 """Build absolute path to the 'data' directory."""
78 module = os.path.dirname(__file__)
79 result = os.path.abspath(os.path.join(module, os.pardir,
80 os.pardir, 'data'))
81 logger.debug('get_data_file: trying to load from %r (exists? %s)',
82 result, os.path.exists(result))
83 if os.path.exists(result):
84 logger.info('get_data_file: returning data dir located at %r.', result)
85 return result
86
87 # no local data dir, looking within system data dirs
88 data_dirs = xdg.BaseDirectory.xdg_data_dirs
89 for path in data_dirs:
90 result = os.path.join(path, 'ubuntu-sso-client', 'data')
91 result = os.path.abspath(result)
92 logger.debug('get_data_file: trying to load from %r (exists? %s)',
93 result, os.path.exists(result))
94 if os.path.exists(result):
95 logger.info('get_data_file: data dir located at %r.', result)
96 return result
97 else:
98 msg = 'get_data_file: can not build a valid data path. Giving up.' \
99 '__file__ is %r, data_dirs are %r'
100 logger.error(msg, __file__, data_dirs)
101
102
103def get_data_file(filename):
104 """Build absolute path to 'filename' within the 'data' directory."""
105 return os.path.join(get_data_dir(), filename)
106
107
108def log_call(f):71def log_call(f):
109 """Decorator to log call funtions."""72 """Decorator to log call funtions."""
11073
@@ -265,7 +228,7 @@
265 self.user_email = None228 self.user_email = None
266 self.user_password = None229 self.user_password = None
267230
268 ui_filename = get_data_file('ui.glade')231 ui_filename = get_data_file('gtk', 'ui.glade')
269 builder = gtk.Builder()232 builder = gtk.Builder()
270 builder.add_from_file(ui_filename)233 builder.add_from_file(ui_filename)
271 builder.connect_signals(self)234 builder.connect_signals(self)
272235
=== modified file 'ubuntu_sso/gtk/tests/test_gui.py'
--- ubuntu_sso/gtk/tests/test_gui.py 2011-03-30 20:39:37 +0000
+++ ubuntu_sso/gtk/tests/test_gui.py 2011-06-24 19:23:07 +0000
@@ -1028,6 +1028,8 @@
1028 decision = webkit.WebPolicyDecision()1028 decision = webkit.WebPolicyDecision()
1029 decision.ignore = self._set_called1029 decision.ignore = self._set_called
10301030
1031 self.patch(gui.webbrowser, 'open', lambda *args, **kwargs: None)
1032
1031 kwargs = dict(browser=self.browser, frame=None, request=None,1033 kwargs = dict(browser=self.browser, frame=None, request=None,
1032 action=action, decision=decision)1034 action=action, decision=decision)
1033 self.ui.on_tc_browser_navigation_requested(**kwargs)1035 self.ui.on_tc_browser_navigation_requested(**kwargs)
10341036
=== modified file 'ubuntu_sso/keyring/tests/test_windows.py'
--- ubuntu_sso/keyring/tests/test_windows.py 2011-03-22 23:29:20 +0000
+++ ubuntu_sso/keyring/tests/test_windows.py 2011-06-24 19:23:07 +0000
@@ -19,11 +19,12 @@
19from json import dumps19from json import dumps
20from mocker import MockerTestCase20from mocker import MockerTestCase
21from twisted.internet.defer import inlineCallbacks21from twisted.internet.defer import inlineCallbacks
22from twisted.trial.unittest import TestCase
2223
23from ubuntu_sso.keyring.windows import Keyring, USERNAME24from ubuntu_sso.keyring.windows import Keyring, USERNAME
2425
2526
26class TestWindowsKeyring(MockerTestCase):27class TestWindowsKeyring(MockerTestCase, TestCase):
27 """Test the windows keyring implementation."""28 """Test the windows keyring implementation."""
2829
29 def setUp(self):30 def setUp(self):
@@ -43,7 +44,7 @@
4344
44 @inlineCallbacks45 @inlineCallbacks
45 def test_get_credentials(self):46 def test_get_credentials(self):
46 """Test deleting the credentials."""47 """Test getting the credentials."""
47 app_name = 'name'48 app_name = 'name'
48 password = dict(password='password')49 password = dict(password='password')
49 self.keyring_lib.get_password(app_name, USERNAME)50 self.keyring_lib.get_password(app_name, USERNAME)
@@ -53,6 +54,16 @@
53 self.assertEqual(password, result)54 self.assertEqual(password, result)
5455
55 @inlineCallbacks56 @inlineCallbacks
57 def test_get_credentials_not_present(self):
58 """Test getting creds that are not present."""
59 app_name = 'name'
60 self.keyring_lib.get_password(app_name, USERNAME)
61 self.mocker.result(None)
62 self.mocker.replay()
63 result = yield self.keyring.get_credentials(app_name)
64 self.assertEqual(None, result)
65
66 @inlineCallbacks
56 def test_delete_credentials(self):67 def test_delete_credentials(self):
57 """Test deleting the credentials."""68 """Test deleting the credentials."""
58 app_name = 'name'69 app_name = 'name'
5970
=== modified file 'ubuntu_sso/keyring/windows.py'
--- ubuntu_sso/keyring/windows.py 2011-03-22 23:29:20 +0000
+++ ubuntu_sso/keyring/windows.py 2011-06-24 19:23:07 +0000
@@ -44,7 +44,8 @@
44 def _get_credentials_obj(self, app_name):44 def _get_credentials_obj(self, app_name):
45 """A dict with the credentials."""45 """A dict with the credentials."""
46 creds = self.keyring.get_password(app_name, USERNAME)46 creds = self.keyring.get_password(app_name, USERNAME)
47 return loads(creds)47 if creds:
48 return loads(creds)
4849
49 def get_credentials(self, app_name):50 def get_credentials(self, app_name):
50 """A deferred with the secret of the SSO item in a dictionary."""51 """A deferred with the secret of the SSO item in a dictionary."""
5152
=== modified file 'ubuntu_sso/main/__init__.py'
--- ubuntu_sso/main/__init__.py 2011-03-22 23:29:20 +0000
+++ ubuntu_sso/main/__init__.py 2011-06-24 19:23:07 +0000
@@ -33,6 +33,7 @@
3333
34logger = setup_logging("ubuntu_sso.main")34logger = setup_logging("ubuntu_sso.main")
35U1_PING_URL = "https://one.ubuntu.com/oauth/sso-finished-so-get-tokens/"35U1_PING_URL = "https://one.ubuntu.com/oauth/sso-finished-so-get-tokens/"
36TIMEOUT_INTERVAL = 10000 # 10 seconds
3637
3738
38class SSOLoginProcessor(Account):39class SSOLoginProcessor(Account):
@@ -181,7 +182,8 @@
181 def login_or_register_to_get_credentials(self, app_name,182 def login_or_register_to_get_credentials(self, app_name,
182 terms_and_conditions_url,183 terms_and_conditions_url,
183 help_text, window_id,184 help_text, window_id,
184 success_cb, error_cb, denial_cb):185 success_cb, error_cb, denial_cb,
186 ui_module='ubuntu_sso.gtk.gui'):
185 """Get credentials if found else prompt GUI to login or register.187 """Get credentials if found else prompt GUI to login or register.
186188
187 'app_name' will be displayed in the GUI.189 'app_name' will be displayed in the GUI.
@@ -197,11 +199,12 @@
197 tc_url=terms_and_conditions_url,199 tc_url=terms_and_conditions_url,
198 help_text=help_text, window_id=window_id,200 help_text=help_text, window_id=window_id,
199 success_cb=success_cb, error_cb=error_cb,201 success_cb=success_cb, error_cb=error_cb,
200 denial_cb=denial_cb)202 denial_cb=denial_cb, ui_module=ui_module)
201 obj.register()203 obj.register()
202204
203 def login_to_get_credentials(self, app_name, help_text, window_id,205 def login_to_get_credentials(self, app_name, help_text, window_id,
204 success_cb, error_cb, denial_cb):206 success_cb, error_cb, denial_cb,
207 ui_module='ubuntu_sso.gtk.gui'):
205 """Get credentials if found else prompt GUI just to login208 """Get credentials if found else prompt GUI just to login
206209
207 'app_name' will be displayed in the GUI.210 'app_name' will be displayed in the GUI.
@@ -215,7 +218,7 @@
215 obj = Credentials(app_name=app_name, ping_url=ping_url, tc_url=None,218 obj = Credentials(app_name=app_name, ping_url=ping_url, tc_url=None,
216 help_text=help_text, window_id=window_id,219 help_text=help_text, window_id=window_id,
217 success_cb=success_cb, error_cb=error_cb,220 success_cb=success_cb, error_cb=error_cb,
218 denial_cb=denial_cb)221 denial_cb=denial_cb, ui_module=ui_module)
219 obj.login()222 obj.login()
220223
221 def clear_token(self, app_name, callback=NO_OP, errback=NO_OP):224 def clear_token(self, app_name, callback=NO_OP, errback=NO_OP):
@@ -254,7 +257,8 @@
254257
255 """258 """
256259
257 def __init__(self, found_cb, error_cb, denied_cb, *args, **kwargs):260 def __init__(self, timeout_func, shutdown_func, found_cb, error_cb,
261 denied_cb, *args, **kwargs):
258 """Create a new instance.262 """Create a new instance.
259263
260 - 'found_cb' is a callback that will be executed when the credentials264 - 'found_cb' is a callback that will be executed when the credentials
@@ -268,10 +272,42 @@
268272
269 """273 """
270 super(CredentialsManagementRoot, self).__init__(*args, **kwargs)274 super(CredentialsManagementRoot, self).__init__(*args, **kwargs)
275 self._ref_count = 0
276 self.timeout_func = timeout_func
277 self.shutdown_func = shutdown_func
271 self.found_cb = found_cb278 self.found_cb = found_cb
272 self.error_cb = error_cb279 self.error_cb = error_cb
273 self.denied_cb = denied_cb280 self.denied_cb = denied_cb
274281
282 def _get_ref_count(self):
283 """Get value of ref_count."""
284 return self._ref_count
285
286 def _set_ref_count(self, new_value):
287 """Set a new value to ref_count."""
288 logger.debug('ref_count is %r, changing value to %r.',
289 self._ref_count, new_value)
290 if new_value < 0:
291 self._ref_count = 0
292 msg = 'Attempting to decrease ref_count to a negative value (%r).'
293 logger.warning(msg, new_value)
294 else:
295 self._ref_count = new_value
296
297 if self._ref_count == 0:
298 logger.debug('Setting up timer with %r (%r, %r).',
299 self.timeout_func, TIMEOUT_INTERVAL, self.shutdown)
300 self.timeout_func(TIMEOUT_INTERVAL, self.shutdown)
301
302 ref_count = property(fget=_get_ref_count, fset=_set_ref_count)
303
304 def shutdown(self):
305 """If no ongoing requests, call self.shutdown_func."""
306 logger.debug('shutdown!, ref_count is %r.', self._ref_count)
307 if self._ref_count == 0:
308 logger.info('Shutting down, calling %r.', self.shutdown_func)
309 self.shutdown_func()
310
275 valid_keys = (HELP_TEXT_KEY, PING_URL_KEY, TC_URL_KEY,311 valid_keys = (HELP_TEXT_KEY, PING_URL_KEY, TC_URL_KEY,
276 UI_CLASS_KEY, UI_MODULE_KEY, WINDOW_ID_KEY)312 UI_CLASS_KEY, UI_MODULE_KEY, WINDOW_ID_KEY)
277313
@@ -299,7 +335,7 @@
299 an error.335 an error.
300336
301 """337 """
302338 self.ref_count += 1
303 obj = Credentials(app_name)339 obj = Credentials(app_name)
304 d = obj.find_credentials()340 d = obj.find_credentials()
305 # pylint: disable=E1101341 # pylint: disable=E1101
@@ -321,7 +357,7 @@
321 an error.357 an error.
322358
323 """359 """
324360 self.ref_count += 1
325 obj = Credentials(app_name)361 obj = Credentials(app_name)
326 d = obj.clear_credentials()362 d = obj.clear_credentials()
327 # pylint: disable=E1101363 # pylint: disable=E1101
@@ -344,7 +380,7 @@
344 - 'error_cb' is a callback that will be executed if the operation had380 - 'error_cb' is a callback that will be executed if the operation had
345 an error.381 an error.
346 """382 """
347383 self.ref_count += 1
348 obj = Credentials(app_name)384 obj = Credentials(app_name)
349 d = obj.store_credentials(args)385 d = obj.store_credentials(args)
350 # pylint: disable=E1101386 # pylint: disable=E1101
@@ -353,11 +389,13 @@
353389
354 def register(self, app_name, args):390 def register(self, app_name, args):
355 """Get credentials if found else prompt GUI to register."""391 """Get credentials if found else prompt GUI to register."""
392 self.ref_count += 1
356 obj = Credentials(app_name, **self._parse_args(args))393 obj = Credentials(app_name, **self._parse_args(args))
357 obj.register()394 obj.register()
358395
359 def login(self, app_name, args):396 def login(self, app_name, args):
360 """Get credentials if found else prompt GUI to login."""397 """Get credentials if found else prompt GUI to login."""
398 self.ref_count += 1
361 obj = Credentials(app_name, **self._parse_args(args))399 obj = Credentials(app_name, **self._parse_args(args))
362 obj.login()400 obj.login()
363401
@@ -367,7 +405,10 @@
367CredentialsManagement = None405CredentialsManagement = None
368406
369if sys.platform == 'win32':407if sys.platform == 'win32':
370 pass408 from ubuntu_sso.main import windows
409 SSOLogin = windows.SSOLogin
410 SSOCredentials = windows.SSOCredentials
411 CredentialsManagement = windows.CredentialsManagement
371else:412else:
372 from ubuntu_sso.main import linux413 from ubuntu_sso.main import linux
373 SSOLogin = linux.SSOLogin414 SSOLogin = linux.SSOLogin
374415
=== modified file 'ubuntu_sso/main/linux.py'
--- ubuntu_sso/main/linux.py 2011-03-22 23:29:20 +0000
+++ ubuntu_sso/main/linux.py 2011-06-24 19:23:07 +0000
@@ -28,6 +28,7 @@
28"""28"""
2929
30import threading30import threading
31import warnings
3132
32import dbus.service33import dbus.service
3334
@@ -45,7 +46,6 @@
4546
4647
47logger = setup_logging("ubuntu_sso.main")48logger = setup_logging("ubuntu_sso.main")
48TIMEOUT_INTERVAL = 10000 # 10 seconds
4949
5050
51def blocking(f, app_name, result_cb, error_cb):51def blocking(f, app_name, result_cb, error_cb):
@@ -210,7 +210,11 @@
210210
211211
212class SSOCredentials(dbus.service.Object):212class SSOCredentials(dbus.service.Object):
213 """DBus object that gets credentials, and login/registers if needed."""213 """DBus object that gets credentials, and login/registers if needed.
214
215 This class is Deprecated. DO NOT USE, use CredentialsManagement instead.
216
217 """
214218
215 # Operator not preceded by a space (fails with dbus decorators)219 # Operator not preceded by a space (fails with dbus decorators)
216 # pylint: disable=C0322220 # pylint: disable=C0322
@@ -218,6 +222,9 @@
218 def __init__(self, *args, **kwargs):222 def __init__(self, *args, **kwargs):
219 dbus.service.Object.__init__(self, *args, **kwargs)223 dbus.service.Object.__init__(self, *args, **kwargs)
220 self.root = SSOCredentialsRoot()224 self.root = SSOCredentialsRoot()
225 warnings.warn('%r DBus object is deprecated, please use %r instead.' %
226 (DBUS_IFACE_CRED_NAME, DBUS_CREDENTIALS_IFACE),
227 DeprecationWarning)
221228
222 def _process_error(self, app_name, error_dict):229 def _process_error(self, app_name, error_dict):
223 """Process the 'error_dict' and emit CredentialsError."""230 """Process the 'error_dict' and emit CredentialsError."""
@@ -266,11 +273,12 @@
266273
267 """274 """
268 self.root.login_or_register_to_get_credentials(app_name,275 self.root.login_or_register_to_get_credentials(app_name,
269 terms_and_conditions_url,276 terms_and_conditions_url,
270 help_text, window_id,277 help_text, window_id,
271 self.CredentialsFound,278 self.CredentialsFound,
272 self._process_error,279 self._process_error,
273 self.AuthorizationDenied)280 self.AuthorizationDenied,
281 ui_module='ubuntu_sso.gtk.gui')
274282
275 @dbus.service.method(dbus_interface=DBUS_IFACE_CRED_NAME,283 @dbus.service.method(dbus_interface=DBUS_IFACE_CRED_NAME,
276 in_signature="ssx", out_signature="")284 in_signature="ssx", out_signature="")
@@ -287,7 +295,8 @@
287 self.root.login_to_get_credentials(app_name, help_text, window_id,295 self.root.login_to_get_credentials(app_name, help_text, window_id,
288 self.CredentialsFound,296 self.CredentialsFound,
289 self._process_error,297 self._process_error,
290 self.AuthorizationDenied)298 self.AuthorizationDenied,
299 ui_module='ubuntu_sso.gtk.gui')
291300
292 @dbus.service.method(dbus_interface=DBUS_IFACE_CRED_NAME,301 @dbus.service.method(dbus_interface=DBUS_IFACE_CRED_NAME,
293 in_signature='s', out_signature='',302 in_signature='s', out_signature='',
@@ -328,10 +337,8 @@
328337
329 def __init__(self, timeout_func, shutdown_func, *args, **kwargs):338 def __init__(self, timeout_func, shutdown_func, *args, **kwargs):
330 super(CredentialsManagement, self).__init__(*args, **kwargs)339 super(CredentialsManagement, self).__init__(*args, **kwargs)
331 self._ref_count = 0340 self.root = CredentialsManagementRoot(timeout_func, shutdown_func,
332 self.timeout_func = timeout_func341 self.CredentialsFound,
333 self.shutdown_func = shutdown_func
334 self.root = CredentialsManagementRoot(self.CredentialsFound,
335 self.CredentialsError,342 self.CredentialsError,
336 self.AuthorizationDenied)343 self.AuthorizationDenied)
337344
@@ -342,74 +349,50 @@
342 """Process the 'failure' and emit CredentialsError."""349 """Process the 'failure' and emit CredentialsError."""
343 self.CredentialsError(app_name, except_to_errdict(failure.value))350 self.CredentialsError(app_name, except_to_errdict(failure.value))
344351
345 def _get_ref_count(self):
346 """Get value of ref_count."""
347 return self._ref_count
348
349 def _set_ref_count(self, new_value):
350 """Set a new value to ref_count."""
351 logger.debug('ref_count is %r, changing value to %r.',
352 self._ref_count, new_value)
353 if new_value < 0:
354 self._ref_count = 0
355 msg = 'Attempting to decrease ref_count to a negative value (%r).'
356 logger.warning(msg, new_value)
357 else:
358 self._ref_count = new_value
359
360 if self._ref_count == 0:
361 logger.debug('Setting up timer with %r (%r, %r).',
362 self.timeout_func, TIMEOUT_INTERVAL, self.shutdown)
363 self.timeout_func(TIMEOUT_INTERVAL, self.shutdown)
364
365 ref_count = property(fget=_get_ref_count, fset=_set_ref_count)
366
367 def shutdown(self):352 def shutdown(self):
368 """If no ongoing requests, call self.shutdown_func."""353 """If no ongoing requests, call self.shutdown_func."""
369 logger.debug('shutdown!, ref_count is %r.', self._ref_count)354 logger.debug('shutdown!, ref_count is %r.', self.root.ref_count)
370 if self._ref_count == 0:355 self.root.shutdown()
371 logger.info('Shutting down, calling %r.', self.shutdown_func)
372 self.shutdown_func()
373356
374 @dbus.service.signal(DBUS_CREDENTIALS_IFACE, signature='s')357 @dbus.service.signal(DBUS_CREDENTIALS_IFACE, signature='s')
375 def AuthorizationDenied(self, app_name):358 def AuthorizationDenied(self, app_name):
376 """Signal thrown when the user denies the authorization."""359 """Signal thrown when the user denies the authorization."""
377 self.ref_count -= 1360 self.root.ref_count -= 1
378 logger.info('%s: emitting AuthorizationDenied with app_name "%s".',361 logger.info('%s: emitting AuthorizationDenied with app_name "%s".',
379 self.__class__.__name__, app_name)362 self.__class__.__name__, app_name)
380363
381 @dbus.service.signal(DBUS_CREDENTIALS_IFACE, signature='sa{ss}')364 @dbus.service.signal(DBUS_CREDENTIALS_IFACE, signature='sa{ss}')
382 def CredentialsFound(self, app_name, credentials):365 def CredentialsFound(self, app_name, credentials):
383 """Signal thrown when the credentials are found."""366 """Signal thrown when the credentials are found."""
384 self.ref_count -= 1367 self.root.ref_count -= 1
385 logger.info('%s: emitting CredentialsFound with app_name "%s".',368 logger.info('%s: emitting CredentialsFound with app_name "%s".',
386 self.__class__.__name__, app_name)369 self.__class__.__name__, app_name)
387370
388 @dbus.service.signal(DBUS_CREDENTIALS_IFACE, signature='s')371 @dbus.service.signal(DBUS_CREDENTIALS_IFACE, signature='s')
389 def CredentialsNotFound(self, app_name):372 def CredentialsNotFound(self, app_name):
390 """Signal thrown when the credentials are not found."""373 """Signal thrown when the credentials are not found."""
391 self.ref_count -= 1374 self.root.ref_count -= 1
392 logger.info('%s: emitting CredentialsNotFound with app_name "%s".',375 logger.info('%s: emitting CredentialsNotFound with app_name "%s".',
393 self.__class__.__name__, app_name)376 self.__class__.__name__, app_name)
394377
395 @dbus.service.signal(DBUS_CREDENTIALS_IFACE, signature='s')378 @dbus.service.signal(DBUS_CREDENTIALS_IFACE, signature='s')
396 def CredentialsCleared(self, app_name):379 def CredentialsCleared(self, app_name):
397 """Signal thrown when the credentials were cleared."""380 """Signal thrown when the credentials were cleared."""
398 self.ref_count -= 1381 self.root.ref_count -= 1
399 logger.info('%s: emitting CredentialsCleared with app_name "%s".',382 logger.info('%s: emitting CredentialsCleared with app_name "%s".',
400 self.__class__.__name__, app_name)383 self.__class__.__name__, app_name)
401384
402 @dbus.service.signal(DBUS_CREDENTIALS_IFACE, signature='s')385 @dbus.service.signal(DBUS_CREDENTIALS_IFACE, signature='s')
403 def CredentialsStored(self, app_name):386 def CredentialsStored(self, app_name):
404 """Signal thrown when the credentials were cleared."""387 """Signal thrown when the credentials were cleared."""
405 self.ref_count -= 1388 self.root.ref_count -= 1
406 logger.info('%s: emitting CredentialsStored with app_name "%s".',389 logger.info('%s: emitting CredentialsStored with app_name "%s".',
407 self.__class__.__name__, app_name)390 self.__class__.__name__, app_name)
408391
409 @dbus.service.signal(DBUS_CREDENTIALS_IFACE, signature='sa{ss}')392 @dbus.service.signal(DBUS_CREDENTIALS_IFACE, signature='sa{ss}')
410 def CredentialsError(self, app_name, error_dict):393 def CredentialsError(self, app_name, error_dict):
411 """Signal thrown when there is a problem getting the credentials."""394 """Signal thrown when there is a problem getting the credentials."""
412 self.ref_count -= 1395 self.root.ref_count -= 1
413 logger.error('%s: emitting CredentialsError with app_name "%s" and '396 logger.error('%s: emitting CredentialsError with app_name "%s" and '
414 'error_dict %r.', self.__class__.__name__, app_name,397 'error_dict %r.', self.__class__.__name__, app_name,
415 error_dict)398 error_dict)
@@ -425,7 +408,6 @@
425 - 'args' is a dictionary, currently not used.408 - 'args' is a dictionary, currently not used.
426409
427 """410 """
428 self.ref_count += 1
429411
430 def success_cb(credentials):412 def success_cb(credentials):
431 """Find credentials and notify using signals."""413 """Find credentials and notify using signals."""
@@ -448,7 +430,6 @@
448 - 'args' is a dictionary, currently not used.430 - 'args' is a dictionary, currently not used.
449431
450 """432 """
451 self.ref_count += 1
452 self.root.clear_credentials(app_name, args,433 self.root.clear_credentials(app_name, args,
453 lambda _: self.CredentialsCleared(app_name),434 lambda _: self.CredentialsCleared(app_name),
454 self._process_failure)435 self._process_failure)
@@ -466,7 +447,6 @@
466 'consumer_secret'.447 'consumer_secret'.
467448
468 """449 """
469 self.ref_count += 1
470 self.root.store_credentials(app_name, args,450 self.root.store_credentials(app_name, args,
471 lambda _: self.CredentialsStored(app_name),451 lambda _: self.CredentialsStored(app_name),
472 self._process_failure)452 self._process_failure)
@@ -475,12 +455,10 @@
475 in_signature='sa{ss}', out_signature='')455 in_signature='sa{ss}', out_signature='')
476 def register(self, app_name, args):456 def register(self, app_name, args):
477 """Get credentials if found else prompt GUI to register."""457 """Get credentials if found else prompt GUI to register."""
478 self.ref_count += 1
479 self.root.register(app_name, args)458 self.root.register(app_name, args)
480459
481 @dbus.service.method(dbus_interface=DBUS_CREDENTIALS_IFACE,460 @dbus.service.method(dbus_interface=DBUS_CREDENTIALS_IFACE,
482 in_signature='sa{ss}', out_signature='')461 in_signature='sa{ss}', out_signature='')
483 def login(self, app_name, args):462 def login(self, app_name, args):
484 """Get credentials if found else prompt GUI to login."""463 """Get credentials if found else prompt GUI to login."""
485 self.ref_count += 1
486 self.root.login(app_name, args)464 self.root.login(app_name, args)
487465
=== modified file 'ubuntu_sso/main/tests/test_common.py'
--- ubuntu_sso/main/tests/test_common.py 2011-03-22 23:29:20 +0000
+++ ubuntu_sso/main/tests/test_common.py 2011-06-24 19:23:07 +0000
@@ -162,7 +162,7 @@
162 """Test that the call is relayed."""162 """Test that the call is relayed."""
163 app_name = 'app'163 app_name = 'app'
164 result_cb = error_cb = lambda: None164 result_cb = error_cb = lambda: None
165 self.root.find_credentials(app_name, result_cb, error_cb)165 self.root.find_credentials(app_name, MATCH(callable), MATCH(callable))
166 self.mocker.mock()166 self.mocker.mock()
167 self.mocker.replay()167 self.mocker.replay()
168 self.cred.find_credentials(app_name, result_cb, error_cb)168 self.cred.find_credentials(app_name, result_cb, error_cb)
@@ -174,10 +174,9 @@
174 help_text = 'help'174 help_text = 'help'
175 window_id = 'id'175 window_id = 'id'
176 self.root.login_or_register_to_get_credentials(app_name, terms,176 self.root.login_or_register_to_get_credentials(app_name, terms,
177 help_text, window_id,177 help_text, window_id, MATCH(callable),
178 MATCH(callable),178 MATCH(callable), MATCH(callable),
179 MATCH(callable),179 ui_module=MATCH(lambda x: isinstance(x, str)))
180 MATCH(callable))
181 self.mocker.replay()180 self.mocker.replay()
182 self.cred.login_or_register_to_get_credentials(app_name, terms,181 self.cred.login_or_register_to_get_credentials(app_name, terms,
183 help_text, window_id)182 help_text, window_id)
@@ -186,7 +185,7 @@
186 """Test that the call is relayed."""185 """Test that the call is relayed."""
187 app_name = 'app'186 app_name = 'app'
188 result_cb = error_cb = lambda: None187 result_cb = error_cb = lambda: None
189 self.root.clear_token(app_name, result_cb, error_cb)188 self.root.clear_token(app_name, MATCH(callable), MATCH(callable))
190 self.mocker.replay()189 self.mocker.replay()
191 self.cred.clear_token(app_name, result_cb, error_cb)190 self.cred.clear_token(app_name, result_cb, error_cb)
192191
193192
=== modified file 'ubuntu_sso/main/tests/test_linux.py'
--- ubuntu_sso/main/tests/test_linux.py 2011-03-22 23:29:20 +0000
+++ ubuntu_sso/main/tests/test_linux.py 2011-06-24 19:23:07 +0000
@@ -23,7 +23,7 @@
23import logging23import logging
24import os24import os
2525
26from mocker import Mocker, MockerTestCase, ARGS, KWARGS26from mocker import Mocker, MockerTestCase, ARGS, KWARGS, MATCH
27from twisted.internet import defer27from twisted.internet import defer
28from twisted.internet.defer import Deferred, inlineCallbacks28from twisted.internet.defer import Deferred, inlineCallbacks
29from twisted.trial.unittest import TestCase29from twisted.trial.unittest import TestCase
@@ -36,8 +36,8 @@
36from ubuntu_sso import DBUS_CREDENTIALS_IFACE36from ubuntu_sso import DBUS_CREDENTIALS_IFACE
37from ubuntu_sso.keyring import U1_APP_NAME37from ubuntu_sso.keyring import U1_APP_NAME
38from ubuntu_sso.main import (U1_PING_URL, except_to_errdict,38from ubuntu_sso.main import (U1_PING_URL, except_to_errdict,
39 CredentialsManagement, SSOCredentials, SSOLogin)39 CredentialsManagement, SSOCredentials, SSOLogin, TIMEOUT_INTERVAL)
40from ubuntu_sso.main.linux import TIMEOUT_INTERVAL, blocking40from ubuntu_sso.main.linux import blocking
41from ubuntu_sso.main import (HELP_TEXT_KEY, PING_URL_KEY,41from ubuntu_sso.main import (HELP_TEXT_KEY, PING_URL_KEY,
42 TC_URL_KEY, UI_CLASS_KEY, UI_MODULE_KEY, WINDOW_ID_KEY,42 TC_URL_KEY, UI_CLASS_KEY, UI_MODULE_KEY, WINDOW_ID_KEY,
43 SUCCESS_CB_KEY, ERROR_CB_KEY, DENIAL_CB_KEY)43 SUCCESS_CB_KEY, ERROR_CB_KEY, DENIAL_CB_KEY)
@@ -623,6 +623,7 @@
623623
624 def test_login_or_register(self):624 def test_login_or_register(self):
625 """login_or_register is correct."""625 """login_or_register is correct."""
626 self.args[UI_MODULE_KEY] = MATCH(lambda x: isinstance(x, str))
626 mock_class = self.mocker.replace("ubuntu_sso.credentials.Credentials")627 mock_class = self.mocker.replace("ubuntu_sso.credentials.Credentials")
627 mock_class(app_name=self.app_name, **self.args)628 mock_class(app_name=self.app_name, **self.args)
628 creds_obj = self.mocker.mock()629 creds_obj = self.mocker.mock()
@@ -637,6 +638,7 @@
637 def test_login_only(self):638 def test_login_only(self):
638 """login_or_register is correct."""639 """login_or_register is correct."""
639 self.args[TC_URL_KEY] = None640 self.args[TC_URL_KEY] = None
641 self.args[UI_MODULE_KEY] = MATCH(lambda x: isinstance(x, str))
640 mock_class = self.mocker.replace("ubuntu_sso.credentials.Credentials")642 mock_class = self.mocker.replace("ubuntu_sso.credentials.Credentials")
641 mock_class(app_name=self.app_name, **self.args)643 mock_class(app_name=self.app_name, **self.args)
642 creds_obj = self.mocker.mock()644 creds_obj = self.mocker.mock()
@@ -770,7 +772,7 @@
770772
771 def test_ref_counting(self):773 def test_ref_counting(self):
772 """Ref counting is in place."""774 """Ref counting is in place."""
773 self.assertEqual(self.client.ref_count, 0)775 self.assertEqual(self.client.root.ref_count, 0)
774776
775 def test_find_credentials(self):777 def test_find_credentials(self):
776 """Keep proper track of on going requests."""778 """Keep proper track of on going requests."""
@@ -778,7 +780,7 @@
778780
779 def verify(*args):781 def verify(*args):
780 """Make the check."""782 """Make the check."""
781 self.assertEqual(self.client.ref_count, 1)783 self.assertEqual(self.client.root.ref_count, 1)
782 d.callback(True)784 d.callback(True)
783785
784 self.patch(self.client, 'CredentialsFound', verify)786 self.patch(self.client, 'CredentialsFound', verify)
@@ -792,7 +794,7 @@
792794
793 def verify(*args):795 def verify(*args):
794 """Make the check."""796 """Make the check."""
795 self.assertEqual(self.client.ref_count, 1)797 self.assertEqual(self.client.root.ref_count, 1)
796 d.callback(True)798 d.callback(True)
797799
798 self.patch(self.client, 'CredentialsCleared', verify)800 self.patch(self.client, 'CredentialsCleared', verify)
@@ -806,7 +808,7 @@
806808
807 def verify(*args):809 def verify(*args):
808 """Make the check."""810 """Make the check."""
809 self.assertEqual(self.client.ref_count, 1)811 self.assertEqual(self.client.root.ref_count, 1)
810 d.callback(True)812 d.callback(True)
811813
812 self.patch(self.client, 'CredentialsStored', verify)814 self.patch(self.client, 'CredentialsStored', verify)
@@ -818,13 +820,13 @@
818 """Keep proper track of on going requests."""820 """Keep proper track of on going requests."""
819 self.client.register(APP_NAME, self.args)821 self.client.register(APP_NAME, self.args)
820822
821 self.assertEqual(self.client.ref_count, 1)823 self.assertEqual(self.client.root.ref_count, 1)
822824
823 def test_login(self):825 def test_login(self):
824 """Keep proper track of on going requests."""826 """Keep proper track of on going requests."""
825 self.client.login(APP_NAME, self.args)827 self.client.login(APP_NAME, self.args)
826828
827 self.assertEqual(self.client.ref_count, 1)829 self.assertEqual(self.client.root.ref_count, 1)
828830
829 def test_several_requests(self):831 def test_several_requests(self):
830 """Requests can be nested."""832 """Requests can be nested."""
@@ -834,112 +836,112 @@
834 self.client.register(APP_NAME, self.args)836 self.client.register(APP_NAME, self.args)
835 self.client.register(APP_NAME, self.args)837 self.client.register(APP_NAME, self.args)
836838
837 self.assertEqual(self.client.ref_count, 5)839 self.assertEqual(self.client.root.ref_count, 5)
838840
839 def test_credentials_found(self):841 def test_credentials_found(self):
840 """Ref counter is decreased when a signal is sent."""842 """Ref counter is decreased when a signal is sent."""
841 self.client.ref_count = 3843 self.client.root.ref_count = 3
842 self.client.CredentialsFound(APP_NAME, TOKEN)844 self.client.CredentialsFound(APP_NAME, TOKEN)
843845
844 self.assertEqual(self.client.ref_count, 2)846 self.assertEqual(self.client.root.ref_count, 2)
845847
846 def test_credentials_not_found(self):848 def test_credentials_not_found(self):
847 """Ref counter is decreased when a signal is sent."""849 """Ref counter is decreased when a signal is sent."""
848 self.client.ref_count = 3850 self.client.root.ref_count = 3
849 self.client.CredentialsNotFound(APP_NAME)851 self.client.CredentialsNotFound(APP_NAME)
850852
851 self.assertEqual(self.client.ref_count, 2)853 self.assertEqual(self.client.root.ref_count, 2)
852854
853 def test_credentials_cleared(self):855 def test_credentials_cleared(self):
854 """Ref counter is decreased when a signal is sent."""856 """Ref counter is decreased when a signal is sent."""
855 self.client.ref_count = 3857 self.client.root.ref_count = 3
856 self.client.CredentialsCleared(APP_NAME)858 self.client.CredentialsCleared(APP_NAME)
857859
858 self.assertEqual(self.client.ref_count, 2)860 self.assertEqual(self.client.root.ref_count, 2)
859861
860 def test_credentials_stored(self):862 def test_credentials_stored(self):
861 """Ref counter is decreased when a signal is sent."""863 """Ref counter is decreased when a signal is sent."""
862 self.client.ref_count = 3864 self.client.root.ref_count = 3
863 self.client.CredentialsStored(APP_NAME)865 self.client.CredentialsStored(APP_NAME)
864866
865 self.assertEqual(self.client.ref_count, 2)867 self.assertEqual(self.client.root.ref_count, 2)
866868
867 def test_credentials_error(self):869 def test_credentials_error(self):
868 """Ref counter is decreased when a signal is sent."""870 """Ref counter is decreased when a signal is sent."""
869 self.client.ref_count = 3871 self.client.root.ref_count = 3
870 self.client.CredentialsError(APP_NAME, {'error_type': 'test'})872 self.client.CredentialsError(APP_NAME, {'error_type': 'test'})
871873
872 self.assertEqual(self.client.ref_count, 2)874 self.assertEqual(self.client.root.ref_count, 2)
873875
874 def test_authorization_denied(self):876 def test_authorization_denied(self):
875 """Ref counter is decreased when a signal is sent."""877 """Ref counter is decreased when a signal is sent."""
876 self.client.ref_count = 3878 self.client.root.ref_count = 3
877 self.client.AuthorizationDenied(APP_NAME)879 self.client.AuthorizationDenied(APP_NAME)
878880
879 self.assertEqual(self.client.ref_count, 2)881 self.assertEqual(self.client.root.ref_count, 2)
880882
881 def test_credentials_found_when_ref_count_is_not_positive(self):883 def test_credentials_found_when_ref_count_is_not_positive(self):
882 """Ref counter is decreased when a signal is sent."""884 """Ref counter is decreased when a signal is sent."""
883 self.client._ref_count = -3885 self.client.root._ref_count = -3
884 self.client.CredentialsFound(APP_NAME, TOKEN)886 self.client.CredentialsFound(APP_NAME, TOKEN)
885887
886 self.assertEqual(self.client.ref_count, 0)888 self.assertEqual(self.client.root.ref_count, 0)
887 msg = 'Attempting to decrease ref_count to a negative value (-4).'889 msg = 'Attempting to decrease ref_count to a negative value (-4).'
888 self.assertTrue(self.memento.check_warning(msg))890 self.assertTrue(self.memento.check_warning(msg))
889891
890 def test_credentials_not_found_when_ref_count_is_not_positive(self):892 def test_credentials_not_found_when_ref_count_is_not_positive(self):
891 """Ref counter is decreased when a signal is sent."""893 """Ref counter is decreased when a signal is sent."""
892 self.client._ref_count = -3894 self.client.root._ref_count = -3
893 self.client.CredentialsNotFound(APP_NAME)895 self.client.CredentialsNotFound(APP_NAME)
894896
895 self.assertEqual(self.client.ref_count, 0)897 self.assertEqual(self.client.root.ref_count, 0)
896 msg = 'Attempting to decrease ref_count to a negative value (-4).'898 msg = 'Attempting to decrease ref_count to a negative value (-4).'
897 self.assertTrue(self.memento.check_warning(msg))899 self.assertTrue(self.memento.check_warning(msg))
898900
899 def test_credentials_cleared_when_ref_count_is_not_positive(self):901 def test_credentials_cleared_when_ref_count_is_not_positive(self):
900 """Ref counter is decreased when a signal is sent."""902 """Ref counter is decreased when a signal is sent."""
901 self.client._ref_count = -3903 self.client.root._ref_count = -3
902 self.client.CredentialsCleared(APP_NAME)904 self.client.CredentialsCleared(APP_NAME)
903905
904 self.assertEqual(self.client.ref_count, 0)906 self.assertEqual(self.client.root.ref_count, 0)
905 msg = 'Attempting to decrease ref_count to a negative value (-4).'907 msg = 'Attempting to decrease ref_count to a negative value (-4).'
906 self.assertTrue(self.memento.check_warning(msg))908 self.assertTrue(self.memento.check_warning(msg))
907909
908 def test_credentials_stored_when_ref_count_is_not_positive(self):910 def test_credentials_stored_when_ref_count_is_not_positive(self):
909 """Ref counter is decreased when a signal is sent."""911 """Ref counter is decreased when a signal is sent."""
910 self.client._ref_count = -3912 self.client.root._ref_count = -3
911 self.client.CredentialsStored(APP_NAME)913 self.client.CredentialsStored(APP_NAME)
912914
913 self.assertEqual(self.client.ref_count, 0)915 self.assertEqual(self.client.root.ref_count, 0)
914 msg = 'Attempting to decrease ref_count to a negative value (-4).'916 msg = 'Attempting to decrease ref_count to a negative value (-4).'
915 self.assertTrue(self.memento.check_warning(msg))917 self.assertTrue(self.memento.check_warning(msg))
916918
917 def test_credentials_error_when_ref_count_is_not_positive(self):919 def test_credentials_error_when_ref_count_is_not_positive(self):
918 """Ref counter is decreased when a signal is sent."""920 """Ref counter is decreased when a signal is sent."""
919 self.client._ref_count = -3921 self.client.root._ref_count = -3
920 self.client.CredentialsError(APP_NAME, {'error_type': 'test'})922 self.client.CredentialsError(APP_NAME, {'error_type': 'test'})
921923
922 self.assertEqual(self.client.ref_count, 0)924 self.assertEqual(self.client.root.ref_count, 0)
923 msg = 'Attempting to decrease ref_count to a negative value (-4).'925 msg = 'Attempting to decrease ref_count to a negative value (-4).'
924 self.assertTrue(self.memento.check_warning(msg))926 self.assertTrue(self.memento.check_warning(msg))
925927
926 def test_autorization_denied_when_ref_count_is_not_positive(self):928 def test_autorization_denied_when_ref_count_is_not_positive(self):
927 """Ref counter is decreased when a signal is sent."""929 """Ref counter is decreased when a signal is sent."""
928 self.client._ref_count = -3930 self.client.root._ref_count = -3
929 self.client.AuthorizationDenied(APP_NAME)931 self.client.AuthorizationDenied(APP_NAME)
930932
931 self.assertEqual(self.client.ref_count, 0)933 self.assertEqual(self.client.root.ref_count, 0)
932 msg = 'Attempting to decrease ref_count to a negative value (-4).'934 msg = 'Attempting to decrease ref_count to a negative value (-4).'
933 self.assertTrue(self.memento.check_warning(msg))935 self.assertTrue(self.memento.check_warning(msg))
934936
935 def test_on_zero_ref_count_shutdown(self):937 def test_on_zero_ref_count_shutdown(self):
936 """When ref count reaches 0, queue shutdown op."""938 """When ref count reaches 0, queue shutdown op."""
937 self.client.timeout_func = self._set_called939 self.client.root.timeout_func = self._set_called
938 self.client.login(APP_NAME, self.args)940 self.client.login(APP_NAME, self.args)
939 self.client.CredentialsFound(APP_NAME, TOKEN)941 self.client.CredentialsFound(APP_NAME, TOKEN)
940942
941 self.assertEqual(self._called,943 self.assertEqual(self._called,
942 ((TIMEOUT_INTERVAL, self.client.shutdown), {}))944 ((TIMEOUT_INTERVAL, self.client.root.shutdown), {}))
943945
944 def test_on_non_zero_ref_count_do_not_shutdown(self):946 def test_on_non_zero_ref_count_do_not_shutdown(self):
945 """If ref count is not 0, do not queue shutdown op."""947 """If ref count is not 0, do not queue shutdown op."""
@@ -954,7 +956,7 @@
954 def fake_timeout_func(interval, func):956 def fake_timeout_func(interval, func):
955 """Start a new request when the timer is started."""957 """Start a new request when the timer is started."""
956 self.client.register(APP_NAME, self.args)958 self.client.register(APP_NAME, self.args)
957 assert self.client.ref_count > 0959 assert self.client.root.ref_count > 0
958 func()960 func()
959961
960 self.client.timeout_func = fake_timeout_func962 self.client.timeout_func = fake_timeout_func
@@ -971,11 +973,11 @@
971973
972 def fake_timeout_func(interval, func):974 def fake_timeout_func(interval, func):
973 """Start a new request when the timer is started."""975 """Start a new request when the timer is started."""
974 assert self.client.ref_count == 0976 assert self.client.root.ref_count == 0
975 func()977 func()
976978
977 self.client.timeout_func = fake_timeout_func979 self.client.root.timeout_func = fake_timeout_func
978 self.client.shutdown_func = self._set_called980 self.client.root.shutdown_func = self._set_called
979981
980 self.client.login(APP_NAME, self.args)982 self.client.login(APP_NAME, self.args)
981 self.client.CredentialsFound(APP_NAME, TOKEN)983 self.client.CredentialsFound(APP_NAME, TOKEN)
982984
=== modified file 'ubuntu_sso/main/tests/test_windows.py'
--- ubuntu_sso/main/tests/test_windows.py 2011-03-22 23:29:20 +0000
+++ ubuntu_sso/main/tests/test_windows.py 2011-06-24 19:23:07 +0000
@@ -15,3 +15,1211 @@
15# You should have received a copy of the GNU General Public License along15# You should have received a copy of the GNU General Public License along
16# with this program. If not, see <http://www.gnu.org/licenses/>.16# with this program. If not, see <http://www.gnu.org/licenses/>.
17"""Windows tests."""17"""Windows tests."""
18
19from mocker import MATCH, Mocker, MockerTestCase
20
21from twisted.internet import defer, reactor
22from twisted.trial.unittest import TestCase
23from twisted.spread.pb import PBClientFactory, PBServerFactory
24from ubuntu_sso.main.windows import (
25 blocking,
26 signal,
27 CredentialsManagement,
28 CredentialsManagementClient,
29 SSOCredentials,
30 SSOCredentialsClient,
31 SSOLogin,
32 SSOLoginClient,
33 UbuntuSSORoot)
34
35NAMED_PIPE_URL = "\\\\.\\pipe\\ubuntuone_sso\\tests"
36
37# because we are using twisted we have java like names C0103 and
38# the issues that mocker brings with it like W0104
39# pylint: disable=C0103,W0104
40
41
42class SaveProtocolServerFactory(PBServerFactory):
43 """A PBServerFactory that saves the latest connected client."""
44
45 protocolInstance = None
46
47 def clientConnectionMade(self, protocol):
48 """Keep track of the given protocol."""
49 self.protocolInstance = protocol
50
51
52class FakeDecoratedObject(object):
53 """An object that has decorators."""
54
55 def __init__(self):
56 """Create a new instance."""
57 super(FakeDecoratedObject, self).__init__()
58
59 @signal
60 def on_no_args(self):
61 """Get no args passwed."""
62
63 @signal
64 def on_just_args(self, *args):
65 """Just get args."""
66
67 @signal
68 def on_just_kwargs(self, **kwargs):
69 """Just get kwargs."""
70
71 @signal
72 def on_both_args(self, *args, **kwargs):
73 """Both args."""
74
75
76# pylint: disable=W0201
77class SignalTestCase(MockerTestCase):
78 """Test the signal decorator."""
79
80 def setUp(self):
81 """Set the tests."""
82 super(SignalTestCase, self).setUp()
83 self.fake_object = FakeDecoratedObject()
84 self.cb = self.mocker.mock()
85
86 def test_no_args(self):
87 """Test when the cb should have no args."""
88 self.fake_object.on_no_args_cb = self.cb
89 self.cb()
90 self.mocker.replay()
91 self.fake_object.on_no_args()
92
93 def test_just_args(self):
94 """Test when the cb just has *args"""
95 first = 'first'
96 second = 'second'
97 self.fake_object.on_just_args_cb = self.cb
98 self.cb(first, second)
99 self.mocker.replay()
100 self.fake_object.on_just_args(first, second)
101
102 def test_just_kwargs(self):
103 """Test when the cb just has kwargs."""
104 first = 'first'
105 second = 'second'
106 self.fake_object.on_just_kwargs_cb = self.cb
107 self.cb(first=first, second=second)
108 self.mocker.replay()
109 self.fake_object.on_just_kwargs(first=first, second=second)
110
111 def test_just_kwargs_empty(self):
112 """Test when the cb just has kwargs."""
113 self.fake_object.on_just_kwargs_cb = self.cb
114 self.cb()
115 self.mocker.replay()
116 self.fake_object.on_just_kwargs()
117
118 def test_both_args(self):
119 """Test with args and kwargs."""
120 first = 'first'
121 second = 'second'
122 self.fake_object.on_both_args_cb = self.cb
123 self.cb(first, second, first=first, second=second)
124 self.mocker.replay()
125 self.fake_object.on_both_args(first, second, first=first,
126 second=second)
127
128 def test_both_args_no_kwargs(self):
129 """Test with args and kwargs."""
130 first = 'first'
131 second = 'second'
132 self.fake_object.on_both_args_cb = self.cb
133 self.cb(first, second)
134 self.mocker.replay()
135 self.fake_object.on_both_args(first, second)
136
137 def test_both_args_no_args(self):
138 """Test with args and kwargs."""
139 first = 'first'
140 second = 'second'
141 self.fake_object.on_both_args_cb = self.cb
142 self.cb(first=first, second=second)
143 self.mocker.replay()
144 self.fake_object.on_both_args(first=first, second=second)
145# pylint: enable=W0201
146
147
148class SSOLoginTestCase(TestCase):
149 """Test the login class."""
150
151 def setUp(self):
152 """Setup tests."""
153 super(SSOLoginTestCase, self).setUp()
154 self.mocker = Mocker()
155 self.root = self.mocker.mock()
156 self.except_to_errdict = self.mocker.replace(
157 'ubuntu_sso.main.except_to_errdict')
158 self.login = SSOLogin(None)
159 self.login.root = self.root
160 # start pb
161 self.sso_root = UbuntuSSORoot(self.login, None, None)
162 self.server_factory = SaveProtocolServerFactory(self.sso_root)
163 # pylint: disable=E1101
164 self.listener = reactor.listenPipe(NAMED_PIPE_URL, self.server_factory)
165 self.client_factory = PBClientFactory()
166 self.connector = reactor.connectPipe(NAMED_PIPE_URL,
167 self.client_factory)
168 # pylint: enable=E1101
169
170 def tearDown(self):
171 """Clean reactor."""
172 if self.server_factory.protocolInstance is not None:
173 self.server_factory.protocolInstance.transport.loseConnection()
174 return defer.gatherResults([self._tearDownServer(),
175 self._tearDownClient()])
176
177 def _tearDownServer(self):
178 """Teardown the server."""
179 return defer.maybeDeferred(self.listener.stopListening)
180
181 def _tearDownClient(self):
182 """Tear down the client."""
183 self.connector.disconnect()
184 return defer.succeed(None)
185
186 @defer.inlineCallbacks
187 def _get_client(self):
188 """Get the client."""
189 # request the remote object and create a client
190 root = yield self.client_factory.getRootObject()
191 remote = yield root.callRemote('get_sso_login')
192 client = SSOLoginClient(remote)
193 yield client.register_to_signals()
194 # set the cb
195 for signal_name in ['on_captcha_generated_cb',
196 'on_captcha_generation_error_cb',
197 'on_user_registered_cb',
198 'on_user_registration_error_cb',
199 'on_logged_in_cb',
200 'on_login_error_cb',
201 'on_user_not_validated_cb',
202 'on_email_validated_cb',
203 'on_email_validation_error_cb',
204 'on_password_reset_token_sent_cb',
205 'on_password_reset_error_cb',
206 'on_password_changed_cb',
207 'on_password_change_error_cb']:
208 setattr(client, signal_name, self.mocker.mock())
209 defer.returnValue(client)
210
211 def test_emit_captcha_generated(self):
212 """Test that the cb was called."""
213 app_name = 'app'
214 result = 'result'
215
216 @defer.inlineCallbacks
217 def test_emit(client):
218 """Actual test."""
219 client.on_captcha_generated_cb(app_name, result)
220 self.mocker.replay()
221 self.login.emit_captcha_generated(app_name, result)
222 yield client.unregister_to_signals()
223 self.mocker.verify()
224
225 d = self._get_client()
226 # pylint: disable=E1101
227 d.addCallback(test_emit)
228 # pylint: enable=E1101
229 return d
230
231 def test_emit_captcha_generation_error(self):
232 """Test that the cb was called."""
233 app_name = 'app'
234 error_value = 'error'
235 raised_error = self.mocker.mock()
236
237 @defer.inlineCallbacks
238 def test_emit(client):
239 """Actual test."""
240 raised_error.value
241 self.mocker.result(error_value)
242 self.except_to_errdict(error_value)
243 self.mocker.result(error_value)
244 client.on_captcha_generation_error_cb(app_name, error_value)
245 self.mocker.replay()
246 self.login.emit_captcha_generation_error(app_name, raised_error)
247 yield client.unregister_to_signals()
248 self.mocker.verify()
249
250 d = self._get_client()
251 # pylint: disable=E1101
252 d.addCallback(test_emit)
253 # pylint: enable=E1101
254 return d
255
256 def test_generate_captcha(self):
257 """Test the call from the client."""
258 app_name = 'app'
259 filename = 'file'
260
261 @defer.inlineCallbacks
262 def test_execution(client):
263 """Actual test."""
264 self.root.generate_captcha(app_name, filename, blocking,
265 self.login.emit_captcha_generated,
266 self.login.emit_captcha_generation_error)
267 self.mocker.replay()
268 yield client.generate_captcha(app_name, filename)
269 yield client.unregister_to_signals()
270 self.mocker.verify()
271
272 d = self._get_client()
273 # pylint: disable=E1101
274 d.addCallback(test_execution)
275 # pylint: enable=E1101
276 return d
277
278 def test_emit_user_registered(self):
279 """Test that the cb was called."""
280 app_name = 'app'
281 result = 'result'
282
283 @defer.inlineCallbacks
284 def test_emit(client):
285 """Actual test."""
286 client.on_user_registered_cb(app_name, result)
287 self.mocker.replay()
288 self.login.emit_user_registered(app_name, result)
289 yield client.unregister_to_signals()
290 self.mocker.verify()
291
292 d = self._get_client()
293 # pylint: disable=E1101
294 d.addCallback(test_emit)
295 # pylint: enable=E1101
296 return d
297
298 def test_emit_user_registration_error(self):
299 """Test that the cb was called."""
300 app_name = 'app'
301 error_value = 'error'
302 raised_error = self.mocker.mock()
303
304 @defer.inlineCallbacks
305 def test_emit(client):
306 """Actual test."""
307 raised_error.value
308 self.mocker.result(error_value)
309 self.except_to_errdict(error_value)
310 self.mocker.result(error_value)
311 client.on_user_registration_error_cb(app_name, error_value)
312 self.mocker.replay()
313 self.login.emit_user_registration_error(app_name, raised_error)
314 yield client.unregister_to_signals()
315 self.mocker.verify()
316
317 d = self._get_client()
318 # pylint: disable=E1101
319 d.addCallback(test_emit)
320 # pylint: enable=E1101
321 return d
322
323 def test_register_user(self):
324 """Test the call from the client."""
325 app_name = 'app'
326 email = 'email'
327 password = 'password'
328 displayname = 'name'
329 captcha_id = 'captcha_id'
330 captcha_solution = 'captcha_solution'
331
332 @defer.inlineCallbacks
333 def test_execution(client):
334 """Actual test."""
335 self.root.register_user(app_name, email, password, displayname,
336 captcha_id, captcha_solution, blocking,
337 self.login.emit_user_registered,
338 self.login.emit_user_registration_error)
339 self.mocker.replay()
340 yield client.register_user(app_name, email, password, displayname,
341 captcha_id, captcha_solution)
342 yield client.unregister_to_signals()
343 self.mocker.verify()
344
345 d = self._get_client()
346 # pylint: disable=E1101
347 d.addCallback(test_execution)
348 # pylint: enable=E1101
349 return d
350
351 def test_emit_logged_in(self):
352 """Test that the cb was called."""
353 app_name = 'app'
354 result = 'result'
355
356 @defer.inlineCallbacks
357 def test_emit(client):
358 """Actual test."""
359 client.on_logged_in_cb(app_name, result)
360 self.mocker.replay()
361 self.login.emit_logged_in(app_name, result)
362 yield client.unregister_to_signals()
363 self.mocker.verify()
364
365 d = self._get_client()
366 # pylint: disable=E1101
367 d.addCallback(test_emit)
368 # pylint: enable=E1101
369 return d
370
371 def test_emit_login_error(self):
372 """Test that the db was called."""
373 app_name = 'app'
374 error_value = 'error'
375 raised_error = self.mocker.mock()
376
377 @defer.inlineCallbacks
378 def test_emit(client):
379 """Actual test."""
380 raised_error.value
381 self.mocker.result(error_value)
382 self.except_to_errdict(error_value)
383 self.mocker.result(error_value)
384 client.on_login_error_cb(app_name, error_value)
385 self.mocker.replay()
386 self.login.emit_login_error(app_name, raised_error)
387 yield client.unregister_to_signals()
388 self.mocker.verify()
389
390 d = self._get_client()
391 # pylint: disable=E1101
392 d.addCallback(test_emit)
393 # pylint: enable=E1101
394 return d
395
396 def test_emit_user_not_validated(self):
397 """Test that the cb was called."""
398 app_name = 'app'
399 result = 'result'
400
401 @defer.inlineCallbacks
402 def test_emit(client):
403 """Actual test."""
404 client.on_user_not_validated_cb(app_name, result)
405 self.mocker.replay()
406 self.login.emit_user_not_validated(app_name, result)
407 yield client.unregister_to_signals()
408 self.mocker.verify()
409
410 d = self._get_client()
411 # pylint: disable=E1101
412 d.addCallback(test_emit)
413 # pylint: enable=E1101
414 return d
415
416 def test_login(self):
417 """Test the call from the client."""
418 app_name = 'app'
419 email = 'email'
420 password = 'password'
421
422 @defer.inlineCallbacks
423 def test_execution(client):
424 """Actual test."""
425 self.root.login(app_name, email, password, blocking,
426 self.login.emit_logged_in,
427 self.login.emit_login_error,
428 self.login.emit_user_not_validated)
429 self.mocker.replay()
430 yield client.login(app_name, email, password)
431 yield client.unregister_to_signals()
432 self.mocker.verify()
433
434 d = self._get_client()
435 # pylint: disable=E1101
436 d.addCallback(test_execution)
437 # pylint: enable=E1101
438 return d
439
440 def test_emit_email_validated(self):
441 """Test the cb was called."""
442 app_name = 'app'
443 result = 'result'
444
445 @defer.inlineCallbacks
446 def test_emit(client):
447 """Actual test."""
448 client.on_email_validated_cb(app_name, result)
449 self.mocker.replay()
450 self.login.emit_email_validated(app_name, result)
451 yield client.unregister_to_signals()
452 self.mocker.verify()
453
454 d = self._get_client()
455 # pylint: disable=E1101
456 d.addCallback(test_emit)
457 # pylint: enable=E1101
458 return d
459
460 def test_emit_email_validation_error(self):
461 """Test the cb was called."""
462 app_name = 'app'
463 error_value = 'error'
464 raised_error = self.mocker.mock()
465
466 @defer.inlineCallbacks
467 def test_emit(client):
468 """Actual test."""
469 raised_error.value
470 self.mocker.result(error_value)
471 self.except_to_errdict(error_value)
472 self.mocker.result(error_value)
473 client.on_email_validation_error_cb(app_name, error_value)
474 self.mocker.replay()
475 self.login.emit_email_validation_error(app_name, raised_error)
476 yield client.unregister_to_signals()
477 self.mocker.verify()
478
479 d = self._get_client()
480 # pylint: disable=E1101
481 d.addCallback(test_emit)
482 # pylint: enable=E1101
483 return d
484
485 def test_validate_email(self):
486 """Test the client calll."""
487 app_name = 'app'
488 email = 'email'
489 password = 'password'
490 email_token = 'token'
491
492 @defer.inlineCallbacks
493 def test_execution(client):
494 """Actual test."""
495 self.root.validate_email(app_name, email, password, email_token,
496 blocking, self.login.emit_email_validated,
497 self.login.emit_email_validation_error)
498 self.mocker.replay()
499 yield client.validate_email(app_name, email, password, email_token)
500 yield client.unregister_to_signals()
501 self.mocker.verify()
502
503 d = self._get_client()
504 # pylint: disable=E1101
505 d.addCallback(test_execution)
506 # pylint: enable=E1101
507 return d
508
509 def test_emit_password_reset_token_sent(self):
510 """Test the cb was called."""
511 app_name = 'app'
512 result = 'result'
513
514 @defer.inlineCallbacks
515 def test_emit(client):
516 """Actual test."""
517 client.on_password_reset_token_sent_cb(app_name, result)
518 self.mocker.replay()
519 self.login.emit_password_reset_token_sent(app_name, result)
520 yield client.unregister_to_signals()
521 self.mocker.verify()
522
523 d = self._get_client()
524 # pylint: disable=E1101
525 d.addCallback(test_emit)
526 # pylint: enable=E1101
527 return d
528
529 def test_emit_password_reset_error(self):
530 """Test the cb was called."""
531 app_name = 'app'
532 error_value = 'error'
533 raised_error = self.mocker.mock()
534
535 @defer.inlineCallbacks
536 def test_emit(client):
537 """Actual test."""
538 raised_error.value
539 self.mocker.result(error_value)
540 self.except_to_errdict(error_value)
541 self.mocker.result(error_value)
542 client.on_password_reset_error_cb(app_name, error_value)
543 self.mocker.replay()
544 self.login.emit_password_reset_error(app_name, raised_error)
545 yield client.unregister_to_signals()
546 self.mocker.verify()
547
548 d = self._get_client()
549 # pylint: disable=E1101
550 d.addCallback(test_emit)
551 # pylint: enable=E1101
552 return d
553
554 def test_request_password_reset_token(self):
555 """Test the client call."""
556 app_name = 'app'
557 email = 'email'
558
559 @defer.inlineCallbacks
560 def test_execution(client):
561 """Actual test."""
562 self.root.request_password_reset_token(app_name, email, blocking,
563 self.login.emit_password_reset_token_sent,
564 self.login.emit_password_reset_error)
565 self.mocker.replay()
566 client.request_password_reset_token(app_name, email)
567 yield client.unregister_to_signals()
568 self.mocker.verify()
569
570 d = self._get_client()
571 # pylint: disable=E1101
572 d.addCallback(test_execution)
573 # pylint: enable=E1101
574 return d
575
576 def test_emit_password_changed(self):
577 """Test the cb was called."""
578 app_name = 'app'
579 result = 'result'
580
581 @defer.inlineCallbacks
582 def test_emit(client):
583 """Actual test."""
584 client.on_password_changed_cb(app_name, result)
585 self.mocker.replay()
586 self.login.emit_password_changed(app_name, result)
587 yield client.unregister_to_signals()
588 self.mocker.verify()
589
590 d = self._get_client()
591 # pylint: disable=E1101
592 d.addCallback(test_emit)
593 # pylint: enable=E1101
594 return d
595
596 def test_emit_password_change_error(self):
597 """Test the cb was called."""
598 app_name = 'app'
599 error_value = 'error'
600 raised_error = self.mocker.mock()
601
602 @defer.inlineCallbacks
603 def test_emit(client):
604 """Actual test."""
605 raised_error.value
606 self.mocker.result(error_value)
607 self.except_to_errdict(error_value)
608 self.mocker.result(error_value)
609 client.on_password_change_error(app_name, error_value)
610 self.mocker.replay()
611 self.login.emit_password_change_error(app_name, raised_error)
612 yield client.unregister_to_signals()
613 self.mocker.verify()
614
615 d = self._get_client()
616 # pylint: disable=E1101
617 d.addCallback(test_emit)
618 # pylint: enable=E1101
619 return d
620
621 def test_set_new_password(self):
622 """Test the client call."""
623 app_name = 'app'
624 email = 'email'
625 token = 'token'
626 new_password = 'password'
627
628 @defer.inlineCallbacks
629 def test_execution(client):
630 """Actual test."""
631 self.root.set_new_password(app_name, email, token, new_password,
632 blocking, self.login.emit_password_changed,
633 self.login.emit_password_change_error)
634 self.mocker.replay()
635 yield client.set_new_password(app_name, email, token, new_password)
636 yield client.unregister_to_signals()
637 self.mocker.verify()
638
639 d = self._get_client()
640 # pylint: disable=E1101
641 d.addCallback(test_execution)
642 # pylint: enable=E1101
643 return d
644
645
646class SSOCredentialsTestCase(TestCase):
647 """Test the credentials class."""
648
649 def setUp(self):
650 """Set up tests."""
651 super(SSOCredentialsTestCase, self).setUp()
652 self.mocker = Mocker()
653 self.root = self.mocker.mock()
654 self.except_to_errdict = self.mocker.replace(
655 'ubuntu_sso.main.except_to_errdict')
656 self.creds = SSOCredentials(None)
657 self.creds.root = self.root
658 # start pb
659 self.sso_root = UbuntuSSORoot(None, self.creds, None)
660 self.server_factory = SaveProtocolServerFactory(self.sso_root)
661 # pylint: disable=E1101
662 self.listener = reactor.listenPipe(NAMED_PIPE_URL, self.server_factory)
663 self.client_factory = PBClientFactory()
664 self.connector = reactor.connectPipe(NAMED_PIPE_URL,
665 self.client_factory)
666 # pylint: enable=E1101
667
668 def tearDown(self):
669 """Clean reactor."""
670 if self.server_factory.protocolInstance is not None:
671 self.server_factory.protocolInstance.transport.loseConnection()
672 return defer.gatherResults([self._tearDownServer(),
673 self._tearDownClient()])
674
675 def _tearDownServer(self):
676 """Teardown the server."""
677 return defer.maybeDeferred(self.listener.stopListening)
678
679 def _tearDownClient(self):
680 """Tear down the client."""
681 self.connector.disconnect()
682 return defer.succeed(None)
683
684 @defer.inlineCallbacks
685 def _get_client(self):
686 """Get the client."""
687 # request the remote object and create a client
688 root = yield self.client_factory.getRootObject()
689 remote = yield root.callRemote('get_sso_credentials')
690 client = SSOCredentialsClient(remote)
691 yield client.register_to_signals()
692 # set the cb
693 for signal_name in ['on_authorization_denied_cb',
694 'on_credentials_found_cb',
695 'on_credentials_error_cb']:
696 setattr(client, signal_name, self.mocker.mock())
697 defer.returnValue(client)
698
699 def test_emit_authorization_denied(self):
700 """Test that the cb is executed."""
701 app_name = 'app'
702
703 @defer.inlineCallbacks
704 def test_emit(client):
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: