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
99938acb
Commit
99938acb
authored
Mar 08, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix SyntaxWarning
parent
55ae1762
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
17 deletions
+17
-17
product/ERP5/Document/Resource.py
product/ERP5/Document/Resource.py
+3
-3
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_validateRelation.py
...plateItem/portal_skins/erp5_core/Base_validateRelation.py
+1
-1
product/ERP5Type/Accessor/Translation.py
product/ERP5Type/Accessor/Translation.py
+1
-1
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+9
-9
product/ERP5Type/Core/ContentExistenceConstraint.py
product/ERP5Type/Core/ContentExistenceConstraint.py
+1
-1
product/ERP5Type/XMLExportImport/ppml.py
product/ERP5Type/XMLExportImport/ppml.py
+2
-2
No files found.
product/ERP5/Document/Resource.py
View file @
99938acb
...
@@ -111,7 +111,7 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin):
...
@@ -111,7 +111,7 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin):
| morphology/2 | (colour/blue, colour/red, size/Man, size/Woman, morphology/2)
| morphology/2 | (colour/blue, colour/red, size/Man, size/Woman, morphology/2)
"""
"""
result
=
[]
result
=
[]
if
base_category_list
is
():
if
base_category_list
==
():
base_category_list
=
self
.
getVariationBaseCategoryList
(
base_category_list
=
self
.
getVariationBaseCategoryList
(
omit_individual_variation
=
omit_individual_variation
)
omit_individual_variation
=
omit_individual_variation
)
elif
isinstance
(
base_category_list
,
str
):
elif
isinstance
(
base_category_list
,
str
):
...
@@ -127,7 +127,7 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin):
...
@@ -127,7 +127,7 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin):
if
not
omit_individual_variation
:
if
not
omit_individual_variation
:
for
variation
in
individual_variation_list
:
for
variation
in
individual_variation_list
:
for
base_category
in
variation
.
getVariationBaseCategoryList
():
for
base_category
in
variation
.
getVariationBaseCategoryList
():
if
base_category_list
is
()
\
if
base_category_list
==
()
\
or
base_category
in
base_category_list
:
or
base_category
in
base_category_list
:
other_base_category_set
.
discard
(
base_category
)
other_base_category_set
.
discard
(
base_category
)
# XXX now, call Renderer a lot of time.
# XXX now, call Renderer a lot of time.
...
@@ -196,7 +196,7 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin):
...
@@ -196,7 +196,7 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin):
for
base_category
in
variation
.
getVariationBaseCategoryList
():
for
base_category
in
variation
.
getVariationBaseCategoryList
():
# backwards compatbility: if individual_bc_list is empty, allow
# backwards compatbility: if individual_bc_list is empty, allow
# all individual variation base categories.
# all individual variation base categories.
if
(
base_category_list
is
()
if
(
base_category_list
==
()
or
base_category
in
base_category_list
)
\
or
base_category
in
base_category_list
)
\
and
(
not
len
(
individual_bc_list
)
and
(
not
len
(
individual_bc_list
)
or
base_category
in
individual_bc_list
):
or
base_category
in
individual_bc_list
):
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_validateRelation.py
View file @
99938acb
...
@@ -77,7 +77,7 @@ try:
...
@@ -77,7 +77,7 @@ try:
if
checkFieldType
(
my_field
,
'MultiRelationStringField'
):
if
checkFieldType
(
my_field
,
'MultiRelationStringField'
):
# The checkProperty sometimes does not provide an
# The checkProperty sometimes does not provide an
# acceptable value - XXXX - see vetement_id in Modele View
# acceptable value - XXXX - see vetement_id in Modele View
if
old_value
is
''
or
old_value
is
None
:
if
old_value
==
''
or
old_value
is
None
:
old_value
=
[]
old_value
=
[]
try
:
try
:
old_value
=
list
(
old_value
)
old_value
=
list
(
old_value
)
...
...
product/ERP5Type/Accessor/Translation.py
View file @
99938acb
...
@@ -138,7 +138,7 @@ class PropertyTranslationDomainGetter(BaseGetter):
...
@@ -138,7 +138,7 @@ class PropertyTranslationDomainGetter(BaseGetter):
ptype_domain
=
''
ptype_domain
=
''
else
:
else
:
ptype_domain
=
domain
.
getDomainName
()
ptype_domain
=
domain
.
getDomainName
()
if
ptype_domain
is
''
and
default
is
not
None
:
if
ptype_domain
==
''
and
default
is
not
None
:
# then get the default property defined on property sheet
# then get the default property defined on property sheet
value
=
default
value
=
default
else
:
else
:
...
...
product/ERP5Type/Base.py
View file @
99938acb
...
@@ -1014,10 +1014,10 @@ class Base(
...
@@ -1014,10 +1014,10 @@ class Base(
result
=
None
result
=
None
else
:
else
:
if
isinstance
(
value
,
(
list
,
tuple
)):
if
isinstance
(
value
,
(
list
,
tuple
)):
if
len
(
value
)
is
0
:
if
len
(
value
):
result
=
None
else
:
result
=
value
[
0
]
result
=
value
[
0
]
else
:
result
=
None
else
:
else
:
result
=
value
result
=
value
else
:
else
:
...
@@ -1048,10 +1048,10 @@ class Base(
...
@@ -1048,10 +1048,10 @@ class Base(
result
=
None
result
=
None
else
:
else
:
if
isinstance
(
value
,
(
list
,
tuple
)):
if
isinstance
(
value
,
(
list
,
tuple
)):
if
len
(
value
)
is
0
:
if
len
(
value
):
result
=
None
else
:
result
=
value
[
0
]
result
=
value
[
0
]
else
:
result
=
None
else
:
else
:
result
=
value
result
=
value
else
:
else
:
...
@@ -1092,10 +1092,10 @@ class Base(
...
@@ -1092,10 +1092,10 @@ class Base(
result
=
None
result
=
None
else
:
else
:
if
isinstance
(
value
,
(
list
,
tuple
)):
if
isinstance
(
value
,
(
list
,
tuple
)):
if
len
(
value
)
is
0
:
if
len
(
value
):
result
=
None
else
:
result
=
value
[
0
]
result
=
value
[
0
]
else
:
result
=
None
else
:
else
:
result
=
value
result
=
value
else
:
else
:
...
...
product/ERP5Type/Core/ContentExistenceConstraint.py
View file @
99938acb
...
@@ -76,7 +76,7 @@ class ContentExistenceConstraint(ConstraintMixin):
...
@@ -76,7 +76,7 @@ class ContentExistenceConstraint(ConstraintMixin):
# Otherwise, generate an error message
# Otherwise, generate an error message
mapping
=
{}
mapping
=
{}
if
portal_type
is
()
:
if
not
portal_type
:
message_id
=
'message_no_subobject'
message_id
=
'message_no_subobject'
else
:
else
:
message_id
=
'message_no_subobject_portal_type'
message_id
=
'message_no_subobject_portal_type'
...
...
product/ERP5Type/XMLExportImport/ppml.py
View file @
99938acb
...
@@ -898,7 +898,7 @@ def save_bytes(self, tag, data):
...
@@ -898,7 +898,7 @@ def save_bytes(self, tag, data):
v
=
b''
.
join
(
data
[
2
:])
v
=
b''
.
join
(
data
[
2
:])
encoding
=
a
.
get
(
'encoding'
,
'repr'
)
encoding
=
a
.
get
(
'encoding'
,
'repr'
)
assert
encoding
==
'base64'
assert
encoding
==
'base64'
if
encoding
is
not
''
:
if
encoding
!=
''
:
v
=
unconvert
(
encoding
,
v
)
v
=
unconvert
(
encoding
,
v
)
if
self
.
binary
:
if
self
.
binary
:
l
=
len
(
v
)
l
=
len
(
v
)
...
@@ -922,7 +922,7 @@ def save_unicode(self, tag, data):
...
@@ -922,7 +922,7 @@ def save_unicode(self, tag, data):
for
x
in
data
[
2
:]:
for
x
in
data
[
2
:]:
v
=
v
+
x
v
=
v
+
x
encoding
=
a
.
get
(
'encoding'
,
'repr'
)
# JPS: repr is default encoding
encoding
=
a
.
get
(
'encoding'
,
'repr'
)
# JPS: repr is default encoding
if
encoding
is
not
''
:
if
encoding
!=
''
:
v
=
unconvert
(
encoding
,
v
)
v
=
unconvert
(
encoding
,
v
)
if
binary
:
if
binary
:
l
=
len
(
v
)
l
=
len
(
v
)
...
...
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