diff --git a/fck/file.py b/fck/file.py index 6e39160..4a2a47e 100644 --- a/fck/file.py +++ b/fck/file.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import Optional, Self from os import path from . import cktype @@ -7,6 +7,7 @@ class FILE: """ Colored checkmark representation. """ + CHECKMARK = { True: "\033[92m✓\033[0m", False: "\033[91m❌\033[0m", @@ -19,9 +20,15 @@ class FILE: # TODO: Move out expected sum calculation self.csum, self.esum = cktype.resolve(self.fname, esum, cstype) - def __repr__(self): + def __repr__(self) -> str: return self.fname + def __gt__(self, other: Self) -> bool: + return self.__repr__() > other.__repr__() + + def mkFileStr(self) -> str: + return f"{self.csum}\t{self.fname}\n" + def verify(self) -> Optional[bool]: if self.esum is None: return None