summaryrefslogtreecommitdiff
path: root/wrappers/python/main.py
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-03-23 10:42:49 +0100
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-03-23 10:42:49 +0100
commited6073f2c2c6600063f2e5062937b7a2a1162eb2 (patch)
treed43109bb55546fc4815824579c4879b51e4c3605 /wrappers/python/main.py
parente9597dc652e8ca99141b0d66bfca3e24f233d430 (diff)
Python: Implement state callbacks using decorators
Diffstat (limited to 'wrappers/python/main.py')
-rw-r--r--wrappers/python/main.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/wrappers/python/main.py b/wrappers/python/main.py
index 5383799..a248b71 100644
--- a/wrappers/python/main.py
+++ b/wrappers/python/main.py
@@ -1,5 +1,12 @@
import eduvpncommon.main as eduvpn
-eduvpn.Register("org.eduvpn.app.linux", "configs", eduvpn.state_change)
-print(eduvpn.GetDiscoServers())
+_eduvpn = eduvpn.EduVPN("org.eduvpn.app.linux", "configs")
+
+
+@_eduvpn.event.on("REGISTERED", eduvpn.StateType.Enter)
+def registered(data):
+ print(f"REGISTERED PYTHON WITH DATA {data}")
+
+
+_eduvpn.register()