Skip to content

Commit 79113fb

Browse files
authored
[SP-10497] add log decompression (#92)
* add log decompression * update certify
1 parent 5e84228 commit 79113fb

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ verify_ssl = true
44
name = "pypi"
55

66
[packages]
7-
certifi = "==2022.12.7"
7+
certifi = "==2023.7.22"
88
six = ">=1.10"
99
python-dateutil = ">=2.5.3"
1010
urllib3 = ">=1.15.1"

Pipfile.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

regula/documentreader/webclient/ext/models/recognition_response.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import base64
22
import json
3+
import zlib
34
from typing import Optional, List
45
from regula.documentreader.webclient import ImageQualityCheckList, OneCandidate
56
from regula.documentreader.webclient.ext.models.authenticity.authenticity_check_list import AuthenticityCheckList
@@ -72,6 +73,14 @@ def result_by_type(self, result_type: int) -> Optional[ResultItem]:
7273
def results_by_type(self, result_type) -> List[ResultItem]:
7374
return [r for r in self.low_lvl_response.container_list.list if r.result_type == result_type]
7475

76+
def log(self) -> Optional[str]:
77+
log_base64 = self.low_lvl_response.log
78+
if not log_base64:
79+
return None
80+
buffer = base64.b64decode(log_base64.encode("UTF-8"))
81+
log_text = zlib.decompress(buffer).decode("UTF-8")
82+
return log_text
83+
7584
def __eq__(self, other: object) -> bool:
7685
if not isinstance(other, RecognitionResponse):
7786
return False

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"regula",
2525
],
2626
install_requires=[
27-
"certifi==2022.12.7",
27+
"certifi==2023.7.22",
2828
"python-dateutil==2.8.1",
2929
"six==1.15.0",
3030
"urllib3==1.26.5",

0 commit comments

Comments
 (0)