diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-09-26 17:36:30 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-09-27 10:53:37 +0200 |
| commit | 09ec69dfdef409868f1cb39cb8cc4b33c8690c9f (patch) | |
| tree | 109925dbbee4a9120211897582760f96010ae8f2 /wrappers/python/eduvpn_common/server.py | |
| parent | 0a19c2dedcaaa177b420eac99149515d84508204 (diff) | |
Python: Reformat and move most loading out of __init__
Diffstat (limited to 'wrappers/python/eduvpn_common/server.py')
| -rw-r--r-- | wrappers/python/eduvpn_common/server.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/wrappers/python/eduvpn_common/server.py b/wrappers/python/eduvpn_common/server.py index 470f704..36c3643 100644 --- a/wrappers/python/eduvpn_common/server.py +++ b/wrappers/python/eduvpn_common/server.py @@ -1,5 +1,5 @@ -from eduvpn_common import lib, cServer, cServers, cServerLocations, cServerProfiles -from ctypes import cast, POINTER, c_char_p +from eduvpn_common.types import cServer, cServers, cServerLocations, cServerProfiles +from ctypes import cast, POINTER from datetime import datetime @@ -125,19 +125,19 @@ def get_server(ptr, _type=None): return Server(identifier, display_name, profiles, current_server.expire_time) -def get_transition_server(ptr): +def get_transition_server(lib, ptr): server = get_server(cast(ptr, POINTER(cServer))) lib.FreeServer(ptr) return server -def get_transition_profiles(ptr): +def get_transition_profiles(lib, ptr): profiles = get_profiles(cast(ptr, POINTER(cServerProfiles))) lib.FreeProfiles(ptr) return profiles -def get_servers(ptr): +def get_servers(lib, ptr): if ptr: returned = [] servers = cast(ptr, POINTER(cServers)).contents @@ -164,7 +164,7 @@ def get_servers(ptr): return None -def get_locations(ptr): +def get_locations(lib, ptr): if ptr: locations = cast(ptr, POINTER(cServerLocations)).contents location_list = [] |
