A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Fix pycodestyle complaints
Daniel Quinn5342db6adab8
diff --git a/src/documents/models.py b/src/documents/models.pyindex 36466bbac..9a8e6003d 100644--- a/src/documents/models.py+++ b/src/documents/models.py@@ -135,7 +135,7 @@ class MatchingModel(models.Model):Example:' some random words "with quotes " and spaces'==>- ["some", "random", "words", "with\s+quotes", "and", "spaces"]+ ["some", "random", "words", "with+quotes", "and", "spaces"]"""findterms = re.compile(r'"([^"]+)"|(\S+)').findallnormspace = re.compile(r"\s+").subdiff --git a/src/documents/tests/test_matchables.py b/src/documents/tests/test_matchables.pyindex 55d25598a..e592237b6 100644--- a/src/documents/tests/test_matchables.py+++ b/src/documents/tests/test_matchables.py@@ -166,7 +166,7 @@ class TestMatching(TestCase):def test_match_regex(self):self._test_matching(- "alpha\w+gamma",+ r"alpha\w+gamma","MATCH_REGEX",("I have alpha_and_gamma in me",diff --git a/src/paperless_tesseract/parsers.py b/src/paperless_tesseract/parsers.pyindex add65985a..bd1ce8ffb 100644--- a/src/paperless_tesseract/parsers.py+++ b/src/paperless_tesseract/parsers.py@@ -272,8 +272,9 @@ def run_unpaper(args):def strip_excess_whitespace(text):collapsed_spaces = re.sub(r"([^\S\r\n]+)", " ", text)no_leading_whitespace = re.sub(- "([\n\r]+)([^\S\n\r]+)", '\\1', collapsed_spaces)- no_trailing_whitespace = re.sub("([^\S\n\r]+)$", '', no_leading_whitespace)+ r"([\n\r]+)([^\S\n\r]+)", '\\1', collapsed_spaces)+ no_trailing_whitespace = re.sub(+ r"([^\S\n\r]+)$", '', no_leading_whitespace)return no_trailing_whitespacediff --git a/src/paperless_tesseract/signals.py b/src/paperless_tesseract/signals.pyindex 2fa54f5d5..237f15c52 100644--- a/src/paperless_tesseract/signals.py+++ b/src/paperless_tesseract/signals.py@@ -5,7 +5,7 @@ from .parsers import RasterisedDocumentParserclass ConsumerDeclaration:- MATCHING_FILES = re.compile("^.*\.(pdf|jpe?g|gif|png|tiff?|pnm|bmp)$")+ MATCHING_FILES = re.compile(r"^.*\.(pdf|jpe?g|gif|png|tiff?|pnm|bmp)$")@classmethoddef handle(cls, sender, **kwargs):