diff options
author | Simon Schampijer <simon@laptop.org> | 2012-09-03 08:17:48 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@laptop.org> | 2012-09-07 09:14:24 (GMT) |
commit | 3007f43996b5ef9a9fb4ccf37906f17612438c68 (patch) | |
tree | c91708f35f18baef6ef60779165bb14a85f0c09e /bin/sugar-session | |
parent | 98f5b640ad4c3f1d67622a031629af42f0b96997 (diff) |
Run pygi-convert.sh for automatic conversion from GTK+ 2 to GTK+ 3
Run pygi-convert.sh for automatic conversion from GTK+ 2 to GTK+ 3 and
pygobject+gobject-introspection. This is only on a best-effort basis;
the code will be in a broken state after this patch and need to be
fixed manually.
The purpose of committing the intermediate, non-working output is to make it
reproducible. It's impractical to manually review the changes.
The exact version used was 2d8f48f4ff56bb75985136452b50b75895258608 from the
main pygobject repository [1].
[1] git://git.gnome.org/pygobject
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Manuel QuiƱones <manuq@laptop.org>
Diffstat (limited to 'bin/sugar-session')
-rwxr-xr-x | bin/sugar-session | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/bin/sugar-session b/bin/sugar-session index e9c8d50..4c16073 100755 --- a/bin/sugar-session +++ b/bin/sugar-session @@ -29,18 +29,18 @@ if os.environ.get('SUGAR_LOGGER_LEVEL', '') == 'debug': import gettext import logging -import gconf -import gtk -import gobject +from gi.repository import GConf +from gi.repository import Gtk +from gi.repository import GObject import dbus.glib -import wnck +from gi.repository import Wnck try: import xklavier except ImportError: logging.debug('Could not load xklavier for keyboard configuration') -gtk.gdk.threads_init() +Gdk.threads_init() dbus.glib.threads_init() def cleanup_logs(logs_dir): @@ -126,11 +126,11 @@ def setup_file_transfer_cb(): def setup_keyboard_cb(): logging.debug('STARTUP: setup_keyboard_cb') - gconf_client = gconf.client_get_default() + gconf_client = GConf.Client.get_default() have_config = False try: - display = gtk.gdk.display_get_default() + display = Gdk.Display.get_default() if display is not None: engine = xklavier.Engine(display) else: @@ -141,7 +141,7 @@ def setup_keyboard_cb(): configrec.get_from_server(engine) layouts = gconf_client.get_list(\ - '/desktop/sugar/peripherals/keyboard/layouts', gconf.VALUE_STRING) + '/desktop/sugar/peripherals/keyboard/layouts', GConf.ValueType.STRING) layouts_list = [] variants_list = [] for layout in layouts: @@ -160,7 +160,7 @@ def setup_keyboard_cb(): configrec.set_model(model) options = gconf_client.get_list(\ - '/desktop/sugar/peripherals/keyboard/options', gconf.VALUE_STRING) + '/desktop/sugar/peripherals/keyboard/options', GConf.ValueType.STRING) if options: have_config = True configrec.set_options(options) @@ -191,21 +191,21 @@ def bootstrap(): from jarabe.view import launcher launcher.setup() - gobject.idle_add(setup_frame_cb) - gobject.idle_add(setup_keyhandler_cb) - gobject.idle_add(setup_journal_cb) - gobject.idle_add(setup_notification_service_cb) - gobject.idle_add(setup_file_transfer_cb) - gobject.idle_add(show_software_updates_cb) + GObject.idle_add(setup_frame_cb) + GObject.idle_add(setup_keyhandler_cb) + GObject.idle_add(setup_journal_cb) + GObject.idle_add(setup_notification_service_cb) + GObject.idle_add(setup_file_transfer_cb) + GObject.idle_add(show_software_updates_cb) if sys.modules.has_key('xklavier'): - gobject.idle_add(setup_keyboard_cb) + GObject.idle_add(setup_keyboard_cb) def set_fonts(): - client = gconf.client_get_default() + client = GConf.Client.get_default() face = client.get_string('/desktop/sugar/font/default_face') size = client.get_float('/desktop/sugar/font/default_size') - settings = gtk.settings_get_default() + settings = Gtk.Settings.get_default() settings.set_property("gtk-font-name", "%s %f" % (face, size)) def main(): @@ -235,7 +235,7 @@ def main(): logger.start('shell') - client = gconf.client_get_default() + client = GConf.Client.get_default() client.set_string('/apps/metacity/general/mouse_button_modifier', '<Super>') @@ -247,7 +247,7 @@ def main(): # this must be added early, so that it executes and unfreezes the screen # even when we initially get blocked on the intro screen - gobject.idle_add(unfreeze_dcon_cb) + GObject.idle_add(unfreeze_dcon_cb) # make sure we have the correct cursor in the intro screen # TODO #3204 @@ -263,18 +263,18 @@ def main(): sys.path.append(config.ext_path) icons_path = os.path.join(config.data_path, 'icons') - gtk.icon_theme_get_default().append_search_path(icons_path) + Gtk.IconTheme.get_default().append_search_path(icons_path) # open homewindow before window_manager to let desktop appear fast home_window = homewindow.get_instance() home_window.show() - screen = wnck.screen_get_default() + screen = Wnck.Screen.get_default() screen.connect('window-manager-changed', __window_manager_changed_cb) _check_for_window_manager(screen) try: - gtk.main() + Gtk.main() except KeyboardInterrupt: print 'Ctrl+C pressed, exiting...' |