libnm: make the the use of GInitable mandatory
Remove _nm_object_ensure_inited(), etc; objects that implement GInitable are now mandatory-to-init(). Remove constructor() implementations that sometimes return NULL; do all the relevant checking in init() instead. Make nm_client_new() and nm_remote_settings_new() take a GCancellable and a GError**.
This commit is contained in:
@@ -51,7 +51,7 @@ if __name__ == "__main__":
|
||||
sys.exit('Usage: %s <interface>' % sys.argv[0])
|
||||
dev_iface = sys.argv[1]
|
||||
|
||||
c = NM.Client.new()
|
||||
c = NM.Client.new(None)
|
||||
dev = c.get_device_by_iface(dev_iface)
|
||||
if dev is None:
|
||||
sys.exit('Device \'%s\' not found' % dev_iface)
|
||||
|
@@ -24,7 +24,7 @@
|
||||
from gi.repository import GLib, NM
|
||||
|
||||
if __name__ == "__main__":
|
||||
client = NM.Client.new()
|
||||
client = NM.Client.new(None)
|
||||
acons = client.get_active_connections()
|
||||
for ac in acons:
|
||||
print "%s (%s) - %s" % (ac.get_id(), ac.get_uuid(), ac.get_connection_type())
|
||||
|
@@ -124,7 +124,7 @@ if __name__ == "__main__":
|
||||
sys.exit('Usage: %s <interface>' % sys.argv[0])
|
||||
dev_iface = sys.argv[1]
|
||||
|
||||
c = NM.Client.new()
|
||||
c = NM.Client.new(None)
|
||||
dev = c.get_device_by_iface(dev_iface)
|
||||
if dev is None:
|
||||
sys.exit('Device \'%s\' not found' % dev_iface)
|
||||
|
@@ -62,7 +62,7 @@ def print_ap_info(ap):
|
||||
print
|
||||
|
||||
if __name__ == "__main__":
|
||||
nmc = NM.Client.new()
|
||||
nmc = NM.Client.new(None)
|
||||
devs = nmc.get_devices()
|
||||
|
||||
for dev in devs:
|
||||
|
Reference in New Issue
Block a user