Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
psrok1 committed Jul 26, 2023
1 parent 4d59501 commit 675e579
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions malduck/extractor/config_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class ConfigBuilder:
.. versionadded:: 4.4.0
"""

def __init__(self, parent: Extractor) -> None:
self.parent = parent

Expand Down
14 changes: 11 additions & 3 deletions malduck/extractor/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`)
Expand Down

0 comments on commit 675e579

Please sign in to comment.