cds1011-ls2/py/arguments.py
Sandro Zimmermann 2becf5823b restructioring
2025-11-29 17:40:32 +01:00

56 lines
1.4 KiB
Python

from enum import Enum
class Mode(Enum):
V = "v"
A = "a"
C = "c"
class Information(Enum):
DISABLED = False
ENABLED = True
class Graph(Enum):
DISABLED = False
ENABLED = True
class Arguments:
def __init__(self, file_path, mode, information, graph):
self.file_path = file_path
self.mode = mode
self.information = information
self.graph = graph
def get_file_path(self):
return self.file_path
def set_file_path(self, value):
self.file_path = value
def get_mode(self):
return self.mode.value
def set_mode(self, value):
try:
self.mode = Mode(value)
except ValueError:
raise ValueError(f"Invalid mode '{value}'. Allowed values: {[m.value for m in Mode]}")
def get_information(self):
return self.information.value
def set_information(self, value):
try:
self.information = Information(value)
except ValueError:
raise ValueError(f"Invalid information '{value}'. Allowed values: {[m.value for m in Information]}")
def get_graph(self):
return self.graph.value
def set_graph(self, value):
try:
self.graph = Graph(value)
except ValueError:
raise ValueError(f"Invalid graph '{value}'. Allowed values: {[m.value for m in Graph]}")