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
Levin Zimmermann
erp5
Commits
569729fa
Commit
569729fa
authored
May 01, 2022
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py2: TODO.
parent
a706fbcc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
product/ERP5Type/Accessor/Translation.py
product/ERP5Type/Accessor/Translation.py
+1
-1
product/ERP5Type/Accessor/TypeDefinition.py
product/ERP5Type/Accessor/TypeDefinition.py
+5
-1
product/PortalTransforms/data.py
product/PortalTransforms/data.py
+3
-3
No files found.
product/ERP5Type/Accessor/Translation.py
View file @
569729fa
...
...
@@ -85,7 +85,7 @@ class TranslatedPropertyGetter(BaseGetter):
localizer
=
instance
.
getPortalObject
().
Localizer
message_catalog
=
getattr
(
localizer
,
domain
,
None
)
if
message_catalog
is
not
None
:
return
message_catalog
.
gettext
(
unicode
(
value
,
'utf8'
),
lang
=
self
.
_language
).
encode
(
'utf8'
)
return
message_catalog
.
gettext
(
value
,
lang
=
self
.
_language
)
else
:
return
value
...
...
product/ERP5Type/Accessor/TypeDefinition.py
View file @
569729fa
...
...
@@ -98,8 +98,10 @@ def asString(value):
if
value
is
None
:
result
=
''
else
:
if
isinstance
(
value
,
unicode
):
if
six
.
PY2
and
isinstance
(
value
,
unicode
):
result
=
value
.
encode
(
'utf-8'
)
elif
six
.
PY3
and
isinstance
(
value
,
bytes
):
result
=
value
.
decode
(
'utf-8'
)
else
:
result
=
str
(
value
)
except
TypeError
:
...
...
@@ -109,6 +111,8 @@ def asString(value):
def
asList
(
value
):
"""
Return the value as a list or a type-specific default value if it fails.
XXX-zope4py3: bytes()?
"""
if
isinstance
(
value
,
(
list
,
tuple
)):
result
=
list
(
value
)
...
...
product/PortalTransforms/data.py
View file @
569729fa
from
zope.interface
import
implementer
import
six
from
Products.PortalTransforms.interfaces
import
IDataStream
@
implementer
(
IDataStream
)
class
datastream
:
"""A transformation datastream packet"""
if
six
.
PY2
:
__slots__
=
(
'name'
,
'_data'
,
'_metadata'
)
def
__init__
(
self
,
name
):
...
...
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