Commit 8f7256a3 authored by Nicola Spanti's avatar Nicola Spanti
Browse files

feat: remove Python 2 support and `six`

parent 1fb7602eff9d
Pipeline #88000 passed with stage
in 35 seconds
......@@ -25,7 +25,6 @@ web = 'https://forge.extranet.logilab.fr/cubicweb/cubes/%s' % distname
__depends__ = {
'cubicweb': ">= 3.26.19, < 3.34.0",
'six': '>= 1.12.0',
}
__recommends__ = {}
......@@ -33,7 +32,7 @@ classifiers = [
'Environment :: Web Environment',
'Framework :: CubicWeb',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: JavaScript',
]
......@@ -19,8 +19,6 @@
import json
from six import string_types
from cubicweb import Binary
from cubicweb.web import ProcessFormError
from cubicweb.web import formfields as ff
......@@ -70,7 +68,7 @@ class FloatEditableSlickGridField(EditableSlickGridField):
if not any(values):
return res
for value in values:
if isinstance(value, string_types):
if isinstance(value, str):
value = value.strip()
if not value:
res.append('')
......
......@@ -17,8 +17,6 @@
"""cubicweb-slickgrid views/forms/actions/components for web ui"""
import six
from cubicweb import tags
from cubicweb.dataimport import ucsvreader
from cubicweb.uilib import js
......@@ -65,7 +63,7 @@ class EditableSlickGridWidget(FieldWidget):
data = self.get_data(form, field, columns)
divid = 'grid_{0}_{1}'.format(field.role_name(),
form.edited_entity.eid)
form._cw.add_onload(six.text_type(
form._cw.add_onload(str(
js.cw.slickgrid.editableGrid(
'#%s' % divid, columns, data,
self.default_grid_options)) + ';')
......
......@@ -17,7 +17,6 @@
"""cubicweb-slickgrid views/forms/actions/components for web ui"""
import six
from cubicweb.web.views import tableview
from cubicweb.uilib import js
......@@ -82,7 +81,7 @@ class GridLayout(tableview.TableLayout):
# synchronously add slickgrid rendering then every other js
# from cells renderers
onloads.insert(0, six.text_type(onload_call))
onloads.insert(0, str(onload_call))
cnx.add_onload('\n'.join(onloads))
def get_js(self, divid):
......@@ -90,7 +89,7 @@ class GridLayout(tableview.TableLayout):
colrenderers = view.build_column_renderers()
headers = self.render_table_headers(colrenderers)
data = self.render_table_body(colrenderers)
return six.text_type(
return str(
js.cw.slickgrid.displayGrid(
'#%s' % divid, headers, data,
view.default_grid_options,
......@@ -115,7 +114,7 @@ class GridLayout(tableview.TableLayout):
def render_row(self, rownum, renderers):
row = {'id': rownum}
row.update((six.text_type(cr.colid), self.render_cell(rownum, cr))
row.update((str(cr.colid), self.render_cell(rownum, cr))
for cr in renderers)
return row
......
......@@ -80,4 +80,5 @@ setup(
],
},
zip_safe=False,
python_requires=">=3.7",
)
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