2020-10-26 01:28:07 +01:00
|
|
|
from enum import Enum
|
2021-08-06 23:47:50 +02:00
|
|
|
from typing import Optional
|
2020-10-26 01:28:07 +01:00
|
|
|
|
|
|
|
|
2021-08-06 23:47:50 +02:00
|
|
|
class Platform(Enum):
|
2020-10-26 01:28:07 +01:00
|
|
|
"""
|
|
|
|
An Enum to represent online class platforms
|
|
|
|
Name: The name of the platform
|
|
|
|
Rep: A shorter, lowercased & space-less version
|
|
|
|
"""
|
2021-08-08 18:12:16 +02:00
|
|
|
BongoVC = {"name": "Bongo Virtual Classroom", "rep": "bongo"}
|
|
|
|
GatherTown = {"name": "Gather Town", "rep": "gather"}
|
2020-10-26 01:28:07 +01:00
|
|
|
MSTeams = {"name": "MS Teams", "rep": "msteams"}
|
2021-08-08 18:12:16 +02:00
|
|
|
OpenCast = {"name": "OpenCast", "rep": "opencast"}
|
2020-10-26 01:28:07 +01:00
|
|
|
Ufora = {"name": "Ufora", "rep": "ufora"}
|
|
|
|
Zoom = {"name": "Zoom", "rep": "zoom"}
|
2021-08-06 23:47:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
def get_platform(rep: Optional[str]) -> Optional[Platform]:
|
|
|
|
"""
|
|
|
|
Find the platform that corresponds to the given name
|
|
|
|
"""
|
|
|
|
if rep is None:
|
|
|
|
return None
|
|
|
|
|
|
|
|
for platform in Platform:
|
|
|
|
if platform.value["rep"] == rep:
|
|
|
|
return platform
|
|
|
|
|
|
|
|
return None
|