Skip to content

Commit

Permalink
models:file - reorder methods
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoCampinoti94 committed Oct 31, 2023
1 parent 2b69a02 commit 103cd95
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions acacore/models/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -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:
"""
Expand Down

0 comments on commit 103cd95

Please sign in to comment.