mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
19 lines
347 B
Python
19 lines
347 B
Python
import re
|
|
|
|
from .parsers import TextDocumentParser
|
|
|
|
|
|
def text_consumer_declaration(sender, **kwargs):
|
|
return {
|
|
"parser": TextDocumentParser,
|
|
"weight": 10,
|
|
"test": text_consumer_test
|
|
}
|
|
|
|
|
|
MATCHING_FILES = re.compile(r"^.*\.(te?xt|md|csv)$")
|
|
|
|
|
|
def text_consumer_test(doc):
|
|
return MATCHING_FILES.match(doc.lower())
|