summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-02-06 14:24:11 +0100
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2024-02-19 14:15:07 +0100
commit2337dcde60a710d2f65d3fe1107811202e34c633 (patch)
treee6de59ea2691b134e53d0c99b66f74d1e20f957b
parent900b5acf1445eab22fc2833828abd5649eb9f12a (diff)
Python: Add a helper for server type __str__ representation
-rw-r--r--wrappers/python/eduvpn_common/main.py8
1 files changed, 8 insertions, 0 deletions
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"""