Skip to content

Commit

Permalink
[IMP] pre-commit autofixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Oct 2, 2024
1 parent 993914a commit b74fd95
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion server_environment/models/server_env_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def _server_env_transform_field_to_read_from_env(self, field):
"""Transform the original field in a computed field"""
field.compute = "_compute_server_env"

inverse_method_name = "_inverse_server_env_%s" % field.name
inverse_method_name = f"_inverse_server_env_{field.name}"
inverse_method = _partialmethod(
type(self)._inverse_server_env, field.name, __name__=inverse_method_name
)
Expand Down
8 changes: 4 additions & 4 deletions server_environment/server_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _load_running_env():
if not os.path.exists(ck_path):
raise Exception(
"Provided server environment does not exist, "
"please add a folder %s" % ck_path
f"please add a folder {ck_path}"
)


Expand Down Expand Up @@ -260,7 +260,7 @@ def _group(cls, items):
return (
'<group col="2" colspan="4">'
+ "".join(
['<field name="%s" readonly="1"/>' % _escape(name) for name in names]
[f'<field name="{_escape(name)}" readonly="1"/>' for name in names]
)
+ "</group>"
)
Expand All @@ -274,14 +274,14 @@ def _build_osv(cls):
rcfile = system_base_config.rcfile
items = cls._get_base_cols()
arch += '<page string="Odoo">'
arch += '<separator string="%s" colspan="4"/>' % _escape(rcfile)
arch += f'<separator string="{_escape(rcfile)}" colspan="4"/>'
arch += cls._group(items)
arch += '<separator colspan="4"/></page>'

arch += '<page string="Environment based configurations">'
for section in sorted(serv_config.sections()):
items = cls._get_env_cols(sections=[section])
arch += '<separator string="[%s]" colspan="4"/>' % _escape(section)
arch += f'<separator string="[{_escape(section)}]" colspan="4"/>'
arch += cls._group(items)
arch += '<separator colspan="4"/></page>'

Expand Down
4 changes: 2 additions & 2 deletions server_environment/system_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ def _get_output(cmd):
def get_server_environment():
# inspired by server/bin/service/web_services.py
try:
rev_id = "git:%s" % _get_output("git rev-parse HEAD")
rev_id = "git:{}".format(_get_output("git rev-parse HEAD"))
except Exception:
try:
rev_id = "bzr: %s" % _get_output("bzr revision-info")
rev_id = "bzr: {}".format(_get_output("bzr revision-info"))
except Exception:
rev_id = "Can not retrieve revison from git or bzr"

Expand Down

0 comments on commit b74fd95

Please sign in to comment.