Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
0d0d4960
Commit
0d0d4960
authored
Jan 27, 2024
by
Jérome Perrin
Committed by
Kazuhiko Shiozaki
Jul 11, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deferred_style: use bz2 and zlib module instead of python2 only syntax
parent
e9e77c1e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/Base_renderReportSection.py
...kins/erp5_deferred_style_core/Base_renderReportSection.py
+2
-1
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/Base_report.py
...Item/portal_skins/erp5_deferred_style_core/Base_report.py
+4
-2
No files found.
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/Base_renderReportSection.py
View file @
0d0d4960
import
bz2
request
=
container
.
REQUEST
request
.
form
.
update
(
report_request
)
request
.
other
.
update
(
report_request
)
...
...
@@ -25,4 +26,4 @@ with portal.Localizer.translationContext(localizer_language):
report_section
.
popReport
(
portal
,
render_prefix
=
render_prefix
)
return
report_section_idx
,
data
.
encode
(
'utf8'
).
encode
(
'bz2'
)
return
report_section_idx
,
bz2
.
compress
(
data
.
encode
(
'utf8'
)
)
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/Base_report.py
View file @
0d0d4960
# pylint: disable=redefined-builtin
import
bz2
import
zlib
request
=
container
.
REQUEST
request
.
form
.
update
(
report_request
)
...
...
@@ -21,9 +23,9 @@ with portal.Localizer.translationContext(localizer_language):
def
decodeReportSection
(
data
):
# BBB We use to encode in zlib
try
:
return
data
.
decode
(
'bz2'
)
return
bz2
.
decompress
(
data
)
except
IOError
:
return
data
.
decode
(
'zlib'
)
return
zlib
.
decompress
(
data
)
if
portal
.
portal_preferences
.
getPreferredDeferredReportStoredAsDocument
():
pt_render_format
=
None
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment