Skip to content

Commit

Permalink
Black
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Mar 29, 2022
1 parent a5e0f99 commit 210f6e4
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 108 deletions.
18 changes: 9 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@

# -- Project information -----------------------------------------------------

project = u"MIS Builder"
project = "MIS Builder"
year = datetime.now().year
copyright = u"%s, Odoo Community Association (OCA)" % year
author = u"Odoo Community Association (OCA)"
copyright = "%s, Odoo Community Association (OCA)" % year
author = "Odoo Community Association (OCA)"

# The short X.Y version
version = u"3.2"
version = "3.2"
# The full version, including alpha/beta/rc tags
release = version

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

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"
Expand Down Expand Up @@ -145,8 +145,8 @@
(
master_doc,
"MISBuilder.tex",
u"MIS Builder Documentation",
u"Odoo Community Association (OCA)",
"MIS Builder Documentation",
"Odoo Community Association (OCA)",
"manual",
)
]
Expand All @@ -156,7 +156,7 @@

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


# -- Options for Texinfo output ----------------------------------------------
Expand All @@ -168,7 +168,7 @@
(
master_doc,
"MISBuilder",
u"MIS Builder Documentation",
"MIS Builder Documentation",
author,
"MISBuilder",
"One line description of project.",
Expand Down
10 changes: 5 additions & 5 deletions mis_builder/models/kpimatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,13 @@ def set_values_detail_account(
self.lang, row.style_props, kpi.type, val
)
if row.kpi.multi and subcol.subkpi:
val_comment = u"{}.{} = {}".format(
val_comment = "{}.{} = {}".format(
row.kpi.name,
subcol.subkpi.name,
row.kpi._get_expression_str_for_subkpi(subcol.subkpi),
)
else:
val_comment = u"{} = {}".format(row.kpi.name, row.kpi.expression)
val_comment = "{} = {}".format(row.kpi.name, row.kpi.expression)
cell_style_props = row.style_props
if row.kpi.style_expression:
# evaluate style expression
Expand Down Expand Up @@ -313,7 +313,7 @@ def compute_comparisons(self):
)
)
if not label:
label = u"{} vs {}".format(col.label, base_col.label)
label = "{} vs {}".format(col.label, base_col.label)
comparison_col = KpiMatrixCol(
cmpcol_key,
label,
Expand Down Expand Up @@ -470,9 +470,9 @@ def _load_account_names(self):
self._account_names = {a.id: self._get_account_name(a) for a in accounts}

def _get_account_name(self, account):
result = u"{} {}".format(account.code, account.name)
result = "{} {}".format(account.code, account.name)
if self._multi_company:
result = u"{} [{}]".format(result, account.company_id.name)
result = "{} [{}]".format(result, account.company_id.name)
return result

def get_account_name(self, account_id):
Expand Down
2 changes: 1 addition & 1 deletion mis_builder/models/mis_kpi_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _compute_name(self):
subkpi_name = "." + subkpi_name
else:
subkpi_name = ""
rec.name = u"{}{}: {} - {}".format(
rec.name = "{}{}: {} - {}".format(
rec.kpi_expression_id.kpi_id.name,
subkpi_name,
rec.date_from,
Expand Down
6 changes: 3 additions & 3 deletions mis_builder/models/mis_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class MisReportKpi(models.Model):
def name_get(self):
res = []
for rec in self:
name = u"{} ({})".format(rec.description, rec.name)
name = "{} ({})".format(rec.description, rec.name)
res.append((rec.id, name))
return res

Expand All @@ -171,7 +171,7 @@ def _compute_expression(self):
for expression in kpi.expression_ids:
if expression.subkpi_id:
exprs.append(
u"{}\xa0=\xa0{}".format(
"{}\xa0=\xa0{}".format(
expression.subkpi_id.name, expression.name
)
)
Expand Down Expand Up @@ -308,7 +308,7 @@ def name_get(self):
kpi = rec.kpi_id
subkpi = rec.subkpi_id
if subkpi:
name = u"{} / {} ({}.{})".format(
name = "{} / {} ({}.{})".format(
kpi.description, subkpi.description, kpi.name, subkpi.name
)
else:
Expand Down
26 changes: 13 additions & 13 deletions mis_builder/models/mis_report_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,14 @@ def render_num(
):
# format number following user language
if value is None or value is AccountingNone:
return u""
return ""
value = round(value / float(divider or 1), dp or 0) or 0
r = lang.format("%%%s.%df" % (sign, dp or 0), value, grouping=True)
r = r.replace("-", u"\N{NON-BREAKING HYPHEN}")
r = r.replace("-", "\N{NON-BREAKING HYPHEN}")
if prefix:
r = prefix + u"\N{NO-BREAK SPACE}" + r
r = prefix + "\N{NO-BREAK SPACE}" + r
if suffix:
r = r + u"\N{NO-BREAK SPACE}" + suffix
r = r + "\N{NO-BREAK SPACE}" + suffix
return r

@api.model
Expand All @@ -194,7 +194,7 @@ def render_pct(self, lang, value, dp=1, sign="-"):
@api.model
def render_str(self, lang, value):
if value is None or value is AccountingNone:
return u""
return ""
return unicode(value)

@api.model
Expand Down Expand Up @@ -275,20 +275,20 @@ def to_xlsx_style(self, type, props, no_indent=False):
("bg_color", props.background_color),
]
if type == TYPE_NUM:
num_format = u"#,##0"
num_format = "#,##0"
if props.dp:
num_format += u"."
num_format += u"0" * props.dp
num_format += "."
num_format += "0" * props.dp
if props.prefix:
num_format = u'"{} "{}'.format(props.prefix, num_format)
num_format = '"{} "{}'.format(props.prefix, num_format)
if props.suffix:
num_format = u'{}" {}"'.format(num_format, props.suffix)
num_format = '{}" {}"'.format(num_format, props.suffix)
xlsx_attributes.append(("num_format", num_format))
elif type == TYPE_PCT:
num_format = u"0"
num_format = "0"
if props.dp:
num_format += u"."
num_format += u"0" * props.dp
num_format += "."
num_format += "0" * props.dp
num_format += "%"
xlsx_attributes.append(("num_format", num_format))
if props.indent_level is not None and not no_indent:
Expand Down
4 changes: 2 additions & 2 deletions mis_builder/report/mis_report_instance_xlsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def generate_xlsx_report(self, workbook, data, objects):
style_obj = self.env["mis.report.style"]

# create worksheet
report_name = u"{} - {}".format(
objects[0].name, u", ".join([a.name for a in objects[0].query_company_ids])
report_name = "{} - {}".format(
objects[0].name, ", ".join([a.name for a in objects[0].query_company_ids])
)
sheet = workbook.add_worksheet(report_name[:31])
row_pos = 0
Expand Down
Loading

0 comments on commit 210f6e4

Please sign in to comment.