A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
code style
jonaswinklerbdc247ce49a7
diff --git a/src/documents/management/commands/document_consumer.py b/src/documents/management/commands/document_consumer.pyindex 9ba1b1a87..232a5b23c 100644--- a/src/documents/management/commands/document_consumer.py+++ b/src/documents/management/commands/document_consumer.py@@ -21,7 +21,7 @@ logger = logging.getLogger(__name__)def _tags_from_path(filepath):- """Walk up the directory tree from filepath to CONSUMPTION_DIr+ """Walk up the directory tree from filepath to CONSUMPTION_DIRand get or create Tag IDs for every directory."""tag_ids = set()diff --git a/src/documents/parsers.py b/src/documents/parsers.pyindex 3f0879b3c..a2eb14cef 100644--- a/src/documents/parsers.py+++ b/src/documents/parsers.py@@ -273,10 +273,9 @@ class DocumentParser(LoggingMixin):self.date = Noneself.progress_callback = progress_callback- def progress(self, current, max):- print(self.progress_callback)+ def progress(self, current_progress, max_progress):if self.progress_callback:- self.progress_callback(current, max)+ self.progress_callback(current_progress, max_progress)def extract_metadata(self, document_path, mime_type):return []diff --git a/src/paperless_tesseract/parsers.py b/src/paperless_tesseract/parsers.pyindex 52b50e983..4e5ceac1b 100644--- a/src/paperless_tesseract/parsers.py+++ b/src/paperless_tesseract/parsers.py@@ -190,11 +190,11 @@ class RasterisedDocumentParser(DocumentParser):# Also, no archived file.if not self.text:# However, if we don't have anything, fail:- raise ParseError(e.__class__.__name__ + ": " + str(e))+ raise ParseError(f"{e.__class__.__name__}: {str(e)}")except Exception as e:# Anything else is probably serious.- raise ParseError(e.__class__.__name__ + ": " + str(e))+ raise ParseError(f"{e.__class__.__name__}: {str(e)}")if not self.text:# This may happen for files that don't have any text.