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
141
Merge Requests
141
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
d61f57e5
Commit
d61f57e5
authored
Mar 23, 2023
by
Jérome Perrin
Committed by
Arnaud Fontaine
Jul 31, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PortalTransforms: py3 WIP
🚧
parent
7bcd3dbe
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
product/PortalTransforms/libtransforms/commandtransform.py
product/PortalTransforms/libtransforms/commandtransform.py
+5
-3
product/PortalTransforms/libtransforms/imagemagick_transform.py
...t/PortalTransforms/libtransforms/imagemagick_transform.py
+1
-3
No files found.
product/PortalTransforms/libtransforms/commandtransform.py
View file @
d61f57e5
...
...
@@ -35,7 +35,8 @@ class commandtransform:
os
.
mkdir
(
tmpdir
)
filename
=
kwargs
.
get
(
"filename"
,
''
)
fullname
=
join
(
tmpdir
,
basename
(
filename
))
filedest
=
open
(
fullname
,
"wb"
).
write
(
data
)
with
open
(
fullname
,
"wb"
)
as
f
:
f
.
write
(
data
)
return
tmpdir
,
fullname
def
subObjects
(
self
,
tmpdir
):
...
...
@@ -51,7 +52,8 @@ class commandtransform:
def
fixImages
(
self
,
path
,
images
,
objects
):
for
image
in
images
:
objects
[
image
]
=
open
(
join
(
path
,
image
),
'rb'
).
read
()
with
open
(
join
(
path
,
image
),
'rb'
)
as
f
:
objects
[
image
]
=
f
.
read
()
def
cleanDir
(
self
,
tmpdir
):
shutil
.
rmtree
(
tmpdir
)
...
...
@@ -99,7 +101,7 @@ class popentransform:
cin
,
couterr
=
os
.
popen4
(
command
,
'b'
)
if
self
.
useStdin
:
cin
.
write
(
str
(
data
))
cin
.
write
(
bytes
(
data
))
status
=
cin
.
close
()
...
...
product/PortalTransforms/libtransforms/imagemagick_transform.py
View file @
d61f57e5
...
...
@@ -36,9 +36,7 @@ class ImageMagickTransforms:
stderr
=
subprocess
.
PIPE
,
close_fds
=
True
)
try
:
# XXX: The only portable way is to pass what stdin.write can accept,
# which is a string for PIPE.
image
,
err
=
p
.
communicate
(
str
(
orig
))
image
,
err
=
p
.
communicate
(
bytes
(
orig
))
finally
:
del
p
...
...
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