Commit a20fd994 authored by Jiri Popelka's avatar Jiri Popelka Committed by Jiří Klimeš

examples: use GLib.MainLoop instead of deprecated GObject.MainLoop in python

jklimes:
made the change for new firewall-zone.py example as well.
parent 8a04ab91
......@@ -21,7 +21,7 @@
#
import sys
from gi.repository import GObject, NetworkManager, NMClient
from gi.repository import GLib, NetworkManager, NMClient
#
# This example shows how to get NMIP4Config from NMDevice after it is activated.
......@@ -59,6 +59,6 @@ if __name__ == "__main__":
print "---------------------------------------"
dev.connect('state-changed', state_changed)
main_loop = GObject.MainLoop()
main_loop = GLib.MainLoop()
main_loop.run()
......@@ -20,7 +20,7 @@
#
import sys
from gi.repository import GObject, NetworkManager, NMClient
from gi.repository import GLib, NetworkManager, NMClient
#
# This example demonstrates how to get and change firewall zone in a
......@@ -77,7 +77,7 @@ if __name__ == "__main__":
if len(sys.argv) != 2 and len(sys.argv) != 3:
sys.exit('Usage: %s <connection name or UUID> [new zone]' % sys.argv[0])
main_loop = GObject.MainLoop()
main_loop = GLib.MainLoop()
settings = NMClient.RemoteSettings.new(None);
# Connections are read asynchronously, so we have to wait for the
......
......@@ -18,7 +18,7 @@
# Copyright (C) 2012 Red Hat, Inc.
#
from gi.repository import GObject, NetworkManager, NMClient
from gi.repository import GLib, NetworkManager, NMClient
# This example asks settings service for all configured connections.
# Unfortunately, at this time since libnm-glib still makes heavy use of
......@@ -40,7 +40,7 @@ def connections_read(settings):
main_loop.quit()
if __name__ == "__main__":
main_loop = GObject.MainLoop()
main_loop = GLib.MainLoop()
settings = NMClient.RemoteSettings.new(None);
# connections are read asynchronously, so we need to wait for the
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment