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
7861ed94
Commit
7861ed94
authored
Apr 06, 2022
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py3: string.join() removed.
parent
6db3464c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
product/Formulator/Widget.py
product/Formulator/Widget.py
+12
-12
No files found.
product/Formulator/Widget.py
View file @
7861ed94
...
...
@@ -748,7 +748,7 @@ class LinesTextAreaWidget(TextAreaWidget):
"""
if
isinstance
(
value
,
str
):
value
=
[
value
]
value
=
string
.
join
(
list
(
map
(
convertToString
,
value
)),
"
\
n
"
)
value
=
"
\
n
"
.
join
(
list
(
map
(
convertToString
,
value
))
)
return
TextAreaWidget
.
render
(
self
,
field
,
key
,
value
,
REQUEST
)
def
render_view
(
self
,
field
,
value
,
REQUEST
=
None
,
render_prefix
=
None
):
...
...
@@ -1092,8 +1092,8 @@ class MultiItemsWidget(ItemsWidget):
def
render_view
(
self
,
field
,
value
,
REQUEST
=
None
,
render_prefix
=
None
):
if
value
is
None
:
return
''
return
string
.
join
(
self
.
render_items_view
(
field
,
value
,
REQUEST
),
field
.
get_value
(
'view_separator'
))
return
field
.
get_value
(
'view_separator'
).
join
(
self
.
render_items_view
(
field
,
value
,
REQUEST
))
def
render_items_odf
(
self
,
field
,
value
,
REQUEST
):
if
type
(
value
)
is
not
type
([]):
...
...
@@ -1188,7 +1188,7 @@ class ListWidget(SingleItemsWidget):
name
=
key
,
css_class
=
field
.
get_value
(
'css_class'
,
REQUEST
=
REQUEST
),
size
=
field
.
get_value
(
'size'
,
REQUEST
=
REQUEST
),
contents
=
string
.
join
(
rendered_items
,
"
\
n
"
),
contents
=
"
\
n
"
.
join
(
rendered_items
),
extra
=
field
.
get_value
(
'extra'
,
REQUEST
=
REQUEST
))
return
"
\
n
"
.
join
([
list_widget
,
input_hidden
])
...
...
@@ -1235,7 +1235,7 @@ class MultiListWidget(MultiItemsWidget):
multiple
=
None
,
css_class
=
field
.
get_value
(
'css_class'
,
REQUEST
=
REQUEST
),
size
=
field
.
get_value
(
'size'
,
REQUEST
=
REQUEST
),
contents
=
string
.
join
(
rendered_items
,
"
\
n
"
),
contents
=
"
\
n
"
.
join
(
rendered_items
),
extra
=
field
.
get_value
(
'extra'
,
REQUEST
=
REQUEST
))
return
"
\
n
"
.
join
([
multi_list
,
input_hidden
])
...
...
@@ -1282,9 +1282,9 @@ class RadioWidget(SingleItemsWidget):
rendered_items
.
append
(
input_hidden
)
orientation
=
field
.
get_value
(
'orientation'
)
if
orientation
==
'horizontal'
:
return
string
.
join
(
rendered_items
,
" "
)
return
" "
.
join
(
rendered_items
)
else
:
return
string
.
join
(
rendered_items
,
"<br />"
)
return
"<br />"
.
join
(
rendered_items
)
def
render_item
(
self
,
text
,
value
,
key
,
css_class
,
extra_item
):
return
self
.
render_element
(
'input'
,
...
...
@@ -1327,9 +1327,9 @@ class MultiCheckBoxWidget(MultiItemsWidget):
rendered_items
.
append
(
render_element
(
'input'
,
type
=
'hidden'
,
name
=
"default_%s:int"
%
(
key
,
),
value
=
"0"
))
orientation
=
field
.
get_value
(
'orientation'
)
if
orientation
==
'horizontal'
:
return
string
.
join
(
rendered_items
,
" "
)
return
" "
.
join
(
rendered_items
)
else
:
return
string
.
join
(
rendered_items
,
"<br />"
)
return
"<br />"
.
join
(
rendered_items
)
def
render_item
(
self
,
text
,
value
,
key
,
css_class
,
extra_item
):
return
self
.
render_element
(
'input'
,
...
...
@@ -1564,7 +1564,7 @@ class DateTimeWidget(Widget):
for
sub_field_name
,
sub_field_value
in
order
:
result
.
append
(
field
.
render_sub_field
(
sub_field_name
,
sub_field_value
,
REQUEST
,
key
=
key
))
date_result
=
string
.
join
(
result
,
field
.
get_value
(
'date_separator'
)
)
date_result
=
field
.
get_value
(
'date_separator'
).
join
(
result
)
if
not
field
.
get_value
(
'date_only'
):
time_result
=
(
field
.
render_sub_field
(
'hour'
,
hour
,
REQUEST
,
key
=
key
)
+
field
.
get_value
(
'time_separator'
)
+
...
...
@@ -1616,7 +1616,7 @@ class DateTimeWidget(Widget):
output
=
[
year
,
month
]
else
:
output
=
[
year
,
month
,
day
]
date_result
=
string
.
join
(
output
,
field
.
get_value
(
'date_separator'
)
)
date_result
=
field
.
get_value
(
'date_separator'
).
join
(
output
)
if
mode
in
(
'html'
,
):
space
=
' '
...
...
@@ -1750,7 +1750,7 @@ def render_tag(tag, **kw):
value
=
key
attr_list
.
append
(
'%s="%s"'
%
(
key
,
html_quote
(
value
)))
attr_str
=
string
.
join
(
attr_list
,
" "
)
attr_str
=
" "
.
join
(
attr_list
)
return
"<%s %s %s"
%
(
tag
,
attr_str
,
extra
)
VOID_ELEMENT_LIST
=
(
'area'
,
'base'
,
'br'
,
'col'
,
'embed'
,
'hr'
,
'img'
,
...
...
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