refactor(analyzer): redefine *_analyzer into steps
- update imports and names - define step as a protocol - extract analyzer function from classes
This commit is contained in:
parent
f6a52c8324
commit
2cae31a97a
14 changed files with 452 additions and 480 deletions
|
@ -1,9 +1,7 @@
|
|||
# TODO: use an abstract base class (ie. import from abc ...) once we have python >=3.3 that supports @staticmethod with @abstractmethod
|
||||
from typing import Any, Dict, Protocol
|
||||
|
||||
|
||||
class Analyzer:
|
||||
"""Abstract base class for all "analyzers"."""
|
||||
|
||||
class Step(Protocol):
|
||||
@staticmethod
|
||||
def analyze(filename, metadata):
|
||||
raise NotImplementedError
|
||||
def __call__(filename: str, metadata: Dict[str, Any]):
|
||||
...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue