From 8aa5fbb757c828c4bd37ba2408cd775eda0ff1da Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Bidoul?=
Date: Mon, 30 Sep 2024 19:04:52 +0200
Subject: [PATCH] [IMP] pre-commit autofixes
---
server_environment/README.rst | 10 +++++-----
server_environment/models/server_env_mixin.py | 2 +-
server_environment/server_env.py | 8 ++++----
server_environment/static/description/index.html | 6 +++---
server_environment/system_info.py | 4 ++--
5 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/server_environment/README.rst b/server_environment/README.rst
index cb1578211..d252486ff 100644
--- a/server_environment/README.rst
+++ b/server_environment/README.rst
@@ -17,13 +17,13 @@ server configuration environment files
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--env-lightgray.png?logo=github
- :target: https://github.com/OCA/server-env/tree/17.0/server_environment
+ :target: https://github.com/OCA/server-env/tree/18.0/server_environment
:alt: OCA/server-env
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/server-env-17-0/server-env-17-0-server_environment
+ :target: https://translation.odoo-community.org/projects/server-env-18-0/server-env-18-0-server_environment
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
- :target: https://runboat.odoo-community.org/builds?repo=OCA/server-env&target_branch=17.0
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/server-env&target_branch=18.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -225,7 +225,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -266,6 +266,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-This module is part of the `OCA/server-env `_ project on GitHub.
+This module is part of the `OCA/server-env `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/server_environment/models/server_env_mixin.py b/server_environment/models/server_env_mixin.py
index b49c35974..0d28e0356 100644
--- a/server_environment/models/server_env_mixin.py
+++ b/server_environment/models/server_env_mixin.py
@@ -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
)
diff --git a/server_environment/server_env.py b/server_environment/server_env.py
index 4eb016f3a..f18c0312d 100644
--- a/server_environment/server_env.py
+++ b/server_environment/server_env.py
@@ -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}"
)
@@ -260,7 +260,7 @@ def _group(cls, items):
return (
''
+ "".join(
- ['' % _escape(name) for name in names]
+ [f'' for name in names]
)
+ ""
)
@@ -274,14 +274,14 @@ def _build_osv(cls):
rcfile = system_base_config.rcfile
items = cls._get_base_cols()
arch += ''
- arch += '' % _escape(rcfile)
+ arch += f''
arch += cls._group(items)
arch += ''
arch += ''
for section in sorted(serv_config.sections()):
items = cls._get_env_cols(sections=[section])
- arch += '' % _escape(section)
+ arch += f''
arch += cls._group(items)
arch += ''
diff --git a/server_environment/static/description/index.html b/server_environment/static/description/index.html
index 1a5372735..2335c8676 100644
--- a/server_environment/static/description/index.html
+++ b/server_environment/static/description/index.html
@@ -369,7 +369,7 @@ server configuration environment files
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:261183b349b7fa17e4c205c3cda8bf4b06e629c65d04ad4b7bfd105901c60da9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
+
This module provides a way to define an environment in the main Odoo
configuration file and to read some configurations from files depending
on the configured environment: you define the environment in the main
@@ -555,7 +555,7 @@
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
+feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -592,7 +592,7 @@
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-
This module is part of the OCA/server-env project on GitHub.
+
This module is part of the OCA/server-env project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/server_environment/system_info.py b/server_environment/system_info.py
index 9b303e849..272d753e7 100644
--- a/server_environment/system_info.py
+++ b/server_environment/system_info.py
@@ -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"