diff --git a/src/apple2disk/anomaly.py b/src/apple2disk/anomaly.py new file mode 100644 index 0000000..2a72c51 --- /dev/null +++ b/src/apple2disk/anomaly.py @@ -0,0 +1,29 @@ +import sys + +class AnomalyLevel(object): + def __init__(self, level): + self.level = level + + def __str__(self): + return level + +module = sys.modules[__name__] +for level in ['INFO', 'UNUSUAL', 'CORRUPTION']: + setattr(module, level, AnomalyLevel(level)) + + +class Anomaly(object): + def __init__(self, container, level, details): + """Record of an anomaly found during disk processing. + + Args: + container: object that contains the anomaly + level: AnomalyLevel + details: string description of anomaly (str) + """ + self.container = container + self.level = level + self.details = details + + def __str__(self): + return '%s anomaly in %s: %s' % (self.level, self.container, self.details) \ No newline at end of file