From 103cd95ff3af0acf98a5432a75e01480515222f4 Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Tue, 31 Oct 2023 13:33:25 +0100 Subject: [PATCH] models:file - reorder methods --- acacore/models/file.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/acacore/models/file.py b/acacore/models/file.py index 865ee8c..483ffb1 100644 --- a/acacore/models/file.py +++ b/acacore/models/file.py @@ -76,10 +76,6 @@ class File(ACABase): action: list[TAction] = Field(default_factory=list) root: Optional[Path] = Field(None, ignore=True) - def get_checksum(self) -> str: - self.checksum = file_checksum(self.get_absolute_path(self.root)) - return self.checksum - def identify(self, sf: Siegfried) -> SiegfriedFile: """Identify the file using `siegfried`. @@ -131,6 +127,10 @@ def identify_custom(self, custom_sigs: list[CustomSignature]) -> Optional[Custom def get_absolute_path(self, root: Optional[Path] = None) -> Path: return root.joinpath(self.relative_path) if root else self.relative_path.resolve() + def get_checksum(self) -> str: + self.checksum = file_checksum(self.get_absolute_path(self.root)) + return self.checksum + @property def name(self) -> str: """