diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-04-05 11:51:08 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-04-05 11:51:08 +0200 |
| commit | 50b9cb73742e96c2d286bfffd1365c699117858b (patch) | |
| tree | 00153abfcdccb96a1009635ee3cac72033a35dab /wrappers/python/main.py | |
| parent | ff184361a9af7b8fa525c765f241830004e29347 (diff) | |
Python: Update state callbacks to be in line with FSM
Diffstat (limited to 'wrappers/python/main.py')
| -rw-r--r-- | wrappers/python/main.py | 13 |
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) |
