moved metadata extraction to the parsers

This commit is contained in:
jonaswinkler
2020-12-10 14:57:53 +01:00
parent 0cc22017de
commit 2f7bb01f34
3 changed files with 40 additions and 28 deletions

View File

@@ -210,6 +210,7 @@ class DocumentParser(LoggingMixin):
def __init__(self, logging_group):
super().__init__()
self.logging_group = logging_group
os.makedirs(settings.SCRATCH_DIR, exist_ok=True)
self.tempdir = tempfile.mkdtemp(
prefix="paperless-", dir=settings.SCRATCH_DIR)
@@ -217,6 +218,9 @@ class DocumentParser(LoggingMixin):
self.text = None
self.date = None
def extract_metadata(self, document_path, mime_type):
return []
def parse(self, document_path, mime_type):
raise NotImplementedError()