to use new Description class
Signed-off-by: Philipp Hahn <hahn(a)univention.de>
---
examples/event-test.py | 9 +++++----
1 file 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")
--
2.11.0