summaryrefslogtreecommitdiff
path: root/wrappers/python/eduvpn_common
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2023-10-25 14:14:17 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2023-10-25 16:34:13 +0200
commit67161ca7b0cbcd2a37a51c7fd8fcfdbe0c577293 (patch)
treebaeccb61d27e923d3db29bd870faa728bb25bf1f /wrappers/python/eduvpn_common
parent7a4a4b9a648fb072d9641abac893731770d7f028 (diff)
Format: Run Black
Diffstat (limited to 'wrappers/python/eduvpn_common')
-rw-r--r--wrappers/python/eduvpn_common/event.py1
-rw-r--r--wrappers/python/eduvpn_common/main.py4
-rw-r--r--wrappers/python/eduvpn_common/server.py12
3 files changed, 10 insertions, 7 deletions
diff --git a/wrappers/python/eduvpn_common/event.py b/wrappers/python/eduvpn_common/event.py
index 746a0c9..d18dd40 100644
--- a/wrappers/python/eduvpn_common/event.py
+++ b/wrappers/python/eduvpn_common/event.py
@@ -13,6 +13,7 @@ from eduvpn_common.types import get_ptr_string
# The attribute that callback functions get
EDUVPN_CALLBACK_PROPERTY = "_eduvpn_property_callback"
+
# A state transition decorator for classes
# To use this, make sure to register the class with `register_class_callbacks`
def class_state_transition(state: int, state_type: StateType) -> Callable:
diff --git a/wrappers/python/eduvpn_common/main.py b/wrappers/python/eduvpn_common/main.py
index 74ff52d..0bf4d07 100644
--- a/wrappers/python/eduvpn_common/main.py
+++ b/wrappers/python/eduvpn_common/main.py
@@ -610,9 +610,7 @@ def token_callback(name: bytes, srv, tok):
obj = eduvpn_objects[name_decoded]
srv_conv = get_transition_server(obj.lib, srv)
tok_conv = get_tokens(obj.lib, tok)
- obj.token_callback(
- srv_conv, tok_conv
- )
+ obj.token_callback(srv_conv, tok_conv)
@VPNStateChange
diff --git a/wrappers/python/eduvpn_common/server.py b/wrappers/python/eduvpn_common/server.py
index 1ed0752..6760b40 100644
--- a/wrappers/python/eduvpn_common/server.py
+++ b/wrappers/python/eduvpn_common/server.py
@@ -21,7 +21,13 @@ class Profile:
:param: search_domains: List[str]: The list of DNS search domains
"""
- def __init__(self, identifier: str, display_name: str, default_gateway: bool, dns_search_domains: List[str]):
+ def __init__(
+ self,
+ identifier: str,
+ display_name: str,
+ default_gateway: bool,
+ dns_search_domains: List[str],
+ ):
self.identifier = identifier
self.display_name = display_name
self.default_gateway = default_gateway
@@ -405,9 +411,7 @@ def get_tokens(lib: CDLL, ptr: c_void_p) -> Optional[Token]:
refresh = toks.refresh.decode("utf-8")
expired = toks.expired
lib.FreeTokens(ptr)
- return Token(
- access, refresh, expired
- )
+ return Token(access, refresh, expired)
return None