diff options
| author | Philipp Hahn <hahn@univention.de> | 2018-09-21 15:35:16 +0200 |
|---|---|---|
| committer | Michal Privoznik <mprivozn@redhat.com> | 2018-09-24 09:06:00 +0200 |
| commit | 10ba71a0a0cfe3d9d7d5b04fcb31abe40efb413b (patch) | |
| tree | be064fcf4c108db42ad6e0ef7ce1c5a4f5d5e963 /examples | |
| parent | bf7c6135e8bb2ffed9f22b09a50db5f842602813 (diff) | |
| download | libvirt-python-10ba71a0a0cfe3d9d7d5b04fcb31abe40efb413b.tar.gz | |
event-test.py: Convert CONNECTION events
to use new Description class
Signed-off-by: Philipp Hahn <hahn@univention.de>
Diffstat (limited to 'examples')
| -rwxr-xr-x | examples/event-test.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/event-test.py b/examples/event-test.py index 5e3b884..1e94838 100755 --- a/examples/event-test.py +++ b/examples/event-test.py @@ -677,15 +677,16 @@ def mySecretEventValueChanged(conn, secret, opaque): ########################################################################## run = True +CONNECTION_EVENTS = Description("Error", "End-of-file", "Keepalive", "Client") + def myConnectionCloseCallback(conn, reason, opaque): - reasonStrings = ( - "Error", "End-of-file", "Keepalive", "Client", - ) - print("myConnectionCloseCallback: %s: %s" % (conn.getURI(), reasonStrings[reason])) + print("myConnectionCloseCallback: %s: %s" % ( + conn.getURI(), CONNECTION_EVENTS[reason])) global run run = False + def usage(): print("usage: %s [-hdl] [uri]" % (os.path.basename(__file__),)) print(" uri will default to qemu:///system") |
