Skip to content

Commit

Permalink
models.file:File.get_action - set signature from alternative action
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoCampinoti94 committed Oct 1, 2024
1 parent 996a5b5 commit 5ebf8ee
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions acacore/models/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,13 @@ def get_action(
action: Action | None = reduce(lambda acc, cur: acc or actions.get(cur), identifiers, None)

if action and action.alternatives and (new_puid := action.alternatives.get(self.suffixes.lower(), None)):
puid: str = self.puid
puid: str | None = self.puid
self.puid = new_puid
if new_action := self.get_action(actions, file_classes, set_match=set_match):
return new_action
self.puid = puid
if new_action := self.get_action(actions, file_classes):
action = new_action
self.signature = action.name
else:
self.puid = puid

if set_match:
self.action, self.action_data = (
Expand Down

0 comments on commit 5ebf8ee

Please sign in to comment.