Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit f141ac1a authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update to remove encode('utf-8') and decode('utf-8').

parent 1ea1f46f
......@@ -53,8 +53,8 @@ def dashboard():
selector.Graph_selectorYear_start = min_year
selector.Graph_selectorYear_end = max_year
title = (T(FROM_TO) % (min_year, max_year)).decode("utf-8")
ylabel = T(LABELY_YEAR).decode("utf-8")
title = T(FROM_TO) % (min_year, max_year)
ylabel = T(LABELY_YEAR)
linechart(db,
selector,
......@@ -70,7 +70,7 @@ def dashboard():
selector.Graph_selectorYear_start = year
selector.Graph_selectorYear_end = ""
title = (T("In %s") % year).decode("utf-8")
title = T("In %s") % year
linechart(db, selector, target=ax2, title=title)
# delegate the rendering to the view
......
......@@ -132,10 +132,10 @@ def emptychart(db, selector, target=None):
ax.tick_params(which="minor", length=4)
# x and y labels
xlabel = T(DATE_SUB).decode("utf-8")
xlabel = T(DATE_SUB)
ax.set_xlabel(xlabel, x=1, horizontalalignment="right")
ylabel = T(LABELY).decode("utf-8")
ylabel = T(LABELY)
ax.set_ylabel(ylabel, y=1, horizontalalignment="right")
# main title of the graph
......@@ -256,7 +256,7 @@ def linechart(db, selector, target=None, title=None, xlabel=None, ylabel=None):
# x label
if xlabel is None:
xlabel = T(DATE_PUB if is_publish_year else DATE_SUB).decode("utf-8")
xlabel = T(DATE_PUB if is_publish_year else DATE_SUB)
ax.set_xlabel(xlabel, x=1, horizontalalignment="right")
......@@ -273,7 +273,7 @@ def linechart(db, selector, target=None, title=None, xlabel=None, ylabel=None):
else:
ylabel = LABELY_YEAR
ylabel = T(ylabel).decode("utf-8")
ylabel = T(ylabel)
ax.set_ylabel(ylabel, y=1, horizontalalignment="right")
# main title of the graph
......@@ -440,7 +440,7 @@ def set_title(ax, db, selector):
period = year_start
title = "%s %s" % (title, period)
ax.set_title(title.decode("utf-8"))
ax.set_title(title)
def stackchart(db, selector, target=None):
......@@ -538,7 +538,7 @@ def stackchart(db, selector, target=None):
ax.tick_params(which="minor", length=4)
# x and y labels
xlabel = T(DATE_PUB if is_publish_year else DATE_SUB).decode("utf-8")
xlabel = T(DATE_PUB if is_publish_year else DATE_SUB)
ax.set_xlabel(xlabel, x=1, horizontalalignment="right")
# y label
......@@ -553,14 +553,14 @@ def stackchart(db, selector, target=None):
else:
ylabel = LABELY_YEAR
ylabel = T(ylabel).decode("utf-8")
ylabel = T(ylabel)
ax.set_ylabel(ylabel, y=1, horizontalalignment="right")
# legend title is the name of the axis
axis = (axis if axis == "categories" else graph.stack_granularity)
legend = ax.get_legend()
legend.set_title(T(axis).decode("utf-8"))
legend.set_title(T(axis))
# main title of the graph
set_title(ax, db, selector)
......
......@@ -126,7 +126,7 @@ def search_synonym(table, fieldname, value, create=False):
return id_rec
# nothing found, have a look to the synonyms field
query = table.synonyms.contains(value.encode('utf-8'))
query = table.synonyms.contains(value)
setrows = db(query)
# no synonym found, create the entry
......
......@@ -396,10 +396,7 @@ class RecordPubli(Record):
.sort_index()
.fmt_name)
data = data.str.encode("utf-8")
sep = sep.encode("utf-8")
return (sep.join(data) if len(data) > 0 else "").decode("utf-8")
return (sep.join(data) if len(data) > 0 else "")
def first_author(self):
"""The name of the first author.
......
......@@ -14,6 +14,7 @@ from gluon import current
from gluon.validators import (IS_EMPTY_OR,
IS_IN_DB,
IS_INT_IN_RANGE,
IS_IN_SET,
IS_LENGTH,
IS_MATCH,
IS_URL)
......@@ -22,7 +23,6 @@ from plugin_dbui import (CLEAN_COMMA,
CLEAN_SPACES,
INHIBIT_DELETE_UNDEF,
INHIBIT_UPDATE_UNDEF,
IS_IN_USET,
UNDEF,
UNDEF_ID)
......@@ -132,7 +132,7 @@ class Core(object):
Core._protect(table)
cat_usual = sorted([T(el) for el in CAT_USUAL])
table.usual.requires = IS_IN_USET(cat_usual)
table.usual.requires = IS_IN_SET(cat_usual)
table.code.filter_in = CLEAN_SPACES
table.usual.filter_in = CLEAN_SPACES
......
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