from enum import Enum class NagObjectType(Enum): Command = "command" ContactGroup = "contactgroup" Contact = "contact" HostDependency = "hostdependency" HostEscalation = "hostescalation" HostGroup = "hostgroup" Host = "host" ServiceDependency = "servicedependency" ServiceEscalation = "serviceescalation" ServiceGroup = "servicegroup" Service = "service" TimePeriod = "timeperiod" Nil = "nil" class NagObject: def __init__(self, config_file: str = str(), directives: list[list[str]] = list(), line_no: int = 0, type: NagObjectType = NagObjectType.Nil): self.m_config_file: str = config_file self.m_directives: list[list[str]] = directives self.m_line_no: int = line_no self.m_type: NagObjectType = type def __str__(self): string = "{}:\n\t{}: {}\n".format(self.m_config_file, self.m_line_no, self.m_type) for dir in self.m_directives: string += "\t\t{}: {}\n".format(dir[0], dir[1]) return string def get_type(self) -> NagObjectType: return self.m_type def get_directives(self) -> list[list[str]]: return self.m_directives