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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
erp5
Commits
62ae7291
Commit
62ae7291
authored
Jan 27, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deferred_style: use bz2 and zlib module instead of python2 only syntax
parent
48e2e4fd
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 @
62ae7291
import
bz2
request
=
container
.
REQUEST
request
=
container
.
REQUEST
request
.
form
.
update
(
report_request
)
request
.
form
.
update
(
report_request
)
request
.
other
.
update
(
report_request
)
request
.
other
.
update
(
report_request
)
...
@@ -25,4 +26,4 @@ with portal.Localizer.translationContext(localizer_language):
...
@@ -25,4 +26,4 @@ with portal.Localizer.translationContext(localizer_language):
report_section
.
popReport
(
portal
,
render_prefix
=
render_prefix
)
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 @
62ae7291
# pylint: disable=redefined-builtin
# pylint: disable=redefined-builtin
import
bz2
import
zlib
request
=
container
.
REQUEST
request
=
container
.
REQUEST
request
.
form
.
update
(
report_request
)
request
.
form
.
update
(
report_request
)
...
@@ -21,9 +23,9 @@ with portal.Localizer.translationContext(localizer_language):
...
@@ -21,9 +23,9 @@ with portal.Localizer.translationContext(localizer_language):
def
decodeReportSection
(
data
):
def
decodeReportSection
(
data
):
# BBB We use to encode in zlib
# BBB We use to encode in zlib
try
:
try
:
return
data
.
decode
(
'bz2'
)
return
bz2
.
decompress
(
data
)
except
IOError
:
except
IOError
:
return
data
.
decode
(
'zlib'
)
return
zlib
.
decompress
(
data
)
if
portal
.
portal_preferences
.
getPreferredDeferredReportStoredAsDocument
():
if
portal
.
portal_preferences
.
getPreferredDeferredReportStoredAsDocument
():
pt_render_format
=
None
pt_render_format
=
None
else
:
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