diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-08-10 11:55:43 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-08-10 11:55:43 +0200 |
| commit | 557cb4aa3ecb48800957c0f9f68571a11746d9fb (patch) | |
| tree | 05f6b51dca42a2b1876adfc7a908c8a06aa2de58 /wrappers/python | |
| parent | 93a95d4be4d754a901ab42a8174ae0e725680a01 (diff) | |
State + Python: Implement renewing a session
Diffstat (limited to 'wrappers/python')
| -rw-r--r-- | wrappers/python/src/__init__.py | 1 | ||||
| -rw-r--r-- | wrappers/python/src/main.py | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/wrappers/python/src/__init__.py b/wrappers/python/src/__init__.py index 2c933ca..be06525 100644 --- a/wrappers/python/src/__init__.py +++ b/wrappers/python/src/__init__.py @@ -87,6 +87,7 @@ lib.SetConnecting.argtypes, lib.SetConnecting.restype = [c_char_p], c_void_p lib.SetDisconnected.argtypes, lib.SetDisconnected.restype = [c_char_p], c_void_p lib.SetSearchServer.argtypes, lib.SetSearchServer.restype = [c_char_p], c_void_p lib.ShouldRenewButton.argtypes, lib.ShouldRenewButton.restype = [], int +lib.RenewSession.argtypes, lib.RenewSession.restype = [c_char_p], c_void_p lib.FreeString.argtypes, lib.FreeString.restype = [c_void_p], None diff --git a/wrappers/python/src/main.py b/wrappers/python/src/main.py index a2a0d14..ac44073 100644 --- a/wrappers/python/src/main.py +++ b/wrappers/python/src/main.py @@ -207,5 +207,11 @@ class EduVPN(object): if location_err: raise Exception(location_err) + def renew_session(self) -> None: + renew_err = self.go_function(lib.RenewSession) + + if renew_err: + raise Exception(renew_err) + def should_renew_button(self) -> bool: return self.go_function(lib.ShouldRenewButton) |
