Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import gi # pylint: disable=import-error
- gi.require_version('NM', '1.0') # NOQA: F402
- from gi.repository import Gio, GLib, NM # pylint: disable=import-error
- nmclient = NM.Client.new()
- cp_flag = ( NM.CheckpointCreateFlags.DESTROY_ALL |
- NM.CheckpointCreateFlags.DELETE_NEW_CONNECTIONS |
- NM.CheckpointCreateFlags.DISCONNECT_NEW_DEVICES)
- cp = None
- main_loop = GLib.MainLoop()
- def create_cb(client, result, data):
- try:
- data = nmclient.checkpoint_create_finish(result)
- print("%s" % data.get_path())
- except Exception as e:
- sys.stderr.write("Failed: %s\n" % e.message)
- main_loop.quit()
- nmclient.checkpoint_create([], 0, cp_flag, None, create_cb, cp)
- nmclient.checkpoint_create([], 0, cp_flag, None, create_cb, cp)
- main_loop.run()
- main_loop.quit()
- nmclient.checkpoint_create([], 0, cp_flag, None, create_cb, cp)
- main_loop.run()
- main_loop.quit()
- print("HAHA")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement