Commit 7861ed94 authored by Arnaud Fontaine's avatar Arnaud Fontaine

py3: string.join() removed.

parent 6db3464c
......@@ -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, "&nbsp;&nbsp;")
return "&nbsp;&nbsp;".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 = '&nbsp;'
......@@ -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',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment