add pre-consume hook

a script hook can be defined in /etc/paperless.conf as
PAPERLESS_PRE_CONSUME_SCRIPT
This commit is contained in:
Lenz Weber
2016-06-23 21:57:17 +02:00
parent 7b88cea07b
commit c728b1dd21
3 changed files with 17 additions and 3 deletions

View File

@@ -8,11 +8,14 @@ class DocumentsConfig(AppConfig):
def ready(self):
from .signals import document_consumption_finished
from .signals import document_consumption_started
from .signals.handlers import (
set_correspondent, set_tags, run_external_script)
set_correspondent, set_tags, run_post_consume_external_script, run_pre_consume_external_script)
document_consumption_finished.connect(set_tags)
document_consumption_finished.connect(set_correspondent)
document_consumption_finished.connect(run_external_script)
document_consumption_finished.connect(run_post_consume_external_script)
document_consumption_started.connect(run_pre_consume_external_script)
AppConfig.ready(self)