From 675e579d1aa9491da9f54291c071024de6150658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Srokosz?= Date: Wed, 26 Jul 2023 18:04:36 +0200 Subject: [PATCH] Lint --- malduck/extractor/config_builder.py | 1 + malduck/extractor/extractor.py | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/malduck/extractor/config_builder.py b/malduck/extractor/config_builder.py index 3655b51..3665ebf 100644 --- a/malduck/extractor/config_builder.py +++ b/malduck/extractor/config_builder.py @@ -12,6 +12,7 @@ class ConfigBuilder: .. versionadded:: 4.4.0 """ + def __init__(self, parent: Extractor) -> None: self.parent = parent diff --git a/malduck/extractor/extractor.py b/malduck/extractor/extractor.py index 5cf23db..27615bd 100644 --- a/malduck/extractor/extractor.py +++ b/malduck/extractor/extractor.py @@ -3,9 +3,10 @@ import logging from typing import List, cast +from maco.model import ExtractorModel + from ..procmem import ProcessMemory, ProcessMemoryELF, ProcessMemoryPE from .config_builder import ConfigBuilder -from maco.model import ExtractorModel log = logging.getLogger(__name__) @@ -40,7 +41,14 @@ def __call__(self, extractor, procmem, *args, **kwargs): # If method returns ExtractorModel - push it as non-jsonable if isinstance(config, ExtractorModel): extractor.push_config( - config.dict(exclude_defaults=True, exclude={"family",} if self.weak else set()), + config.dict( + exclude_defaults=True, + exclude={ + "family", + } + if self.weak + else set(), + ), jsonable=False, ) return @@ -353,7 +361,7 @@ def push_procmem(self, procmem: ProcessMemory, **info): """ return self.parent.push_procmem(procmem, **info) - def push_config(self, config, jsonable = True): + def push_config(self, config, jsonable=True): """ Push partial config (used by :py:meth:`Extractor.handle_match`)