From 2337dcde60a710d2f65d3fe1107811202e34c633 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Tue, 6 Feb 2024 14:24:11 +0100 Subject: Python: Add a helper for server type __str__ representation --- wrappers/python/eduvpn_common/main.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'wrappers') diff --git a/wrappers/python/eduvpn_common/main.py b/wrappers/python/eduvpn_common/main.py index 798c9a4..d1b3f48 100644 --- a/wrappers/python/eduvpn_common/main.py +++ b/wrappers/python/eduvpn_common/main.py @@ -38,6 +38,14 @@ class ServerType(IntEnum): SECURE_INTERNET = 2 CUSTOM = 3 + def __str__(self) -> str: + if self == ServerType.INSTITUTE_ACCESS: + return "Institute Access Server" + if self == ServerType.CUSTOM: + return "Custom Server" + if self == ServerType.SECURE_INTERNET: + return "Secure Internet Server" + return "Unknown Server" class Jar(object): """A cookie jar""" -- cgit v1.2.3