mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 02:30:24 +01:00
examples: use GLib.MainLoop instead of deprecated GObject.MainLoop in python
jklimes: made the change for new firewall-zone.py example as well.
This commit is contained in:
parent
8a04ab9135
commit
a20fd994f4
3 changed files with 6 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue