Skip to content

Commit 210f6e4

Browse files
committed
Black
1 parent a5e0f99 commit 210f6e4

8 files changed

Lines changed: 106 additions & 108 deletions

File tree

docs/conf.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919

2020
# -- Project information -----------------------------------------------------
2121

22-
project = u"MIS Builder"
22+
project = "MIS Builder"
2323
year = datetime.now().year
24-
copyright = u"%s, Odoo Community Association (OCA)" % year
25-
author = u"Odoo Community Association (OCA)"
24+
copyright = "%s, Odoo Community Association (OCA)" % year
25+
author = "Odoo Community Association (OCA)"
2626

2727
# The short X.Y version
28-
version = u"3.2"
28+
version = "3.2"
2929
# The full version, including alpha/beta/rc tags
3030
release = version
3131

@@ -63,7 +63,7 @@
6363
# List of patterns, relative to source directory, that match files and
6464
# directories to ignore when looking for source files.
6565
# This pattern also affects html_static_path and html_extra_path .
66-
exclude_patterns = [u"_build", "Thumbs.db", ".DS_Store"]
66+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
6767

6868
# The name of the Pygments (syntax highlighting) style to use.
6969
pygments_style = "sphinx"
@@ -145,8 +145,8 @@
145145
(
146146
master_doc,
147147
"MISBuilder.tex",
148-
u"MIS Builder Documentation",
149-
u"Odoo Community Association (OCA)",
148+
"MIS Builder Documentation",
149+
"Odoo Community Association (OCA)",
150150
"manual",
151151
)
152152
]
@@ -156,7 +156,7 @@
156156

157157
# One entry per manual page. List of tuples
158158
# (source start file, name, description, authors, manual section).
159-
man_pages = [(master_doc, "misbuilder", u"MIS Builder Documentation", [author], 1)]
159+
man_pages = [(master_doc, "misbuilder", "MIS Builder Documentation", [author], 1)]
160160

161161

162162
# -- Options for Texinfo output ----------------------------------------------
@@ -168,7 +168,7 @@
168168
(
169169
master_doc,
170170
"MISBuilder",
171-
u"MIS Builder Documentation",
171+
"MIS Builder Documentation",
172172
author,
173173
"MISBuilder",
174174
"One line description of project.",

mis_builder/models/kpimatrix.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,13 @@ def set_values_detail_account(
244244
self.lang, row.style_props, kpi.type, val
245245
)
246246
if row.kpi.multi and subcol.subkpi:
247-
val_comment = u"{}.{} = {}".format(
247+
val_comment = "{}.{} = {}".format(
248248
row.kpi.name,
249249
subcol.subkpi.name,
250250
row.kpi._get_expression_str_for_subkpi(subcol.subkpi),
251251
)
252252
else:
253-
val_comment = u"{} = {}".format(row.kpi.name, row.kpi.expression)
253+
val_comment = "{} = {}".format(row.kpi.name, row.kpi.expression)
254254
cell_style_props = row.style_props
255255
if row.kpi.style_expression:
256256
# evaluate style expression
@@ -313,7 +313,7 @@ def compute_comparisons(self):
313313
)
314314
)
315315
if not label:
316-
label = u"{} vs {}".format(col.label, base_col.label)
316+
label = "{} vs {}".format(col.label, base_col.label)
317317
comparison_col = KpiMatrixCol(
318318
cmpcol_key,
319319
label,
@@ -470,9 +470,9 @@ def _load_account_names(self):
470470
self._account_names = {a.id: self._get_account_name(a) for a in accounts}
471471

472472
def _get_account_name(self, account):
473-
result = u"{} {}".format(account.code, account.name)
473+
result = "{} {}".format(account.code, account.name)
474474
if self._multi_company:
475-
result = u"{} [{}]".format(result, account.company_id.name)
475+
result = "{} [{}]".format(result, account.company_id.name)
476476
return result
477477

478478
def get_account_name(self, account_id):

mis_builder/models/mis_kpi_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def _compute_name(self):
6262
subkpi_name = "." + subkpi_name
6363
else:
6464
subkpi_name = ""
65-
rec.name = u"{}{}: {} - {}".format(
65+
rec.name = "{}{}: {} - {}".format(
6666
rec.kpi_expression_id.kpi_id.name,
6767
subkpi_name,
6868
rec.date_from,

mis_builder/models/mis_report.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class MisReportKpi(models.Model):
144144
def name_get(self):
145145
res = []
146146
for rec in self:
147-
name = u"{} ({})".format(rec.description, rec.name)
147+
name = "{} ({})".format(rec.description, rec.name)
148148
res.append((rec.id, name))
149149
return res
150150

@@ -171,7 +171,7 @@ def _compute_expression(self):
171171
for expression in kpi.expression_ids:
172172
if expression.subkpi_id:
173173
exprs.append(
174-
u"{}\xa0=\xa0{}".format(
174+
"{}\xa0=\xa0{}".format(
175175
expression.subkpi_id.name, expression.name
176176
)
177177
)
@@ -308,7 +308,7 @@ def name_get(self):
308308
kpi = rec.kpi_id
309309
subkpi = rec.subkpi_id
310310
if subkpi:
311-
name = u"{} / {} ({}.{})".format(
311+
name = "{} / {} ({}.{})".format(
312312
kpi.description, subkpi.description, kpi.name, subkpi.name
313313
)
314314
else:

mis_builder/models/mis_report_style.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,14 @@ def render_num(
177177
):
178178
# format number following user language
179179
if value is None or value is AccountingNone:
180-
return u""
180+
return ""
181181
value = round(value / float(divider or 1), dp or 0) or 0
182182
r = lang.format("%%%s.%df" % (sign, dp or 0), value, grouping=True)
183-
r = r.replace("-", u"\N{NON-BREAKING HYPHEN}")
183+
r = r.replace("-", "\N{NON-BREAKING HYPHEN}")
184184
if prefix:
185-
r = prefix + u"\N{NO-BREAK SPACE}" + r
185+
r = prefix + "\N{NO-BREAK SPACE}" + r
186186
if suffix:
187-
r = r + u"\N{NO-BREAK SPACE}" + suffix
187+
r = r + "\N{NO-BREAK SPACE}" + suffix
188188
return r
189189

190190
@api.model
@@ -194,7 +194,7 @@ def render_pct(self, lang, value, dp=1, sign="-"):
194194
@api.model
195195
def render_str(self, lang, value):
196196
if value is None or value is AccountingNone:
197-
return u""
197+
return ""
198198
return unicode(value)
199199

200200
@api.model
@@ -275,20 +275,20 @@ def to_xlsx_style(self, type, props, no_indent=False):
275275
("bg_color", props.background_color),
276276
]
277277
if type == TYPE_NUM:
278-
num_format = u"#,##0"
278+
num_format = "#,##0"
279279
if props.dp:
280-
num_format += u"."
281-
num_format += u"0" * props.dp
280+
num_format += "."
281+
num_format += "0" * props.dp
282282
if props.prefix:
283-
num_format = u'"{} "{}'.format(props.prefix, num_format)
283+
num_format = '"{} "{}'.format(props.prefix, num_format)
284284
if props.suffix:
285-
num_format = u'{}" {}"'.format(num_format, props.suffix)
285+
num_format = '{}" {}"'.format(num_format, props.suffix)
286286
xlsx_attributes.append(("num_format", num_format))
287287
elif type == TYPE_PCT:
288-
num_format = u"0"
288+
num_format = "0"
289289
if props.dp:
290-
num_format += u"."
291-
num_format += u"0" * props.dp
290+
num_format += "."
291+
num_format += "0" * props.dp
292292
num_format += "%"
293293
xlsx_attributes.append(("num_format", num_format))
294294
if props.indent_level is not None and not no_indent:

mis_builder/report/mis_report_instance_xlsx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ def generate_xlsx_report(self, workbook, data, objects):
3333
style_obj = self.env["mis.report.style"]
3434

3535
# create worksheet
36-
report_name = u"{} - {}".format(
37-
objects[0].name, u", ".join([a.name for a in objects[0].query_company_ids])
36+
report_name = "{} - {}".format(
37+
objects[0].name, ", ".join([a.name for a in objects[0].query_company_ids])
3838
)
3939
sheet = workbook.add_worksheet(report_name[:31])
4040
row_pos = 0

0 commit comments

Comments
 (0)