summaryrefslogtreecommitdiff
path: root/wrappers/python
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-07-22 17:16:13 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-07-22 17:16:13 +0200
commit0c6233ab691973859b6d636e6d9fdddd2a6acd5e (patch)
treec11697eb3b00ff1d6a073a5f3c6de3337cf5e463 /wrappers/python
parent80218da58eca9c95870770f88e477891e8fdb50a (diff)
State + Exports: Implement should show renew button boolean
Diffstat (limited to 'wrappers/python')
-rw-r--r--wrappers/python/src/__init__.py4
-rw-r--r--wrappers/python/src/main.py3
2 files changed, 7 insertions, 0 deletions
diff --git a/wrappers/python/src/__init__.py b/wrappers/python/src/__init__.py
index 1e42bb5..2c933ca 100644
--- a/wrappers/python/src/__init__.py
+++ b/wrappers/python/src/__init__.py
@@ -86,6 +86,7 @@ lib.SetConnected.argtypes, lib.SetConnected.restype = [c_char_p], c_void_p
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.FreeString.argtypes, lib.FreeString.restype = [c_void_p], None
@@ -143,8 +144,11 @@ def get_data_error(data_error: DataError) -> Tuple[str, str]:
error = get_error(data_error.error)
return data, error
+def get_bool(boolInt: c_int) -> bool:
+ return boolInt == 1
decode_map = {
+ c_int: get_bool,
c_void_p: get_error,
DataError: get_data_error,
}
diff --git a/wrappers/python/src/main.py b/wrappers/python/src/main.py
index 784e622..a2a0d14 100644
--- a/wrappers/python/src/main.py
+++ b/wrappers/python/src/main.py
@@ -206,3 +206,6 @@ class EduVPN(object):
if location_err:
raise Exception(location_err)
+
+ def should_renew_button(self) -> bool:
+ return self.go_function(lib.ShouldRenewButton)