Commit 0bb5287f authored by Jerome Flesch's avatar Jerome Flesch

1.2.post3: Fix loading of documentation files from package resources

Signed-off-by: Jerome Flesch's avatarJerome Flesch <jflesch@openpaper.work>
parent 606860b1
......@@ -92,7 +92,7 @@ setup(
# * update the public key in
# src/paperwork/frontend/activation/__init__.py:check_activation_key()
# if required
version="1.2.post2",
version="1.2.post3",
description=(
"Using scanner and OCR to grep dead trees the easy way (Linux only)"
),
......
......@@ -225,8 +225,6 @@ def get_documentation(doc_name):
Return the path to a documentation PDF.
Try to match the user language.
"""
DOC_SUBDIR = "doc"
lang = "en"
try:
lang = locale.getdefaultlocale()[0][:2]
......@@ -237,16 +235,15 @@ def get_documentation(doc_name):
)
pass
default = os.path.join(DOC_SUBDIR, doc_name + ".pdf")
localized = os.path.join(DOC_SUBDIR,
"{}_{}.pdf".format(doc_name, lang))
default = doc_name + ".pdf"
localized = "{}_{}.pdf".format(doc_name, lang)
try:
return _get_resource_path(localized, pkg="paperwork.frontend.docs")
return _get_resource_path(localized, pkg="paperwork.frontend.doc")
except:
pass
try:
return _get_resource_path(default, pkg="paperwork.frontend.docs")
return _get_resource_path(default, pkg="paperwork.frontend.doc")
except:
pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment