caerp-sign-pdf 2026.1.0__tar.gz → 2026.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- caerp_sign_pdf-2026.1.2/CHANGELOG +23 -0
- {caerp_sign_pdf-2026.1.0 → caerp_sign_pdf-2026.1.2}/PKG-INFO +1 -1
- {caerp_sign_pdf-2026.1.0 → caerp_sign_pdf-2026.1.2}/pyproject.toml +1 -1
- {caerp_sign_pdf-2026.1.0 → caerp_sign_pdf-2026.1.2}/src/caerp_sign_pdf/public.py +18 -9
- {caerp_sign_pdf-2026.1.0 → caerp_sign_pdf-2026.1.2}/src/caerp_sign_pdf.egg-info/PKG-INFO +1 -1
- caerp_sign_pdf-2026.1.0/CHANGELOG +0 -8
- {caerp_sign_pdf-2026.1.0 → caerp_sign_pdf-2026.1.2}/.gitignore +0 -0
- {caerp_sign_pdf-2026.1.0 → caerp_sign_pdf-2026.1.2}/LICENSE.txt +0 -0
- {caerp_sign_pdf-2026.1.0 → caerp_sign_pdf-2026.1.2}/MANIFEST.in +0 -0
- {caerp_sign_pdf-2026.1.0 → caerp_sign_pdf-2026.1.2}/README.rst +0 -0
- {caerp_sign_pdf-2026.1.0 → caerp_sign_pdf-2026.1.2}/requirements.txt +0 -0
- {caerp_sign_pdf-2026.1.0 → caerp_sign_pdf-2026.1.2}/setup.cfg +0 -0
- {caerp_sign_pdf-2026.1.0 → caerp_sign_pdf-2026.1.2}/src/caerp_sign_pdf/__init__.py +0 -0
- {caerp_sign_pdf-2026.1.0 → caerp_sign_pdf-2026.1.2}/src/caerp_sign_pdf/models.py +0 -0
- {caerp_sign_pdf-2026.1.0 → caerp_sign_pdf-2026.1.2}/src/caerp_sign_pdf.egg-info/SOURCES.txt +0 -0
- {caerp_sign_pdf-2026.1.0 → caerp_sign_pdf-2026.1.2}/src/caerp_sign_pdf.egg-info/dependency_links.txt +0 -0
- {caerp_sign_pdf-2026.1.0 → caerp_sign_pdf-2026.1.2}/src/caerp_sign_pdf.egg-info/requires.txt +0 -0
- {caerp_sign_pdf-2026.1.0 → caerp_sign_pdf-2026.1.2}/src/caerp_sign_pdf.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
2026.1.2 (2/01/2026)
|
|
2
|
+
====================
|
|
3
|
+
|
|
4
|
+
Fix sur les fichiers déjà signés
|
|
5
|
+
|
|
6
|
+
2026.1.1 (2/01/2026)
|
|
7
|
+
====================
|
|
8
|
+
|
|
9
|
+
Fix la signature des appels
|
|
10
|
+
|
|
11
|
+
2026.1.0 (2/01/2026)
|
|
12
|
+
====================
|
|
13
|
+
|
|
14
|
+
Ne reformate le pdf qu'en cas d'échec de signature
|
|
15
|
+
|
|
16
|
+
2024.2.2 (5/11/2025)
|
|
17
|
+
====================
|
|
18
|
+
|
|
19
|
+
Suppression de caerp_base
|
|
20
|
+
|
|
21
|
+
2024.1.0 (??? 2024)
|
|
22
|
+
=======================
|
|
23
|
+
Première version stable
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "caerp_sign_pdf"
|
|
3
3
|
description = "Pdf signature library for CAErp"
|
|
4
|
-
version = "2026.1.
|
|
4
|
+
version = "2026.1.2"
|
|
5
5
|
authors = [{name = "Kilya", email = "contact@kilya.net"}]
|
|
6
6
|
readme = {file = "README.rst", content-type = "text/x-rst"}
|
|
7
7
|
license = {file = "LICENSE.txt"}
|
|
@@ -26,6 +26,12 @@ car son format n'est pas correct. Vous pouvez essayer de l'imprimer dans un \
|
|
|
26
26
|
nouveau fichier PDF avant de le recharger."
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
class AlreadySignedException(Exception):
|
|
30
|
+
"""
|
|
31
|
+
Raised when a PDF file has already been signed
|
|
32
|
+
"""
|
|
33
|
+
pass
|
|
34
|
+
|
|
29
35
|
class SignPDFService(object):
|
|
30
36
|
"""
|
|
31
37
|
The PDF digital signing service
|
|
@@ -113,11 +119,11 @@ class SignPDFService(object):
|
|
|
113
119
|
),
|
|
114
120
|
)
|
|
115
121
|
except SigningError:
|
|
116
|
-
|
|
117
|
-
|
|
122
|
+
# Fichier déjà signé
|
|
123
|
+
raise AlreadySignedException()
|
|
118
124
|
except Exception as error:
|
|
119
125
|
logger.error(f"Error while adding signature field : {error}")
|
|
120
|
-
raise
|
|
126
|
+
raise error
|
|
121
127
|
|
|
122
128
|
# Sign PDF
|
|
123
129
|
try:
|
|
@@ -130,7 +136,7 @@ class SignPDFService(object):
|
|
|
130
136
|
pdf_data.data = pdf_signer.sign_pdf(pdf_writer)
|
|
131
137
|
except Exception as error:
|
|
132
138
|
logger.error(f"Error while signing PDF file : {error}")
|
|
133
|
-
raise
|
|
139
|
+
raise error
|
|
134
140
|
|
|
135
141
|
return pdf_data, signer
|
|
136
142
|
|
|
@@ -187,17 +193,20 @@ class SignPDFService(object):
|
|
|
187
193
|
if not clean:
|
|
188
194
|
return self.sign(pdf_data, node_id, with_stamp, clean=True)
|
|
189
195
|
else:
|
|
190
|
-
logger.
|
|
196
|
+
logger.exception(f"Error while opening PDF file : {error}")
|
|
191
197
|
raise HTTPUnsupportedMediaType(ERROR_PDF_FORMAT_MSG)
|
|
192
198
|
|
|
193
199
|
try:
|
|
194
|
-
self._sign_pdf(signer, pdf_data, with_stamp)
|
|
195
|
-
except
|
|
200
|
+
self._sign_pdf(signer, pdf_writer, pdf_data, with_stamp)
|
|
201
|
+
except AlreadySignedException:
|
|
202
|
+
logger.warning("File is already signed, nothing to do")
|
|
203
|
+
return True
|
|
204
|
+
except Exception:
|
|
196
205
|
if not clean:
|
|
197
|
-
return self.sign(pdf_data,
|
|
206
|
+
return self.sign(pdf_data, node_id, with_stamp, clean=True)
|
|
198
207
|
else:
|
|
199
208
|
logger.exception("Error while signing pdf")
|
|
200
|
-
raise
|
|
209
|
+
raise HTTPUnsupportedMediaType(ERROR_PDF_FORMAT_MSG)
|
|
201
210
|
|
|
202
211
|
# Success
|
|
203
212
|
logger.info(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{caerp_sign_pdf-2026.1.0 → caerp_sign_pdf-2026.1.2}/src/caerp_sign_pdf.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{caerp_sign_pdf-2026.1.0 → caerp_sign_pdf-2026.1.2}/src/caerp_sign_pdf.egg-info/requires.txt
RENAMED
|
File without changes
|
{caerp_sign_pdf-2026.1.0 → caerp_sign_pdf-2026.1.2}/src/caerp_sign_pdf.egg-info/top_level.txt
RENAMED
|
File without changes
|