summaryrefslogtreecommitdiff
path: root/wrappers/python/eduvpn_common
diff options
context:
space:
mode:
Diffstat (limited to 'wrappers/python/eduvpn_common')
-rw-r--r--wrappers/python/eduvpn_common/loader.py2
-rw-r--r--wrappers/python/eduvpn_common/main.py13
-rw-r--r--wrappers/python/eduvpn_common/types.py1
3 files changed, 14 insertions, 2 deletions
diff --git a/wrappers/python/eduvpn_common/loader.py b/wrappers/python/eduvpn_common/loader.py
index b74741f..4bfc55f 100644
--- a/wrappers/python/eduvpn_common/loader.py
+++ b/wrappers/python/eduvpn_common/loader.py
@@ -8,6 +8,7 @@ from eduvpn_common.types import (
ProxyReady,
ProxySetup,
ReadRxBytes,
+ RefreshList,
TokenGetter,
TokenSetter,
VPNStateChange,
@@ -90,6 +91,7 @@ def initialize_functions(lib: CDLL) -> None:
c_void_p,
)
lib.RenewSession.argtypes, lib.RenewSession.restype = [c_int], c_void_p
+ lib.DiscoveryStartup.argtypes, lib.DiscoveryStartup.restype = [RefreshList], c_void_p
lib.SetTokenHandler.argtypes, lib.SetTokenHandler.restype = (
[
TokenGetter,
diff --git a/wrappers/python/eduvpn_common/main.py b/wrappers/python/eduvpn_common/main.py
index cb81e53..8c556e9 100644
--- a/wrappers/python/eduvpn_common/main.py
+++ b/wrappers/python/eduvpn_common/main.py
@@ -10,6 +10,7 @@ from eduvpn_common.types import (
ProxyReady,
ProxySetup,
ReadRxBytes,
+ RefreshList,
TokenGetter,
TokenSetter,
VPNStateChange,
@@ -180,12 +181,14 @@ class EduVPN(object):
def get_disco_organizations(self, search="") -> str:
orgs, _ = self.go_cookie_function(self.lib.DiscoOrganizations, search)
- # TODO: Log error
+ # We don't log anything here as we want to return a result and we don't want to throw here
+ # we already log for errors in common
return orgs
def get_disco_servers(self, search="") -> str:
servers, _ = self.go_cookie_function(self.lib.DiscoServers, search)
- # TODO: Log error
+ # We don't log anything here as we want to return a result and we don't want to throw here
+ # we already log for errors in common
return servers
def get_servers(self) -> str:
@@ -298,6 +301,12 @@ class EduVPN(object):
if location_err:
forwardError(location_err)
+ def discovery_startup(self, refresh: RefreshList) -> None:
+ refresh_err = self.go_function(self.lib.DiscoveryStartup, refresh)
+
+ if refresh_err:
+ forwardError(refresh_err)
+
def set_token_handler(self, getter: Callable, setter: Callable) -> None:
self.token_setter = setter
self.token_getter = getter
diff --git a/wrappers/python/eduvpn_common/types.py b/wrappers/python/eduvpn_common/types.py
index 21690fb..716556e 100644
--- a/wrappers/python/eduvpn_common/types.py
+++ b/wrappers/python/eduvpn_common/types.py
@@ -39,6 +39,7 @@ VPNStateChange = CFUNCTYPE(c_int, c_int, c_int, c_char_p)
ProxySetup = CFUNCTYPE(c_void_p, c_int, c_char_p)
ProxyReady = CFUNCTYPE(c_void_p)
ReadRxBytes = CFUNCTYPE(c_ulonglong)
+RefreshList = CFUNCTYPE(c_void_p)
TokenGetter = CFUNCTYPE(c_void_p, c_char_p, c_int, POINTER(c_char), c_size_t)
TokenSetter = CFUNCTYPE(c_void_p, c_char_p, c_int, c_char_p)