Merge lp:~pitti/ubiquity/pygobject-fixes into lp:ubiquity
- pygobject-fixes
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 5773 |
Proposed branch: | lp:~pitti/ubiquity/pygobject-fixes |
Merge into: | lp:ubiquity |
Diff against target: |
429 lines (+70/-62) 12 files modified
bin/oem-config-remove-gtk (+2/-2) bin/ubiquity-bluetooth-agent (+3/-3) debian/changelog (+8/-0) tests/test_timezone.py (+4/-4) ubiquity/frontend/gtk_ui.py (+12/-12) ubiquity/frontend/noninteractive.py (+7/-7) ubiquity/gtkwidgets.py (+5/-5) ubiquity/nm.py (+5/-5) ubiquity/plugins/ubi-console-setup.py (+6/-6) ubiquity/plugins/ubi-language.py (+3/-3) ubiquity/plugins/ubi-timezone.py (+8/-8) ubiquity/plugins/ubi-usersetup.py (+7/-7) |
To merge this branch: | bzr merge lp:~pitti/ubiquity/pygobject-fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Dimitri John Ledkov | Approve | ||
Review via email: mp+136327@code.launchpad.net |
Commit message
Description of the change
This branch fixes ubiquity to work with current pygobject (see current autopkgtest failure in -proposed), and fixes some long-deprecated API which pygobject 3.7.x now triggers warnings for.
Note that I get two test failures locally:
ERROR: test_interface_
-------
Traceback (most recent call last):
File "/home/
% missing_
Exception: Missing translation for:
question_label, ubi_question_dialog
=======
FAIL: test_windows_only (test_ubi_
-------
Traceback (most recent call last):
File "/home/
self.
AssertionError: 'resize' not found in {'manual': PartitioningOpt
-------
These happen with the old and new pygobject, and with and without the branch.
They might be a local problem on my checkout/
tell anything to you?
Preview Diff
1 | === modified file 'bin/oem-config-remove-gtk' | |||
2 | --- bin/oem-config-remove-gtk 2012-09-06 17:13:01 +0000 | |||
3 | +++ bin/oem-config-remove-gtk 2012-11-27 06:10:25 +0000 | |||
4 | @@ -26,10 +26,10 @@ | |||
5 | 26 | import glob | 26 | import glob |
6 | 27 | 27 | ||
7 | 28 | from aptdaemon.gtk3widgets import AptProgressDialog | 28 | from aptdaemon.gtk3widgets import AptProgressDialog |
9 | 29 | from gi.repository import GObject, Gtk | 29 | from gi.repository import GLib, Gtk |
10 | 30 | from aptdaemon import client, enums | 30 | from aptdaemon import client, enums |
11 | 31 | 31 | ||
13 | 32 | loop = GObject.MainLoop() | 32 | loop = GLib.MainLoop() |
14 | 33 | 33 | ||
15 | 34 | 34 | ||
16 | 35 | def _on_failure(error): | 35 | def _on_failure(error): |
17 | 36 | 36 | ||
18 | === modified file 'bin/ubiquity-bluetooth-agent' | |||
19 | --- bin/ubiquity-bluetooth-agent 2012-07-16 14:29:13 +0000 | |||
20 | +++ bin/ubiquity-bluetooth-agent 2012-11-27 06:10:25 +0000 | |||
21 | @@ -6,7 +6,7 @@ | |||
22 | 6 | import dbus | 6 | import dbus |
23 | 7 | import dbus.service | 7 | import dbus.service |
24 | 8 | import dbus.mainloop.glib | 8 | import dbus.mainloop.glib |
26 | 9 | from gi.repository import GObject | 9 | from gi.repository import GLib |
27 | 10 | 10 | ||
28 | 11 | 11 | ||
29 | 12 | class Rejected(dbus.DBusException): | 12 | class Rejected(dbus.DBusException): |
30 | @@ -97,10 +97,10 @@ | |||
31 | 97 | bus.get_object("org.bluez", manager.DefaultAdapter()), | 97 | bus.get_object("org.bluez", manager.DefaultAdapter()), |
32 | 98 | "org.bluez.Adapter") | 98 | "org.bluez.Adapter") |
33 | 99 | agent = Agent(bus, "/ubiquity/bluetooth/agent") | 99 | agent = Agent(bus, "/ubiquity/bluetooth/agent") |
35 | 100 | mainloop = GObject.MainLoop() | 100 | mainloop = GLib.MainLoop() |
36 | 101 | adapter.RegisterAgent("/ubiquity/bluetooth/agent", "DisplayYesNo") | 101 | adapter.RegisterAgent("/ubiquity/bluetooth/agent", "DisplayYesNo") |
37 | 102 | except dbus.exceptions.DBusException: | 102 | except dbus.exceptions.DBusException: |
38 | 103 | exit_handler() | 103 | exit_handler() |
39 | 104 | 104 | ||
41 | 105 | GObject.timeout_add(300000, exit_handler) | 105 | GLib.timeout_add(300000, exit_handler) |
42 | 106 | mainloop.run() | 106 | mainloop.run() |
43 | 107 | 107 | ||
44 | === modified file 'debian/changelog' | |||
45 | --- debian/changelog 2012-11-26 13:06:06 +0000 | |||
46 | +++ debian/changelog 2012-11-27 06:10:25 +0000 | |||
47 | @@ -14,6 +14,14 @@ | |||
48 | 14 | * Fonconfig-voodoo is gone, not sure if some other "fontconfig"ury | 14 | * Fonconfig-voodoo is gone, not sure if some other "fontconfig"ury |
49 | 15 | should be called instead. (LP: #1043031) | 15 | should be called instead. (LP: #1043031) |
50 | 16 | 16 | ||
51 | 17 | [ Martin Pitt ] | ||
52 | 18 | * ubiquity/gtkwidgets.py: Don't use GObject.constants, just use the | ||
53 | 19 | constants from GObject as intended. Fixes a crash with pygobject | ||
54 | 20 | 3.7.2. | ||
55 | 21 | * Use glib API from the GLib GI module instead of GObject. The latter | ||
56 | 22 | has been deprecated for a long time and triggers warnings with pygobject | ||
57 | 23 | 3.7.2. | ||
58 | 24 | |||
59 | 17 | -- Colin Watson <cjwatson@ubuntu.com> Thu, 22 Nov 2012 16:25:28 +0000 | 25 | -- Colin Watson <cjwatson@ubuntu.com> Thu, 22 Nov 2012 16:25:28 +0000 |
60 | 18 | 26 | ||
61 | 19 | ubiquity (2.13.3) raring; urgency=low | 27 | ubiquity (2.13.3) raring; urgency=low |
62 | 20 | 28 | ||
63 | === modified file 'tests/test_timezone.py' | |||
64 | --- tests/test_timezone.py 2012-11-22 16:27:21 +0000 | |||
65 | +++ tests/test_timezone.py 2012-11-27 06:10:25 +0000 | |||
66 | @@ -25,9 +25,9 @@ | |||
67 | 25 | @mock.patch('gi.repository.Soup.Message') | 25 | @mock.patch('gi.repository.Soup.Message') |
68 | 26 | @mock.patch('json.loads') | 26 | @mock.patch('json.loads') |
69 | 27 | def test_city_entry(self, json_mock, *args): | 27 | def test_city_entry(self, json_mock, *args): |
71 | 28 | from gi.repository import GObject | 28 | from gi.repository import GLib |
72 | 29 | 29 | ||
74 | 30 | # Patch GObject.timeout_add_seconds to call the supplied function | 30 | # Patch GLib.timeout_add_seconds to call the supplied function |
75 | 31 | # immediately rather than waiting for the interval to expire. | 31 | # immediately rather than waiting for the interval to expire. |
76 | 32 | def side_effect_factory(real_method): | 32 | def side_effect_factory(real_method): |
77 | 33 | def side_effect(interval, function, data): | 33 | def side_effect(interval, function, data): |
78 | @@ -35,8 +35,8 @@ | |||
79 | 35 | return side_effect | 35 | return side_effect |
80 | 36 | 36 | ||
81 | 37 | json_mock.return_value = [] | 37 | json_mock.return_value = [] |
84 | 38 | real_method = GObject.timeout_add_seconds | 38 | real_method = GLib.timeout_add_seconds |
85 | 39 | method = mock.patch('gi.repository.GObject.timeout_add_seconds') | 39 | method = mock.patch('gi.repository.GLib.timeout_add_seconds') |
86 | 40 | timeout_mock = method.start() | 40 | timeout_mock = method.start() |
87 | 41 | timeout_mock.side_effect = side_effect_factory(real_method) | 41 | timeout_mock.side_effect = side_effect_factory(real_method) |
88 | 42 | self.addCleanup(method.stop) | 42 | self.addCleanup(method.stop) |
89 | 43 | 43 | ||
90 | === modified file 'ubiquity/frontend/gtk_ui.py' | |||
91 | --- ubiquity/frontend/gtk_ui.py 2012-10-19 01:18:48 +0000 | |||
92 | +++ ubiquity/frontend/gtk_ui.py 2012-11-27 06:10:25 +0000 | |||
93 | @@ -49,7 +49,7 @@ | |||
94 | 49 | 49 | ||
95 | 50 | #in query mode we won't be in X, but import needs to pass | 50 | #in query mode we won't be in X, but import needs to pass |
96 | 51 | if 'DISPLAY' in os.environ: | 51 | if 'DISPLAY' in os.environ: |
98 | 52 | from gi.repository import Gtk, Gdk, GObject | 52 | from gi.repository import Gtk, Gdk, GObject, GLib |
99 | 53 | GObject.threads_init() | 53 | GObject.threads_init() |
100 | 54 | from ubiquity import gtkwidgets | 54 | from ubiquity import gtkwidgets |
101 | 55 | 55 | ||
102 | @@ -468,13 +468,13 @@ | |||
103 | 468 | sys.exit(1) | 468 | sys.exit(1) |
104 | 469 | 469 | ||
105 | 470 | def network_change(self, online=False): | 470 | def network_change(self, online=False): |
107 | 471 | from gi.repository import GObject | 471 | from gi.repository import GLib |
108 | 472 | if not online: | 472 | if not online: |
109 | 473 | self.set_online_state(False) | 473 | self.set_online_state(False) |
110 | 474 | return | 474 | return |
111 | 475 | if self.timeout_id: | 475 | if self.timeout_id: |
114 | 476 | GObject.source_remove(self.timeout_id) | 476 | GLib.source_remove(self.timeout_id) |
115 | 477 | self.timeout_id = GObject.timeout_add(300, self.check_returncode) | 477 | self.timeout_id = GLib.timeout_add(300, self.check_returncode) |
116 | 478 | 478 | ||
117 | 479 | def set_online_state(self, state): | 479 | def set_online_state(self, state): |
118 | 480 | for p in self.pages: | 480 | for p in self.pages: |
119 | @@ -751,7 +751,7 @@ | |||
120 | 751 | 751 | ||
121 | 752 | if self.dbfilter is not None and self.dbfilter != old_dbfilter: | 752 | if self.dbfilter is not None and self.dbfilter != old_dbfilter: |
122 | 753 | self.allow_change_step(False) | 753 | self.allow_change_step(False) |
124 | 754 | GObject.idle_add( | 754 | GLib.idle_add( |
125 | 755 | lambda: self.dbfilter.start(auto_process=True)) | 755 | lambda: self.dbfilter.start(auto_process=True)) |
126 | 756 | 756 | ||
127 | 757 | page.controller.dbfilter = self.dbfilter | 757 | page.controller.dbfilter = self.dbfilter |
128 | @@ -1448,17 +1448,17 @@ | |||
129 | 1448 | # Callbacks provided to components. | 1448 | # Callbacks provided to components. |
130 | 1449 | 1449 | ||
131 | 1450 | def watch_debconf_fd(self, from_debconf, process_input): | 1450 | def watch_debconf_fd(self, from_debconf, process_input): |
135 | 1451 | GObject.io_add_watch(from_debconf, | 1451 | GLib.io_add_watch(from_debconf, |
136 | 1452 | GObject.IO_IN | GObject.IO_ERR | GObject.IO_HUP, | 1452 | GLib.IO_IN | GLib.IO_ERR | GLib.IO_HUP, |
137 | 1453 | self.watch_debconf_fd_helper, process_input) | 1453 | self.watch_debconf_fd_helper, process_input) |
138 | 1454 | 1454 | ||
139 | 1455 | def watch_debconf_fd_helper(self, source, cb_condition, callback): | 1455 | def watch_debconf_fd_helper(self, source, cb_condition, callback): |
140 | 1456 | debconf_condition = 0 | 1456 | debconf_condition = 0 |
142 | 1457 | if (cb_condition & GObject.IO_IN) != 0: | 1457 | if (cb_condition & GLib.IO_IN) != 0: |
143 | 1458 | debconf_condition |= filteredcommand.DEBCONF_IO_IN | 1458 | debconf_condition |= filteredcommand.DEBCONF_IO_IN |
145 | 1459 | if (cb_condition & GObject.IO_ERR) != 0: | 1459 | if (cb_condition & GLib.IO_ERR) != 0: |
146 | 1460 | debconf_condition |= filteredcommand.DEBCONF_IO_ERR | 1460 | debconf_condition |= filteredcommand.DEBCONF_IO_ERR |
148 | 1461 | if (cb_condition & GObject.IO_HUP) != 0: | 1461 | if (cb_condition & GLib.IO_HUP) != 0: |
149 | 1462 | debconf_condition |= filteredcommand.DEBCONF_IO_HUP | 1462 | debconf_condition |= filteredcommand.DEBCONF_IO_HUP |
150 | 1463 | 1463 | ||
151 | 1464 | return callback(source, debconf_condition) | 1464 | return callback(source, debconf_condition) |
152 | @@ -1751,7 +1751,7 @@ | |||
153 | 1751 | 1751 | ||
154 | 1752 | def quit_quit(): | 1752 | def quit_quit(): |
155 | 1753 | # Wait until we're actually out of this main loop | 1753 | # Wait until we're actually out of this main loop |
157 | 1754 | GObject.idle_add(idle_quit) | 1754 | GLib.idle_add(idle_quit) |
158 | 1755 | return False | 1755 | return False |
159 | 1756 | 1756 | ||
160 | 1757 | if self.pending_quits == 0: | 1757 | if self.pending_quits == 0: |
161 | 1758 | 1758 | ||
162 | === modified file 'ubiquity/frontend/noninteractive.py' | |||
163 | --- ubiquity/frontend/noninteractive.py 2012-09-25 20:59:09 +0000 | |||
164 | +++ ubiquity/frontend/noninteractive.py 2012-11-27 06:10:25 +0000 | |||
165 | @@ -30,7 +30,7 @@ | |||
166 | 30 | import signal | 30 | import signal |
167 | 31 | import sys | 31 | import sys |
168 | 32 | 32 | ||
170 | 33 | from gi.repository import GObject | 33 | from gi.repository import GLib |
171 | 34 | 34 | ||
172 | 35 | from ubiquity import filteredcommand, i18n | 35 | from ubiquity import filteredcommand, i18n |
173 | 36 | from ubiquity import misc | 36 | from ubiquity import misc |
174 | @@ -53,7 +53,7 @@ | |||
175 | 53 | self.progress_position = ubiquity.progressposition.ProgressPosition() | 53 | self.progress_position = ubiquity.progressposition.ProgressPosition() |
176 | 54 | self.progress_val = 0 | 54 | self.progress_val = 0 |
177 | 55 | self.progress_info = '' | 55 | self.progress_info = '' |
179 | 56 | self.mainloop = GObject.MainLoop() | 56 | self.mainloop = GLib.MainLoop() |
180 | 57 | 57 | ||
181 | 58 | self.pages = [] | 58 | self.pages = [] |
182 | 59 | for mod in self.modules: | 59 | for mod in self.modules: |
183 | @@ -137,17 +137,17 @@ | |||
184 | 137 | from the filtered command and a process_input callback which should | 137 | from the filtered command and a process_input callback which should |
185 | 138 | be called when input events are received.""" | 138 | be called when input events are received.""" |
186 | 139 | 139 | ||
189 | 140 | GObject.io_add_watch(from_debconf, | 140 | GLib.io_add_watch(from_debconf, |
190 | 141 | GObject.IO_IN | GObject.IO_ERR | GObject.IO_HUP, | 141 | GLib.IO_IN | GLib.IO_ERR | GLib.IO_HUP, |
191 | 142 | self.watch_debconf_fd_helper, process_input) | 142 | self.watch_debconf_fd_helper, process_input) |
192 | 143 | 143 | ||
193 | 144 | def watch_debconf_fd_helper(self, source, cb_condition, callback): | 144 | def watch_debconf_fd_helper(self, source, cb_condition, callback): |
194 | 145 | debconf_condition = 0 | 145 | debconf_condition = 0 |
196 | 146 | if (cb_condition & GObject.IO_IN) != 0: | 146 | if (cb_condition & GLib.IO_IN) != 0: |
197 | 147 | debconf_condition |= filteredcommand.DEBCONF_IO_IN | 147 | debconf_condition |= filteredcommand.DEBCONF_IO_IN |
199 | 148 | if (cb_condition & GObject.IO_ERR) != 0: | 148 | if (cb_condition & GLib.IO_ERR) != 0: |
200 | 149 | debconf_condition |= filteredcommand.DEBCONF_IO_ERR | 149 | debconf_condition |= filteredcommand.DEBCONF_IO_ERR |
202 | 150 | if (cb_condition & GObject.IO_HUP) != 0: | 150 | if (cb_condition & GLib.IO_HUP) != 0: |
203 | 151 | debconf_condition |= filteredcommand.DEBCONF_IO_HUP | 151 | debconf_condition |= filteredcommand.DEBCONF_IO_HUP |
204 | 152 | 152 | ||
205 | 153 | return callback(source, debconf_condition) | 153 | return callback(source, debconf_condition) |
206 | 154 | 154 | ||
207 | === modified file 'ubiquity/gtkwidgets.py' | |||
208 | --- ubiquity/gtkwidgets.py 2012-11-22 16:27:21 +0000 | |||
209 | +++ ubiquity/gtkwidgets.py 2012-11-27 06:10:25 +0000 | |||
210 | @@ -39,10 +39,10 @@ | |||
211 | 39 | __gproperties__ = { | 39 | __gproperties__ = { |
212 | 40 | 'radius': ( | 40 | 'radius': ( |
213 | 41 | GObject.TYPE_INT, 'Radius', 'The radius of the rounded corners.', | 41 | GObject.TYPE_INT, 'Radius', 'The radius of the rounded corners.', |
215 | 42 | 0, GObject.constants.G_MAXINT, 10, GObject.PARAM_READWRITE), | 42 | 0, GObject.G_MAXINT, 10, GObject.PARAM_READWRITE), |
216 | 43 | 'width': ( | 43 | 'width': ( |
217 | 44 | GObject.TYPE_INT, 'Width', 'The width of the outline.', | 44 | GObject.TYPE_INT, 'Width', 'The width of the outline.', |
219 | 45 | 0, GObject.constants.G_MAXINT, 1, GObject.PARAM_READWRITE), | 45 | 0, GObject.G_MAXINT, 1, GObject.PARAM_READWRITE), |
220 | 46 | } | 46 | } |
221 | 47 | 47 | ||
222 | 48 | def __init__(self): | 48 | def __init__(self): |
223 | @@ -93,15 +93,15 @@ | |||
224 | 93 | 'part_size': ( | 93 | 'part_size': ( |
225 | 94 | GObject.TYPE_UINT64, 'Partition size', | 94 | GObject.TYPE_UINT64, 'Partition size', |
226 | 95 | 'The size of the partition being resized', | 95 | 'The size of the partition being resized', |
228 | 96 | 1, GObject.constants.G_MAXUINT64, 100, GObject.PARAM_READWRITE), | 96 | 1, GObject.G_MAXUINT64, 100, GObject.PARAM_READWRITE), |
229 | 97 | 'min_size': ( | 97 | 'min_size': ( |
230 | 98 | GObject.TYPE_UINT64, 'Minimum size', | 98 | GObject.TYPE_UINT64, 'Minimum size', |
231 | 99 | 'The minimum size that the existing partition can be resized to', | 99 | 'The minimum size that the existing partition can be resized to', |
233 | 100 | 0, GObject.constants.G_MAXUINT64, 0, GObject.PARAM_READWRITE), | 100 | 0, GObject.G_MAXUINT64, 0, GObject.PARAM_READWRITE), |
234 | 101 | 'max_size': ( | 101 | 'max_size': ( |
235 | 102 | GObject.TYPE_UINT64, 'Maximum size', | 102 | GObject.TYPE_UINT64, 'Maximum size', |
236 | 103 | 'The maximum size that the existing partition can be resized to', | 103 | 'The maximum size that the existing partition can be resized to', |
238 | 104 | 1, GObject.constants.G_MAXUINT64, 100, GObject.PARAM_READWRITE) | 104 | 1, GObject.G_MAXUINT64, 100, GObject.PARAM_READWRITE) |
239 | 105 | } | 105 | } |
240 | 106 | 106 | ||
241 | 107 | def do_get_property(self, prop): | 107 | def do_get_property(self, prop): |
242 | 108 | 108 | ||
243 | === modified file 'ubiquity/nm.py' | |||
244 | --- ubiquity/nm.py 2012-07-16 14:29:13 +0000 | |||
245 | +++ ubiquity/nm.py 2012-11-27 06:10:25 +0000 | |||
246 | @@ -4,7 +4,7 @@ | |||
247 | 4 | import dbus | 4 | import dbus |
248 | 5 | from dbus.mainloop.glib import DBusGMainLoop | 5 | from dbus.mainloop.glib import DBusGMainLoop |
249 | 6 | DBusGMainLoop(set_as_default=True) | 6 | DBusGMainLoop(set_as_default=True) |
251 | 7 | from gi.repository import Gtk, GObject | 7 | from gi.repository import Gtk, GObject, GLib |
252 | 8 | 8 | ||
253 | 9 | NM = 'org.freedesktop.NetworkManager' | 9 | NM = 'org.freedesktop.NetworkManager' |
254 | 10 | NM_DEVICE = 'org.freedesktop.NetworkManager.Device' | 10 | NM_DEVICE = 'org.freedesktop.NetworkManager.Device' |
255 | @@ -174,8 +174,8 @@ | |||
256 | 174 | 174 | ||
257 | 175 | def queue_build_cache(self, *args): | 175 | def queue_build_cache(self, *args): |
258 | 176 | if self.timeout_id: | 176 | if self.timeout_id: |
261 | 177 | GObject.source_remove(self.timeout_id) | 177 | GLib.source_remove(self.timeout_id) |
262 | 178 | self.timeout_id = GObject.timeout_add(500, self.build_cache) | 178 | self.timeout_id = GLib.timeout_add(500, self.build_cache) |
263 | 179 | 179 | ||
264 | 180 | def properties_changed(self, props, path=None): | 180 | def properties_changed(self, props, path=None): |
265 | 181 | if 'Strength' in props: | 181 | if 'Strength' in props: |
266 | @@ -275,8 +275,8 @@ | |||
267 | 275 | 275 | ||
268 | 276 | def queue_rows_changed(*args): | 276 | def queue_rows_changed(*args): |
269 | 277 | if self.rows_changed_id: | 277 | if self.rows_changed_id: |
272 | 278 | GObject.source_remove(self.rows_changed_id) | 278 | GLib.source_remove(self.rows_changed_id) |
273 | 279 | self.rows_changed_id = GObject.idle_add(self.rows_changed) | 279 | self.rows_changed_id = GLib.idle_add(self.rows_changed) |
274 | 280 | 280 | ||
275 | 281 | model.connect('row-inserted', queue_rows_changed) | 281 | model.connect('row-inserted', queue_rows_changed) |
276 | 282 | model.connect('row-deleted', queue_rows_changed) | 282 | model.connect('row-deleted', queue_rows_changed) |
277 | 283 | 283 | ||
278 | === modified file 'ubiquity/plugins/ubi-console-setup.py' | |||
279 | --- ubiquity/plugins/ubi-console-setup.py 2012-11-22 16:27:21 +0000 | |||
280 | +++ ubiquity/plugins/ubi-console-setup.py 2012-11-27 06:10:25 +0000 | |||
281 | @@ -106,10 +106,10 @@ | |||
282 | 106 | def on_keyboard_layout_selected(self, *args): | 106 | def on_keyboard_layout_selected(self, *args): |
283 | 107 | if not 'UBIQUITY_AUTOMATIC' in os.environ: | 107 | if not 'UBIQUITY_AUTOMATIC' in os.environ: |
284 | 108 | # Let's not call this every time the user presses a key. | 108 | # Let's not call this every time the user presses a key. |
286 | 109 | from gi.repository import GObject | 109 | from gi.repository import GLib |
287 | 110 | if self.keyboard_layout_timeout_id: | 110 | if self.keyboard_layout_timeout_id: |
290 | 111 | GObject.source_remove(self.keyboard_layout_timeout_id) | 111 | GLib.source_remove(self.keyboard_layout_timeout_id) |
291 | 112 | self.keyboard_layout_timeout_id = GObject.timeout_add( | 112 | self.keyboard_layout_timeout_id = GLib.timeout_add( |
292 | 113 | 600, self.keyboard_layout_timeout) | 113 | 600, self.keyboard_layout_timeout) |
293 | 114 | else: | 114 | else: |
294 | 115 | self.keyboard_layout_timeout() | 115 | self.keyboard_layout_timeout() |
295 | @@ -128,10 +128,10 @@ | |||
296 | 128 | def on_keyboard_variant_selected(self, *args): | 128 | def on_keyboard_variant_selected(self, *args): |
297 | 129 | if not 'UBIQUITY_AUTOMATIC' in os.environ: | 129 | if not 'UBIQUITY_AUTOMATIC' in os.environ: |
298 | 130 | # Let's not call this every time the user presses a key. | 130 | # Let's not call this every time the user presses a key. |
300 | 131 | from gi.repository import GObject | 131 | from gi.repository import GLib |
301 | 132 | if self.keyboard_variant_timeout_id: | 132 | if self.keyboard_variant_timeout_id: |
304 | 133 | GObject.source_remove(self.keyboard_variant_timeout_id) | 133 | GLib.source_remove(self.keyboard_variant_timeout_id) |
305 | 134 | self.keyboard_variant_timeout_id = GObject.timeout_add( | 134 | self.keyboard_variant_timeout_id = GLib.timeout_add( |
306 | 135 | 600, self.keyboard_variant_timeout) | 135 | 600, self.keyboard_variant_timeout) |
307 | 136 | else: | 136 | else: |
308 | 137 | self.keyboard_variant_timeout() | 137 | self.keyboard_variant_timeout() |
309 | 138 | 138 | ||
310 | === modified file 'ubiquity/plugins/ubi-language.py' | |||
311 | --- ubiquity/plugins/ubi-language.py 2012-10-19 17:03:08 +0000 | |||
312 | +++ ubiquity/plugins/ubi-language.py 2012-11-27 06:10:25 +0000 | |||
313 | @@ -302,13 +302,13 @@ | |||
314 | 302 | w.show() | 302 | w.show() |
315 | 303 | 303 | ||
316 | 304 | def plugin_set_online_state(self, state): | 304 | def plugin_set_online_state(self, state): |
318 | 305 | from gi.repository import GObject | 305 | from gi.repository import GLib |
319 | 306 | if self.release_notes_label: | 306 | if self.release_notes_label: |
320 | 307 | if self.timeout_id: | 307 | if self.timeout_id: |
322 | 308 | GObject.source_remove(self.timeout_id) | 308 | GLib.source_remove(self.timeout_id) |
323 | 309 | if state: | 309 | if state: |
324 | 310 | self.release_notes_label.show() | 310 | self.release_notes_label.show() |
326 | 311 | self.timeout_id = GObject.timeout_add( | 311 | self.timeout_id = GLib.timeout_add( |
327 | 312 | 300, self.check_returncode) | 312 | 300, self.check_returncode) |
328 | 313 | else: | 313 | else: |
329 | 314 | self.release_notes_label.hide() | 314 | self.release_notes_label.hide() |
330 | 315 | 315 | ||
331 | === modified file 'ubiquity/plugins/ubi-timezone.py' | |||
332 | --- ubiquity/plugins/ubi-timezone.py 2012-10-19 17:03:08 +0000 | |||
333 | +++ ubiquity/plugins/ubi-timezone.py 2012-11-27 06:10:25 +0000 | |||
334 | @@ -97,7 +97,7 @@ | |||
335 | 97 | self.controller.allow_go_forward(True) | 97 | self.controller.allow_go_forward(True) |
336 | 98 | 98 | ||
337 | 99 | def changed(self, entry): | 99 | def changed(self, entry): |
339 | 100 | from gi.repository import Gtk, GObject, Soup | 100 | from gi.repository import Gtk, GObject, GLib, Soup |
340 | 101 | 101 | ||
341 | 102 | text = misc.utf8(self.city_entry.get_text()) | 102 | text = misc.utf8(self.city_entry.get_text()) |
342 | 103 | if not text: | 103 | if not text: |
343 | @@ -119,9 +119,9 @@ | |||
344 | 119 | message.request_headers.append('User-agent', 'Ubiquity/1.0') | 119 | message.request_headers.append('User-agent', 'Ubiquity/1.0') |
345 | 120 | self.geoname_session.abort() | 120 | self.geoname_session.abort() |
346 | 121 | if self.geoname_timeout_id is not None: | 121 | if self.geoname_timeout_id is not None: |
348 | 122 | GObject.source_remove(self.geoname_timeout_id) | 122 | GLib.source_remove(self.geoname_timeout_id) |
349 | 123 | self.geoname_timeout_id = \ | 123 | self.geoname_timeout_id = \ |
351 | 124 | GObject.timeout_add_seconds(2, self.geoname_timeout, | 124 | GLib.timeout_add_seconds(2, self.geoname_timeout, |
352 | 125 | (text, model)) | 125 | (text, model)) |
353 | 126 | self.geoname_session.queue_message(message, self.geoname_cb, | 126 | self.geoname_session.queue_message(message, self.geoname_cb, |
354 | 127 | (text, model)) | 127 | (text, model)) |
355 | @@ -157,12 +157,12 @@ | |||
356 | 157 | def geoname_cb(self, session, message, user_data): | 157 | def geoname_cb(self, session, message, user_data): |
357 | 158 | import syslog | 158 | import syslog |
358 | 159 | import json | 159 | import json |
360 | 160 | from gi.repository import GObject, Soup | 160 | from gi.repository import GLib, Soup |
361 | 161 | 161 | ||
362 | 162 | text, model = user_data | 162 | text, model = user_data |
363 | 163 | 163 | ||
364 | 164 | if self.geoname_timeout_id is not None: | 164 | if self.geoname_timeout_id is not None: |
366 | 165 | GObject.source_remove(self.geoname_timeout_id) | 165 | GLib.source_remove(self.geoname_timeout_id) |
367 | 166 | self.geoname_timeout_id = None | 166 | self.geoname_timeout_id = None |
368 | 167 | self.geoname_add_tzdb(text, model) | 167 | self.geoname_add_tzdb(text, model) |
369 | 168 | 168 | ||
370 | @@ -192,7 +192,7 @@ | |||
371 | 192 | 192 | ||
372 | 193 | def setup_page(self): | 193 | def setup_page(self): |
373 | 194 | # TODO Put a frame around the completion to add contrast (LP: #605908) | 194 | # TODO Put a frame around the completion to add contrast (LP: #605908) |
375 | 195 | from gi.repository import Gtk, GObject | 195 | from gi.repository import Gtk, GLib |
376 | 196 | from gi.repository import TimezoneMap | 196 | from gi.repository import TimezoneMap |
377 | 197 | self.tzdb = ubiquity.tz.Database() | 197 | self.tzdb = ubiquity.tz.Database() |
378 | 198 | self.tzmap = TimezoneMap.TimezoneMap() | 198 | self.tzmap = TimezoneMap.TimezoneMap() |
379 | @@ -207,8 +207,8 @@ | |||
380 | 207 | 207 | ||
381 | 208 | def queue_entry_changed(entry): | 208 | def queue_entry_changed(entry): |
382 | 209 | if self.timeout_id: | 209 | if self.timeout_id: |
385 | 210 | GObject.source_remove(self.timeout_id) | 210 | GLib.source_remove(self.timeout_id) |
386 | 211 | self.timeout_id = GObject.timeout_add(300, self.changed, entry) | 211 | self.timeout_id = GLib.timeout_add(300, self.changed, entry) |
387 | 212 | 212 | ||
388 | 213 | self.city_entry.connect('changed', queue_entry_changed) | 213 | self.city_entry.connect('changed', queue_entry_changed) |
389 | 214 | completion = Gtk.EntryCompletion() | 214 | completion = Gtk.EntryCompletion() |
390 | 215 | 215 | ||
391 | === modified file 'ubiquity/plugins/ubi-usersetup.py' | |||
392 | --- ubiquity/plugins/ubi-usersetup.py 2012-11-22 16:27:21 +0000 | |||
393 | +++ ubiquity/plugins/ubi-usersetup.py 2012-11-27 06:10:25 +0000 | |||
394 | @@ -405,17 +405,17 @@ | |||
395 | 405 | 405 | ||
396 | 406 | if not 'UBIQUITY_AUTOMATIC' in os.environ: | 406 | if not 'UBIQUITY_AUTOMATIC' in os.environ: |
397 | 407 | # Let's not call this every time the user presses a key. | 407 | # Let's not call this every time the user presses a key. |
399 | 408 | from gi.repository import GObject | 408 | from gi.repository import GLib |
400 | 409 | if self.hostname_timeout_id: | 409 | if self.hostname_timeout_id: |
403 | 410 | GObject.source_remove(self.hostname_timeout_id) | 410 | GLib.source_remove(self.hostname_timeout_id) |
404 | 411 | self.hostname_timeout_id = GObject.timeout_add( | 411 | self.hostname_timeout_id = GLib.timeout_add( |
405 | 412 | 300, self.hostname_timeout, widget) | 412 | 300, self.hostname_timeout, widget) |
406 | 413 | 413 | ||
407 | 414 | def lookup_result(self, resolver, result, unused): | 414 | def lookup_result(self, resolver, result, unused): |
409 | 415 | from gi.repository import GObject | 415 | from gi.repository import GLib |
410 | 416 | try: | 416 | try: |
411 | 417 | resolver.lookup_by_name_finish(result) | 417 | resolver.lookup_by_name_finish(result) |
413 | 418 | except GObject.GError: | 418 | except GLib.GError: |
414 | 419 | pass | 419 | pass |
415 | 420 | else: | 420 | else: |
416 | 421 | # FIXME: i18n | 421 | # FIXME: i18n |
417 | @@ -437,10 +437,10 @@ | |||
418 | 437 | hostname, None, self.bogus_lookup_result, None) | 437 | hostname, None, self.bogus_lookup_result, None) |
419 | 438 | 438 | ||
420 | 439 | def bogus_lookup_result(self, resolver, result, unused): | 439 | def bogus_lookup_result(self, resolver, result, unused): |
422 | 440 | from gi.repository import GObject | 440 | from gi.repository import GLib |
423 | 441 | try: | 441 | try: |
424 | 442 | resolver.lookup_by_name_finish(result) | 442 | resolver.lookup_by_name_finish(result) |
426 | 443 | except GObject.GError: | 443 | except GLib.GError: |
427 | 444 | self.resolver_ok = True | 444 | self.resolver_ok = True |
428 | 445 | else: | 445 | else: |
429 | 446 | self.resolver_ok = False | 446 | self.resolver_ok = False |
Fixed the two test suite failures that I have introduced in 5771, sorry for hassle.
I had to fix the pep8 & pyflakes warnings from your merge proposal. Next time, please run ./test/run-pep8 & ./test/run-pyflakes as well. (they are run as part part of clean target, as well as the shell syntax checks).
Merged.