From 792fb9e5ad24fea16753fa9b9c25e0f4436e2c10 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Fri, 21 Oct 2022 15:14:38 +0200 Subject: Python: Fix meta docstring format --- wrappers/python/eduvpn_common/discovery.py | 8 +++---- wrappers/python/eduvpn_common/event.py | 14 +++++------ wrappers/python/eduvpn_common/main.py | 8 +++---- wrappers/python/eduvpn_common/server.py | 12 +++++----- wrappers/python/eduvpn_common/types.py | 38 +++++++++++++++--------------- 5 files changed, 40 insertions(+), 40 deletions(-) (limited to 'wrappers') diff --git a/wrappers/python/eduvpn_common/discovery.py b/wrappers/python/eduvpn_common/discovery.py index 63cc7a0..7e31a7f 100644 --- a/wrappers/python/eduvpn_common/discovery.py +++ b/wrappers/python/eduvpn_common/discovery.py @@ -93,7 +93,7 @@ def get_disco_organization(ptr) -> Optional[DiscoOrganization]: :param ptr: The pointer returned by the go library that contains a discovery organization - :meta: private: + :meta private: :return: The Discovery Organization if there is one :rtype: Optional[DiscoOrganization] @@ -115,7 +115,7 @@ def get_disco_server(lib: CDLL, ptr) -> Optional[DiscoServer]: :param lib: CDLL: The Go shared library :param ptr: The pointer to a discovery server returned by the Go library - :meta: private: + :meta private: :return: The Discovery Server if there is one :rtype: Optional[DiscoServer] @@ -156,7 +156,7 @@ def get_disco_servers(lib: CDLL, ptr: c_void_p) -> Optional[DiscoServers]: :param lib: CDLL: The Go shared library :param ptr: c_void_p: The pointer returned by the Go library for the discovery servers - :meta: private: + :meta private: :return: The Discovery Servers if there are any :rtype: Optional[DiscoServers] @@ -184,7 +184,7 @@ def get_disco_organizations(lib: CDLL, ptr: c_void_p) -> Optional[DiscoOrganizat :param lib: CDLL: The Go shared library :param ptr: c_void_p: The pointer returned by the Go library for the discovery organizations - :meta: private: + :meta private: :return: The Discovery Organizations if there are any :rtype: Optional[DiscoOrganizations] diff --git a/wrappers/python/eduvpn_common/event.py b/wrappers/python/eduvpn_common/event.py index 193e659..979c4f2 100644 --- a/wrappers/python/eduvpn_common/event.py +++ b/wrappers/python/eduvpn_common/event.py @@ -21,7 +21,7 @@ def class_state_transition(state: int, state_type: StateType) -> Callable: :param state: int: The state of the transition :param state_type: StateType: The type of transition - :meta: private: + :meta private: """ def wrapper(func): """ @@ -42,7 +42,7 @@ def convert_data(lib: CDLL, state: int, data: Any) -> None: :param state: int: The state to convert the data for :param data: Any: The data itself that has to be converted - :meta: private: + :meta private: """ if not data: return None @@ -75,7 +75,7 @@ class EventHandler(object): :param cls: Any: The class to change the callbacks for :param add: bool: (Default value = True): Whether or not to add or remove the event. If true the event gets added - :meta: private: + :meta private: """ # Loop over method names for method_name in dir(cls): @@ -103,7 +103,7 @@ class EventHandler(object): :param state_type: StateType: The state type to remove the event for :param func: Callable: The function that needs to be removed from the event - :meta: private: + :meta private: """ for key, values in self.handlers.copy().items(): if key == (state, state_type): @@ -120,7 +120,7 @@ class EventHandler(object): :param state_type: StateType: The state type to add the event for :param func: Callable: The function that needs to be added to the event - :meta: private: + :meta private: """ if (state, state_type) not in self.handlers: self.handlers[(state, state_type)] = [] @@ -132,7 +132,7 @@ class EventHandler(object): :param state: int: The state of the event :param state_type: StateType: The state type of the event - :meta: private: + :meta private: """ def wrapped_f(func): """ @@ -155,7 +155,7 @@ class EventHandler(object): :param state_type: StateType: The state type of the event :param data: str: The data that gets passed to the function callback when the event is ran - :meta: private: + :meta private: """ if (state, state_type) not in self.handlers: return diff --git a/wrappers/python/eduvpn_common/main.py b/wrappers/python/eduvpn_common/main.py index 03e5b4c..69d00db 100644 --- a/wrappers/python/eduvpn_common/main.py +++ b/wrappers/python/eduvpn_common/main.py @@ -226,7 +226,7 @@ class EduVPN(object): :param func: Any: The Go function to call :param prefer_tcp: bool: (Default value = False): Whether or not to prefer TCP - :meta: private: + :meta private: :raises WrappedError: An error by the Go library @@ -487,7 +487,7 @@ def state_callback(name: bytes, old_state: int, new_state: int, data: Any) -> No :param new_state: int: The new state :param data: Any: The data that still needs to be converted - :meta: private: + :meta private: """ name_decoded = name.decode() if name_decoded not in eduvpn_objects: @@ -500,7 +500,7 @@ def add_as_global_object(eduvpn: EduVPN) -> bool: :param eduvpn: EduVPN: The class to add - :meta: private: + :meta private: :return: Whether or not the object was added :rtype: bool @@ -517,7 +517,7 @@ def remove_as_global_object(eduvpn: EduVPN) -> None: :param eduvpn: EduVPN: The class to remove - :meta: private: + :meta private: """ global eduvpn_objects eduvpn_objects.pop(eduvpn.name, None) diff --git a/wrappers/python/eduvpn_common/server.py b/wrappers/python/eduvpn_common/server.py index 686114b..fc5711e 100644 --- a/wrappers/python/eduvpn_common/server.py +++ b/wrappers/python/eduvpn_common/server.py @@ -160,7 +160,7 @@ def get_profiles(ptr) -> Optional[Profiles]: :param ptr: The pointer to the Profiles as returned by the Go library - :meta: private: + :meta private: :return: Profiles if there are any :rtype: Optional[Profiles] @@ -192,7 +192,7 @@ def get_server(ptr, _type: Optional[str] = None) -> Optional[Server]: :param ptr: The pointer as returned by the Go library :param _type: (Default value = None): The optional parameter that represents whether or not the type is enforced to the input. If None it is automatically determined - :meta: private: + :meta private: :return: Server if there is any :rtype: Optional[Server] @@ -240,7 +240,7 @@ def get_transition_server(lib: CDLL, ptr: c_void_p) -> Optional[Server]: :param lib: CDLL: The Go shared library :param ptr: c_void_p: The Go's returned C pointer that represents the Server - :meta: private: + :meta private: :return: The server if there is any :rtype: Optional[Server] @@ -256,7 +256,7 @@ def get_transition_profiles(lib: CDLL, ptr: c_void_p) -> Optional[Profiles]: :param lib: CDLL: The Go shared library :param ptr: c_void_p: The Go's returned C pointer that represents the profiles - :meta: private: + :meta private: :return: The profiles if there is any :rtype: Optional[Profiles] @@ -272,7 +272,7 @@ def get_servers(lib: CDLL, ptr: c_void_p) -> Optional[List[Server]]: :param lib: CDLL: The Go shared library :param ptr: c_void_p: The C pointer to the servers structure - :meta: private: + :meta private: :return: The list of Servers if there is any :rtype: Optional[List[Server]] @@ -309,7 +309,7 @@ def get_locations(lib: CDLL, ptr: c_void_p) -> Optional[List[str]]: :param lib: CDLL: The Go shared library :param ptr: c_void_p: The C pointer to the locations structure - :meta: private: + :meta private: :return: The list of servers if there are any :rtype: Optional[List[str]] diff --git a/wrappers/python/eduvpn_common/types.py b/wrappers/python/eduvpn_common/types.py index a58adff..efecd2a 100644 --- a/wrappers/python/eduvpn_common/types.py +++ b/wrappers/python/eduvpn_common/types.py @@ -19,7 +19,7 @@ from eduvpn_common.error import ErrorLevel, WrappedError class cError(Structure): """The C type that represents the Error as returned by the Go library - :meta: private: + :meta private: """ _fields_ = [ ("level", c_int), @@ -31,7 +31,7 @@ class cError(Structure): class cServerLocations(Structure): """The C type that represents the Server Locations as returned by the Go library - :meta: private: + :meta private: """ _fields_ = [("locations", POINTER(c_char_p)), ("total_locations", c_size_t)] @@ -49,7 +49,7 @@ class cDiscoveryOrganization(Structure): class cDiscoveryOrganizations(Structure): """The C type that represents Discovery Organizations as returned by the Go library - :meta: private: + :meta private: """ _fields_ = [ ("version", c_ulonglong), @@ -61,7 +61,7 @@ class cDiscoveryOrganizations(Structure): class cDiscoveryServer(Structure): """The C type that represents a Discovery Server as returned by the Go library - :meta: private: + :meta private: """ _fields_ = [ ("authentication_url_template", c_char_p), @@ -80,7 +80,7 @@ class cDiscoveryServer(Structure): class cDiscoveryServers(Structure): """The C type that represents Discovery Servers as returned by the Go library - :meta: private: + :meta private: """ _fields_ = [ ("version", c_ulonglong), @@ -92,7 +92,7 @@ class cDiscoveryServers(Structure): class cServerProfile(Structure): """The C type that represents a Server Profile as returned by the Go library - :meta: private: + :meta private: """ _fields_ = [ ("identifier", c_char_p), @@ -104,7 +104,7 @@ class cServerProfile(Structure): class cServerProfiles(Structure): """The C type that represents Server Profiles as returned by the Go library - :meta: private: + :meta private: """ _fields_ = [ ("current", c_int), @@ -116,7 +116,7 @@ class cServerProfiles(Structure): class cServer(Structure): """The C type that represents a Server as returned by the Go library - :meta: private: + :meta private: """ _fields_ = [ ("identifier", c_char_p), @@ -133,7 +133,7 @@ class cServer(Structure): class cServers(Structure): """The C type that represents Servers as returned by the Go library - :meta: private: + :meta private: """ _fields_ = [ ("custom_servers", POINTER(POINTER(cServer))), @@ -147,7 +147,7 @@ class cServers(Structure): class DataError(Structure): """The C type that represents a tuple of data and error as returned by the Go library - :meta: private: + :meta private: """ _fields_ = [("data", c_void_p), ("error", c_void_p)] @@ -155,7 +155,7 @@ class DataError(Structure): class ConfigError(Structure): """The C type that represents the data that gets by the Go library returned when a config is obtained - :meta: private: + :meta private: """ _fields_ = [("config", c_void_p), ("config_type", c_void_p), ("error", c_void_p)] @@ -170,7 +170,7 @@ def encode_args(args: List[Any], types: List[Any]) -> Iterator[Any]: :param args: List[Any]: The list of arguments :param types: List[Any]: The list of the types of the arguments - :meta: private: + :meta private: :return: The arg generator :rtype: Iterator[Any] @@ -187,7 +187,7 @@ def decode_res(res: Any) -> Any: :param res: Any: The result - :meta: private: + :meta private: :return: The argument decoded :rtype: Any @@ -208,7 +208,7 @@ def get_ptr_string(lib: CDLL, ptr: c_void_p) -> str: :param lib: CDLL: The Go shared library :param ptr: c_void_p: The pointer to the C string - :meta: private: + :meta private: :return: The string converted to Python :rtype: str @@ -229,7 +229,7 @@ def get_ptr_list_strings(lib: CDLL, strings: pointer, total_strings: int) -> Lis :param strings: pointer: The C pointer to the strings list :param total_strings: int: The total strings in the list - :meta: private: + :meta private: :return: The list of strings converted to Python :rtype: List[str] @@ -248,7 +248,7 @@ def get_error(lib: CDLL, ptr: c_void_p) -> Optional[WrappedError]: :param lib: CDLL: The Go shared library :param ptr: c_void_p: The pointer to the C error struct - :meta: private: + :meta private: :return: The error if there is one :rtype: Optional[WrappedError] @@ -271,7 +271,7 @@ def get_config_error( :param lib: CDLL: The Go shared library :param config_error: ConfigError: The config error structure - :meta: private: + :meta private: :return: The configuration, configuration type ('openvpn'/'wireguard') and an optional error :rtype: Tuple[str, str, Optional[WrappedError]] @@ -291,7 +291,7 @@ def get_data_error( :param data_error: DataError: The data error C structure :param data_conv: Callable: (Default value = get_ptr_string): The function that converts the data part - :meta: private: + :meta private: :return: The data and optional error :rtype: Tuple[Any, Optional[WrappedError]] @@ -307,7 +307,7 @@ def get_bool(lib: CDLL, boolInt: c_int) -> bool: :param lib: CDLL: The Go shared library :param boolInt: c_int: The C integer that needs to be converted to the Python bool - :meta: private: + :meta private: :return: The boolean converted to Python :rtype: bool -- cgit v1.2.3