Skip to content

Commit

Permalink
Allow user to override path for each binary used.
Browse files Browse the repository at this point in the history
  • Loading branch information
ciur committed Aug 11, 2020
1 parent 0b9fe22 commit f4a062e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
34 changes: 32 additions & 2 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,41 @@
}
)

PAPERMERGE_OCR_BINARY = cfg_papermerge.get(
"OCR_BINARY",
BINARY_FILE = cfg_papermerge.get(
"BINARY_FILE",
"/usr/bin/file"
)

BINARY_CONVERT = cfg_papermerge.get(
"BINARY_CONVERT",
"/usr/bin/convert"
)

BINARY_PDFTOPPM = cfg_papermerge.get(
"BINARY_PDFTOPPM",
"/usr/bin/pdftoppm"
)

BINARY_PDFINFO = cfg_papermerge.get(
"BINARY_PDFINFO",
"/usr/bin/pdfinfo"
)

BINARY_IDENTIFY = cfg_papermerge.get(
"BINARY_IDENTIFY",
"/usr/bin/identify"
)

BINARY_OCR = cfg_papermerge.get(
"BINARY_OCR",
"/usr/bin/tesseract"
)

BINARY_PDFTK = cfg_papermerge.get(
"BINARY_PDFTK",
"/usr/bin/pdftk"
)

AUTH_USER_MODEL = "core.User"

WSGI_APPLICATION = 'config.wsgi.application'
Expand Down
4 changes: 4 additions & 0 deletions papermerge/core/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ def binaries_check(app_configs, **kwargs):
"""

msg = {
"file": "Without it, Papermerge won't be able to learn file mime type",
"convert": "Without it, image resizing is not possible",
"pdftoppm": "Without it, it not possible to extract images from PDF",
"tesseract": "Without it, OCR of the documents is impossible",
"identify": "Without it, it is not possible to count pages in TIFF",
"pdfinfo": "Without it, Papermerge won't function properly",
"pdftk": "Without it, Papermerge won't be able to cut/paste PDF pages"
}
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mglib == 1.2.5
mglib == 1.2.6
mgclipboard >= 0.2.0
django == 3.0.8
celery==4.4.0
Expand Down

0 comments on commit f4a062e

Please sign in to comment.