Merge lp:~pitti/ubiquity/pygobject-fixes into lp:ubiquity

Proposed by Martin Pitt
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
Reviewer Review Type Date Requested Status
Dimitri John Ledkov Approve
Review via email: mp+136327@code.launchpad.net

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_translated (test_gtkui.TestFrontend)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/martin/ubuntu/ubiquity/tests/test_gtkui.py", line 141, in test_interface_translated
    % missing_translations)
Exception: Missing translation for:
question_label, ubi_question_dialog

======================================================================
FAIL: test_windows_only (test_ubi_partman.TestCalculateAutopartitioningOptions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/martin/ubuntu/ubiquity/tests/test_ubi_partman.py", line 508, in test_windows_only
    self.assertIn('resize', options)
AssertionError: 'resize' not found in {'manual': PartitioningOption(title='Something else', desc='You can create or resize partitions yourself, or choose multiple partitions for Ubuntu.')}

----------------------------------------------------------------------

These happen with the old and new pygobject, and with and without the branch.
They might be a local problem on my checkout/workstation, of course; does that
tell anything to you?

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

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.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/oem-config-remove-gtk'
--- bin/oem-config-remove-gtk 2012-09-06 17:13:01 +0000
+++ bin/oem-config-remove-gtk 2012-11-27 06:10:25 +0000
@@ -26,10 +26,10 @@
26import glob26import glob
2727
28from aptdaemon.gtk3widgets import AptProgressDialog28from aptdaemon.gtk3widgets import AptProgressDialog
29from gi.repository import GObject, Gtk29from gi.repository import GLib, Gtk
30from aptdaemon import client, enums30from aptdaemon import client, enums
3131
32loop = GObject.MainLoop()32loop = GLib.MainLoop()
3333
3434
35def _on_failure(error):35def _on_failure(error):
3636
=== modified file 'bin/ubiquity-bluetooth-agent'
--- bin/ubiquity-bluetooth-agent 2012-07-16 14:29:13 +0000
+++ bin/ubiquity-bluetooth-agent 2012-11-27 06:10:25 +0000
@@ -6,7 +6,7 @@
6import dbus6import dbus
7import dbus.service7import dbus.service
8import dbus.mainloop.glib8import dbus.mainloop.glib
9from gi.repository import GObject9from gi.repository import GLib
1010
1111
12class Rejected(dbus.DBusException):12class Rejected(dbus.DBusException):
@@ -97,10 +97,10 @@
97 bus.get_object("org.bluez", manager.DefaultAdapter()),97 bus.get_object("org.bluez", manager.DefaultAdapter()),
98 "org.bluez.Adapter")98 "org.bluez.Adapter")
99 agent = Agent(bus, "/ubiquity/bluetooth/agent")99 agent = Agent(bus, "/ubiquity/bluetooth/agent")
100 mainloop = GObject.MainLoop()100 mainloop = GLib.MainLoop()
101 adapter.RegisterAgent("/ubiquity/bluetooth/agent", "DisplayYesNo")101 adapter.RegisterAgent("/ubiquity/bluetooth/agent", "DisplayYesNo")
102except dbus.exceptions.DBusException:102except dbus.exceptions.DBusException:
103 exit_handler()103 exit_handler()
104104
105GObject.timeout_add(300000, exit_handler)105GLib.timeout_add(300000, exit_handler)
106mainloop.run()106mainloop.run()
107107
=== modified file 'debian/changelog'
--- debian/changelog 2012-11-26 13:06:06 +0000
+++ debian/changelog 2012-11-27 06:10:25 +0000
@@ -14,6 +14,14 @@
14 * Fonconfig-voodoo is gone, not sure if some other "fontconfig"ury14 * Fonconfig-voodoo is gone, not sure if some other "fontconfig"ury
15 should be called instead. (LP: #1043031)15 should be called instead. (LP: #1043031)
1616
17 [ Martin Pitt ]
18 * ubiquity/gtkwidgets.py: Don't use GObject.constants, just use the
19 constants from GObject as intended. Fixes a crash with pygobject
20 3.7.2.
21 * Use glib API from the GLib GI module instead of GObject. The latter
22 has been deprecated for a long time and triggers warnings with pygobject
23 3.7.2.
24
17 -- Colin Watson <cjwatson@ubuntu.com> Thu, 22 Nov 2012 16:25:28 +000025 -- Colin Watson <cjwatson@ubuntu.com> Thu, 22 Nov 2012 16:25:28 +0000
1826
19ubiquity (2.13.3) raring; urgency=low27ubiquity (2.13.3) raring; urgency=low
2028
=== modified file 'tests/test_timezone.py'
--- tests/test_timezone.py 2012-11-22 16:27:21 +0000
+++ tests/test_timezone.py 2012-11-27 06:10:25 +0000
@@ -25,9 +25,9 @@
25 @mock.patch('gi.repository.Soup.Message')25 @mock.patch('gi.repository.Soup.Message')
26 @mock.patch('json.loads')26 @mock.patch('json.loads')
27 def test_city_entry(self, json_mock, *args):27 def test_city_entry(self, json_mock, *args):
28 from gi.repository import GObject28 from gi.repository import GLib
2929
30 # Patch GObject.timeout_add_seconds to call the supplied function30 # Patch GLib.timeout_add_seconds to call the supplied function
31 # immediately rather than waiting for the interval to expire.31 # immediately rather than waiting for the interval to expire.
32 def side_effect_factory(real_method):32 def side_effect_factory(real_method):
33 def side_effect(interval, function, data):33 def side_effect(interval, function, data):
@@ -35,8 +35,8 @@
35 return side_effect35 return side_effect
3636
37 json_mock.return_value = []37 json_mock.return_value = []
38 real_method = GObject.timeout_add_seconds38 real_method = GLib.timeout_add_seconds
39 method = mock.patch('gi.repository.GObject.timeout_add_seconds')39 method = mock.patch('gi.repository.GLib.timeout_add_seconds')
40 timeout_mock = method.start()40 timeout_mock = method.start()
41 timeout_mock.side_effect = side_effect_factory(real_method)41 timeout_mock.side_effect = side_effect_factory(real_method)
42 self.addCleanup(method.stop)42 self.addCleanup(method.stop)
4343
=== modified file 'ubiquity/frontend/gtk_ui.py'
--- ubiquity/frontend/gtk_ui.py 2012-10-19 01:18:48 +0000
+++ ubiquity/frontend/gtk_ui.py 2012-11-27 06:10:25 +0000
@@ -49,7 +49,7 @@
4949
50#in query mode we won't be in X, but import needs to pass50#in query mode we won't be in X, but import needs to pass
51if 'DISPLAY' in os.environ:51if 'DISPLAY' in os.environ:
52 from gi.repository import Gtk, Gdk, GObject52 from gi.repository import Gtk, Gdk, GObject, GLib
53 GObject.threads_init()53 GObject.threads_init()
54 from ubiquity import gtkwidgets54 from ubiquity import gtkwidgets
5555
@@ -468,13 +468,13 @@
468 sys.exit(1)468 sys.exit(1)
469469
470 def network_change(self, online=False):470 def network_change(self, online=False):
471 from gi.repository import GObject471 from gi.repository import GLib
472 if not online:472 if not online:
473 self.set_online_state(False)473 self.set_online_state(False)
474 return474 return
475 if self.timeout_id:475 if self.timeout_id:
476 GObject.source_remove(self.timeout_id)476 GLib.source_remove(self.timeout_id)
477 self.timeout_id = GObject.timeout_add(300, self.check_returncode)477 self.timeout_id = GLib.timeout_add(300, self.check_returncode)
478478
479 def set_online_state(self, state):479 def set_online_state(self, state):
480 for p in self.pages:480 for p in self.pages:
@@ -751,7 +751,7 @@
751751
752 if self.dbfilter is not None and self.dbfilter != old_dbfilter:752 if self.dbfilter is not None and self.dbfilter != old_dbfilter:
753 self.allow_change_step(False)753 self.allow_change_step(False)
754 GObject.idle_add(754 GLib.idle_add(
755 lambda: self.dbfilter.start(auto_process=True))755 lambda: self.dbfilter.start(auto_process=True))
756756
757 page.controller.dbfilter = self.dbfilter757 page.controller.dbfilter = self.dbfilter
@@ -1448,17 +1448,17 @@
1448 # Callbacks provided to components.1448 # Callbacks provided to components.
14491449
1450 def watch_debconf_fd(self, from_debconf, process_input):1450 def watch_debconf_fd(self, from_debconf, process_input):
1451 GObject.io_add_watch(from_debconf,1451 GLib.io_add_watch(from_debconf,
1452 GObject.IO_IN | GObject.IO_ERR | GObject.IO_HUP,1452 GLib.IO_IN | GLib.IO_ERR | GLib.IO_HUP,
1453 self.watch_debconf_fd_helper, process_input)1453 self.watch_debconf_fd_helper, process_input)
14541454
1455 def watch_debconf_fd_helper(self, source, cb_condition, callback):1455 def watch_debconf_fd_helper(self, source, cb_condition, callback):
1456 debconf_condition = 01456 debconf_condition = 0
1457 if (cb_condition & GObject.IO_IN) != 0:1457 if (cb_condition & GLib.IO_IN) != 0:
1458 debconf_condition |= filteredcommand.DEBCONF_IO_IN1458 debconf_condition |= filteredcommand.DEBCONF_IO_IN
1459 if (cb_condition & GObject.IO_ERR) != 0:1459 if (cb_condition & GLib.IO_ERR) != 0:
1460 debconf_condition |= filteredcommand.DEBCONF_IO_ERR1460 debconf_condition |= filteredcommand.DEBCONF_IO_ERR
1461 if (cb_condition & GObject.IO_HUP) != 0:1461 if (cb_condition & GLib.IO_HUP) != 0:
1462 debconf_condition |= filteredcommand.DEBCONF_IO_HUP1462 debconf_condition |= filteredcommand.DEBCONF_IO_HUP
14631463
1464 return callback(source, debconf_condition)1464 return callback(source, debconf_condition)
@@ -1751,7 +1751,7 @@
17511751
1752 def quit_quit():1752 def quit_quit():
1753 # Wait until we're actually out of this main loop1753 # Wait until we're actually out of this main loop
1754 GObject.idle_add(idle_quit)1754 GLib.idle_add(idle_quit)
1755 return False1755 return False
17561756
1757 if self.pending_quits == 0:1757 if self.pending_quits == 0:
17581758
=== modified file 'ubiquity/frontend/noninteractive.py'
--- ubiquity/frontend/noninteractive.py 2012-09-25 20:59:09 +0000
+++ ubiquity/frontend/noninteractive.py 2012-11-27 06:10:25 +0000
@@ -30,7 +30,7 @@
30import signal30import signal
31import sys31import sys
3232
33from gi.repository import GObject33from gi.repository import GLib
3434
35from ubiquity import filteredcommand, i18n35from ubiquity import filteredcommand, i18n
36from ubiquity import misc36from ubiquity import misc
@@ -53,7 +53,7 @@
53 self.progress_position = ubiquity.progressposition.ProgressPosition()53 self.progress_position = ubiquity.progressposition.ProgressPosition()
54 self.progress_val = 054 self.progress_val = 0
55 self.progress_info = ''55 self.progress_info = ''
56 self.mainloop = GObject.MainLoop()56 self.mainloop = GLib.MainLoop()
5757
58 self.pages = []58 self.pages = []
59 for mod in self.modules:59 for mod in self.modules:
@@ -137,17 +137,17 @@
137 from the filtered command and a process_input callback which should137 from the filtered command and a process_input callback which should
138 be called when input events are received."""138 be called when input events are received."""
139139
140 GObject.io_add_watch(from_debconf,140 GLib.io_add_watch(from_debconf,
141 GObject.IO_IN | GObject.IO_ERR | GObject.IO_HUP,141 GLib.IO_IN | GLib.IO_ERR | GLib.IO_HUP,
142 self.watch_debconf_fd_helper, process_input)142 self.watch_debconf_fd_helper, process_input)
143143
144 def watch_debconf_fd_helper(self, source, cb_condition, callback):144 def watch_debconf_fd_helper(self, source, cb_condition, callback):
145 debconf_condition = 0145 debconf_condition = 0
146 if (cb_condition & GObject.IO_IN) != 0:146 if (cb_condition & GLib.IO_IN) != 0:
147 debconf_condition |= filteredcommand.DEBCONF_IO_IN147 debconf_condition |= filteredcommand.DEBCONF_IO_IN
148 if (cb_condition & GObject.IO_ERR) != 0:148 if (cb_condition & GLib.IO_ERR) != 0:
149 debconf_condition |= filteredcommand.DEBCONF_IO_ERR149 debconf_condition |= filteredcommand.DEBCONF_IO_ERR
150 if (cb_condition & GObject.IO_HUP) != 0:150 if (cb_condition & GLib.IO_HUP) != 0:
151 debconf_condition |= filteredcommand.DEBCONF_IO_HUP151 debconf_condition |= filteredcommand.DEBCONF_IO_HUP
152152
153 return callback(source, debconf_condition)153 return callback(source, debconf_condition)
154154
=== modified file 'ubiquity/gtkwidgets.py'
--- ubiquity/gtkwidgets.py 2012-11-22 16:27:21 +0000
+++ ubiquity/gtkwidgets.py 2012-11-27 06:10:25 +0000
@@ -39,10 +39,10 @@
39 __gproperties__ = {39 __gproperties__ = {
40 'radius': (40 'radius': (
41 GObject.TYPE_INT, 'Radius', 'The radius of the rounded corners.',41 GObject.TYPE_INT, 'Radius', 'The radius of the rounded corners.',
42 0, GObject.constants.G_MAXINT, 10, GObject.PARAM_READWRITE),42 0, GObject.G_MAXINT, 10, GObject.PARAM_READWRITE),
43 'width': (43 'width': (
44 GObject.TYPE_INT, 'Width', 'The width of the outline.',44 GObject.TYPE_INT, 'Width', 'The width of the outline.',
45 0, GObject.constants.G_MAXINT, 1, GObject.PARAM_READWRITE),45 0, GObject.G_MAXINT, 1, GObject.PARAM_READWRITE),
46 }46 }
4747
48 def __init__(self):48 def __init__(self):
@@ -93,15 +93,15 @@
93 'part_size': (93 'part_size': (
94 GObject.TYPE_UINT64, 'Partition size',94 GObject.TYPE_UINT64, 'Partition size',
95 'The size of the partition being resized',95 'The size of the partition being resized',
96 1, GObject.constants.G_MAXUINT64, 100, GObject.PARAM_READWRITE),96 1, GObject.G_MAXUINT64, 100, GObject.PARAM_READWRITE),
97 'min_size': (97 'min_size': (
98 GObject.TYPE_UINT64, 'Minimum size',98 GObject.TYPE_UINT64, 'Minimum size',
99 'The minimum size that the existing partition can be resized to',99 'The minimum size that the existing partition can be resized to',
100 0, GObject.constants.G_MAXUINT64, 0, GObject.PARAM_READWRITE),100 0, GObject.G_MAXUINT64, 0, GObject.PARAM_READWRITE),
101 'max_size': (101 'max_size': (
102 GObject.TYPE_UINT64, 'Maximum size',102 GObject.TYPE_UINT64, 'Maximum size',
103 'The maximum size that the existing partition can be resized to',103 'The maximum size that the existing partition can be resized to',
104 1, GObject.constants.G_MAXUINT64, 100, GObject.PARAM_READWRITE)104 1, GObject.G_MAXUINT64, 100, GObject.PARAM_READWRITE)
105 }105 }
106106
107 def do_get_property(self, prop):107 def do_get_property(self, prop):
108108
=== modified file 'ubiquity/nm.py'
--- ubiquity/nm.py 2012-07-16 14:29:13 +0000
+++ ubiquity/nm.py 2012-11-27 06:10:25 +0000
@@ -4,7 +4,7 @@
4import dbus4import dbus
5from dbus.mainloop.glib import DBusGMainLoop5from dbus.mainloop.glib import DBusGMainLoop
6DBusGMainLoop(set_as_default=True)6DBusGMainLoop(set_as_default=True)
7from gi.repository import Gtk, GObject7from gi.repository import Gtk, GObject, GLib
88
9NM = 'org.freedesktop.NetworkManager'9NM = 'org.freedesktop.NetworkManager'
10NM_DEVICE = 'org.freedesktop.NetworkManager.Device'10NM_DEVICE = 'org.freedesktop.NetworkManager.Device'
@@ -174,8 +174,8 @@
174174
175 def queue_build_cache(self, *args):175 def queue_build_cache(self, *args):
176 if self.timeout_id:176 if self.timeout_id:
177 GObject.source_remove(self.timeout_id)177 GLib.source_remove(self.timeout_id)
178 self.timeout_id = GObject.timeout_add(500, self.build_cache)178 self.timeout_id = GLib.timeout_add(500, self.build_cache)
179179
180 def properties_changed(self, props, path=None):180 def properties_changed(self, props, path=None):
181 if 'Strength' in props:181 if 'Strength' in props:
@@ -275,8 +275,8 @@
275275
276 def queue_rows_changed(*args):276 def queue_rows_changed(*args):
277 if self.rows_changed_id:277 if self.rows_changed_id:
278 GObject.source_remove(self.rows_changed_id)278 GLib.source_remove(self.rows_changed_id)
279 self.rows_changed_id = GObject.idle_add(self.rows_changed)279 self.rows_changed_id = GLib.idle_add(self.rows_changed)
280280
281 model.connect('row-inserted', queue_rows_changed)281 model.connect('row-inserted', queue_rows_changed)
282 model.connect('row-deleted', queue_rows_changed)282 model.connect('row-deleted', queue_rows_changed)
283283
=== modified file 'ubiquity/plugins/ubi-console-setup.py'
--- ubiquity/plugins/ubi-console-setup.py 2012-11-22 16:27:21 +0000
+++ ubiquity/plugins/ubi-console-setup.py 2012-11-27 06:10:25 +0000
@@ -106,10 +106,10 @@
106 def on_keyboard_layout_selected(self, *args):106 def on_keyboard_layout_selected(self, *args):
107 if not 'UBIQUITY_AUTOMATIC' in os.environ:107 if not 'UBIQUITY_AUTOMATIC' in os.environ:
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.
109 from gi.repository import GObject109 from gi.repository import GLib
110 if self.keyboard_layout_timeout_id:110 if self.keyboard_layout_timeout_id:
111 GObject.source_remove(self.keyboard_layout_timeout_id)111 GLib.source_remove(self.keyboard_layout_timeout_id)
112 self.keyboard_layout_timeout_id = GObject.timeout_add(112 self.keyboard_layout_timeout_id = GLib.timeout_add(
113 600, self.keyboard_layout_timeout)113 600, self.keyboard_layout_timeout)
114 else:114 else:
115 self.keyboard_layout_timeout()115 self.keyboard_layout_timeout()
@@ -128,10 +128,10 @@
128 def on_keyboard_variant_selected(self, *args):128 def on_keyboard_variant_selected(self, *args):
129 if not 'UBIQUITY_AUTOMATIC' in os.environ:129 if not 'UBIQUITY_AUTOMATIC' in os.environ:
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.
131 from gi.repository import GObject131 from gi.repository import GLib
132 if self.keyboard_variant_timeout_id:132 if self.keyboard_variant_timeout_id:
133 GObject.source_remove(self.keyboard_variant_timeout_id)133 GLib.source_remove(self.keyboard_variant_timeout_id)
134 self.keyboard_variant_timeout_id = GObject.timeout_add(134 self.keyboard_variant_timeout_id = GLib.timeout_add(
135 600, self.keyboard_variant_timeout)135 600, self.keyboard_variant_timeout)
136 else:136 else:
137 self.keyboard_variant_timeout()137 self.keyboard_variant_timeout()
138138
=== modified file 'ubiquity/plugins/ubi-language.py'
--- ubiquity/plugins/ubi-language.py 2012-10-19 17:03:08 +0000
+++ ubiquity/plugins/ubi-language.py 2012-11-27 06:10:25 +0000
@@ -302,13 +302,13 @@
302 w.show()302 w.show()
303303
304 def plugin_set_online_state(self, state):304 def plugin_set_online_state(self, state):
305 from gi.repository import GObject305 from gi.repository import GLib
306 if self.release_notes_label:306 if self.release_notes_label:
307 if self.timeout_id:307 if self.timeout_id:
308 GObject.source_remove(self.timeout_id)308 GLib.source_remove(self.timeout_id)
309 if state:309 if state:
310 self.release_notes_label.show()310 self.release_notes_label.show()
311 self.timeout_id = GObject.timeout_add(311 self.timeout_id = GLib.timeout_add(
312 300, self.check_returncode)312 300, self.check_returncode)
313 else:313 else:
314 self.release_notes_label.hide()314 self.release_notes_label.hide()
315315
=== modified file 'ubiquity/plugins/ubi-timezone.py'
--- ubiquity/plugins/ubi-timezone.py 2012-10-19 17:03:08 +0000
+++ ubiquity/plugins/ubi-timezone.py 2012-11-27 06:10:25 +0000
@@ -97,7 +97,7 @@
97 self.controller.allow_go_forward(True)97 self.controller.allow_go_forward(True)
9898
99 def changed(self, entry):99 def changed(self, entry):
100 from gi.repository import Gtk, GObject, Soup100 from gi.repository import Gtk, GObject, GLib, Soup
101101
102 text = misc.utf8(self.city_entry.get_text())102 text = misc.utf8(self.city_entry.get_text())
103 if not text:103 if not text:
@@ -119,9 +119,9 @@
119 message.request_headers.append('User-agent', 'Ubiquity/1.0')119 message.request_headers.append('User-agent', 'Ubiquity/1.0')
120 self.geoname_session.abort()120 self.geoname_session.abort()
121 if self.geoname_timeout_id is not None:121 if self.geoname_timeout_id is not None:
122 GObject.source_remove(self.geoname_timeout_id)122 GLib.source_remove(self.geoname_timeout_id)
123 self.geoname_timeout_id = \123 self.geoname_timeout_id = \
124 GObject.timeout_add_seconds(2, self.geoname_timeout,124 GLib.timeout_add_seconds(2, self.geoname_timeout,
125 (text, model))125 (text, model))
126 self.geoname_session.queue_message(message, self.geoname_cb,126 self.geoname_session.queue_message(message, self.geoname_cb,
127 (text, model))127 (text, model))
@@ -157,12 +157,12 @@
157 def geoname_cb(self, session, message, user_data):157 def geoname_cb(self, session, message, user_data):
158 import syslog158 import syslog
159 import json159 import json
160 from gi.repository import GObject, Soup160 from gi.repository import GLib, Soup
161161
162 text, model = user_data162 text, model = user_data
163163
164 if self.geoname_timeout_id is not None:164 if self.geoname_timeout_id is not None:
165 GObject.source_remove(self.geoname_timeout_id)165 GLib.source_remove(self.geoname_timeout_id)
166 self.geoname_timeout_id = None166 self.geoname_timeout_id = None
167 self.geoname_add_tzdb(text, model)167 self.geoname_add_tzdb(text, model)
168168
@@ -192,7 +192,7 @@
192192
193 def setup_page(self):193 def setup_page(self):
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)
195 from gi.repository import Gtk, GObject195 from gi.repository import Gtk, GLib
196 from gi.repository import TimezoneMap196 from gi.repository import TimezoneMap
197 self.tzdb = ubiquity.tz.Database()197 self.tzdb = ubiquity.tz.Database()
198 self.tzmap = TimezoneMap.TimezoneMap()198 self.tzmap = TimezoneMap.TimezoneMap()
@@ -207,8 +207,8 @@
207207
208 def queue_entry_changed(entry):208 def queue_entry_changed(entry):
209 if self.timeout_id:209 if self.timeout_id:
210 GObject.source_remove(self.timeout_id)210 GLib.source_remove(self.timeout_id)
211 self.timeout_id = GObject.timeout_add(300, self.changed, entry)211 self.timeout_id = GLib.timeout_add(300, self.changed, entry)
212212
213 self.city_entry.connect('changed', queue_entry_changed)213 self.city_entry.connect('changed', queue_entry_changed)
214 completion = Gtk.EntryCompletion()214 completion = Gtk.EntryCompletion()
215215
=== modified file 'ubiquity/plugins/ubi-usersetup.py'
--- ubiquity/plugins/ubi-usersetup.py 2012-11-22 16:27:21 +0000
+++ ubiquity/plugins/ubi-usersetup.py 2012-11-27 06:10:25 +0000
@@ -405,17 +405,17 @@
405405
406 if not 'UBIQUITY_AUTOMATIC' in os.environ:406 if not 'UBIQUITY_AUTOMATIC' in os.environ:
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.
408 from gi.repository import GObject408 from gi.repository import GLib
409 if self.hostname_timeout_id:409 if self.hostname_timeout_id:
410 GObject.source_remove(self.hostname_timeout_id)410 GLib.source_remove(self.hostname_timeout_id)
411 self.hostname_timeout_id = GObject.timeout_add(411 self.hostname_timeout_id = GLib.timeout_add(
412 300, self.hostname_timeout, widget)412 300, self.hostname_timeout, widget)
413413
414 def lookup_result(self, resolver, result, unused):414 def lookup_result(self, resolver, result, unused):
415 from gi.repository import GObject415 from gi.repository import GLib
416 try:416 try:
417 resolver.lookup_by_name_finish(result)417 resolver.lookup_by_name_finish(result)
418 except GObject.GError:418 except GLib.GError:
419 pass419 pass
420 else:420 else:
421 # FIXME: i18n421 # FIXME: i18n
@@ -437,10 +437,10 @@
437 hostname, None, self.bogus_lookup_result, None)437 hostname, None, self.bogus_lookup_result, None)
438438
439 def bogus_lookup_result(self, resolver, result, unused):439 def bogus_lookup_result(self, resolver, result, unused):
440 from gi.repository import GObject440 from gi.repository import GLib
441 try:441 try:
442 resolver.lookup_by_name_finish(result)442 resolver.lookup_by_name_finish(result)
443 except GObject.GError:443 except GLib.GError:
444 self.resolver_ok = True444 self.resolver_ok = True
445 else:445 else:
446 self.resolver_ok = False446 self.resolver_ok = False

Subscribers

People subscribed via source and target branches

to status/vote changes: