diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-06-21 16:54:26 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-06-21 16:54:26 +0200 |
| commit | 1393ab1888e50cf623d22a8135daf42bda333f99 (patch) | |
| tree | 14d6e396fd367c23c1a91d51d76f5431a7684827 /wrappers/python/src | |
| parent | b4d744a80aa79d45f8a46119920abc1279ad4f20 (diff) | |
FSM: Add the search server state
Diffstat (limited to 'wrappers/python/src')
| -rw-r--r-- | wrappers/python/src/__init__.py | 1 | ||||
| -rw-r--r-- | wrappers/python/src/main.py | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/wrappers/python/src/__init__.py b/wrappers/python/src/__init__.py index bc9b3df..d260916 100644 --- a/wrappers/python/src/__init__.py +++ b/wrappers/python/src/__init__.py @@ -63,6 +63,7 @@ lib.SetConnected.argtypes, lib.SetConnected.restype = [c_char_p], c_void_p lib.SetDisconnected.argtypes, lib.SetDisconnected.restype = [c_char_p], c_void_p lib.GetIdentifier.argtypes, lib.GetIdentifier.restype = [c_char_p], DataError lib.SetIdentifier.argtypes, lib.SetIdentifier.restype = [c_char_p, c_char_p], c_void_p +lib.SetSearchServer.argtypes, lib.SetSearchServer.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 687f40f..4117a86 100644 --- a/wrappers/python/src/main.py +++ b/wrappers/python/src/main.py @@ -105,6 +105,13 @@ def SetDisconnected(name: str) -> str: return err_string +def SetSearchServer(name: str) -> str: + name_bytes = name.encode("utf-8") + ptr_err = lib.SetSearchServer(name_bytes) + err_string = GetPtrString(ptr_err) + return err_string + + def SetIdentifier(name: str, identifier: str) -> str: name_bytes = name.encode("utf-8") identifier_bytes = identifier.encode("utf-8") @@ -230,6 +237,12 @@ class EduVPN(object): if identifier_err: raise Exception(identifier_err) + def set_search_server(self) -> None: + search_err = SetSearchServer(self.name) + + if search_err: + raise Exception(search_err) + @property def event(self) -> EventHandler: return self.event_handler |
