diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-04-20 14:28:08 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-04-20 14:28:08 +0200 |
| commit | 1c54936626a4a30d0c6f69576a06ba3661f39dc6 (patch) | |
| tree | 426c76b4c55cf9a9efbc7bd1aa957baec57b2892 /wrappers/python | |
| parent | 77c9f266553cbadfd5fb150a26c2162b705f151e (diff) | |
Profiles: Implement SetProfileID instead of getting generic data
Diffstat (limited to 'wrappers/python')
| -rw-r--r-- | wrappers/python/eduvpncommon/__init__.py | 2 | ||||
| -rw-r--r-- | wrappers/python/eduvpncommon/main.py | 8 | ||||
| -rw-r--r-- | wrappers/python/main.py | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/wrappers/python/eduvpncommon/__init__.py b/wrappers/python/eduvpncommon/__init__.py index 50af8eb..d7fce2f 100644 --- a/wrappers/python/eduvpncommon/__init__.py +++ b/wrappers/python/eduvpncommon/__init__.py @@ -38,7 +38,7 @@ lib.Deregister.argtypes, lib.Deregister.restype = [], None lib.Register.argtypes, lib.Register.restype = [c_char_p, c_char_p, VPNStateChange, c_int], c_void_p lib.GetOrganizationsList.argtypes, lib.GetOrganizationsList.restype = [], DataError lib.GetServersList.argtypes, lib.GetServersList.restype = [], DataError -lib.SendData.argtypes, lib.SendData.restype = [c_char_p], None +lib.SetProfileID.argtypes, lib.SetProfileID.restype = [c_char_p], None # We have to use c_void_p instead of c_char_p to free it properly # See https://stackoverflow.com/questions/13445568/python-ctypes-how-to-free-memory-getting-invalid-pointer-error lib.FreeString.argtypes, lib.FreeString.restype = [c_void_p], None diff --git a/wrappers/python/eduvpncommon/main.py b/wrappers/python/eduvpncommon/main.py index 8d2de9c..694fc59 100644 --- a/wrappers/python/eduvpncommon/main.py +++ b/wrappers/python/eduvpncommon/main.py @@ -47,8 +47,8 @@ def register_callback(eduvpn): ) -def SendData(data): - lib.SendData(data.encode("utf-8")) +def SetProfileID(profile_id): + lib.SetProfileID(profile_id.encode("utf-8")) class EduVPN(object): @@ -79,8 +79,8 @@ class EduVPN(object): def callback(self, old_state, new_state, data): self.event.run(old_state, new_state, data) - def send_data(self, data): - return SendData(data) + def set_profile(self, profile_id): + return SetProfileID(profile_id) class EventHandler(object): diff --git a/wrappers/python/main.py b/wrappers/python/main.py index bc29239..be9ab6c 100644 --- a/wrappers/python/main.py +++ b/wrappers/python/main.py @@ -14,7 +14,7 @@ def oauth_initialized(url): @_eduvpn.event.on("Ask_Profile", eduvpn.StateType.Enter) def ask_profile(profiles): print("ASK PROFILE CB", profiles) - _eduvpn.send_data("prefer-openvpn") + _eduvpn.set_profile("prefer-openvpn") success = _eduvpn.register(debug=True) |
