summaryrefslogtreecommitdiff
path: root/wrappers/python/main.py
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-04-05 11:51:08 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-04-05 11:51:08 +0200
commit50b9cb73742e96c2d286bfffd1365c699117858b (patch)
tree00153abfcdccb96a1009635ee3cac72033a35dab /wrappers/python/main.py
parentff184361a9af7b8fa525c765f241830004e29347 (diff)
Python: Update state callbacks to be in line with FSM
Diffstat (limited to 'wrappers/python/main.py')
-rw-r--r--wrappers/python/main.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/wrappers/python/main.py b/wrappers/python/main.py
index 6bd7d86..c2f13ca 100644
--- a/wrappers/python/main.py
+++ b/wrappers/python/main.py
@@ -5,23 +5,22 @@ import webbrowser
_eduvpn = eduvpn.EduVPN("org.eduvpn.app.linux", "configs")
-@_eduvpn.event.on("OAuthInitialized", eduvpn.StateType.Enter)
+@_eduvpn.event.on("SERVER_OAUTH_STARTED", eduvpn.StateType.Enter)
def oauth_initialized(url):
print(f"Got OAUTH url {url}")
webbrowser.open(url)
-@_eduvpn.event.on("OAuthFinished", eduvpn.StateType.Enter)
-def oauth_finished(data):
- print(f"Oauth finished {data}")
+success = _eduvpn.register(debug=True)
+if not success:
+ print("failed to register")
-_eduvpn.register()
print(_eduvpn.get_disco())
config, error = _eduvpn.connect("https://eduvpn.jwijenbergh.com")
-#
-if error != "":
+
+if error:
print("Got connect error", error)
print(config)