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 4, 2024
1 parent ed3bef2 commit 8aa5fbb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions server_environment/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down Expand Up @@ -225,7 +225,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-env/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 <https://github.com/OCA/server-env/issues/new?body=module:%20server_environment%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/server-env/issues/new?body=module:%20server_environment%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand Down Expand Up @@ -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 <https://github.com/OCA/server-env/tree/17.0/server_environment>`_ project on GitHub.
This module is part of the `OCA/server-env <https://github.com/OCA/server-env/tree/18.0/server_environment>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
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
6 changes: 3 additions & 3 deletions server_environment/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ <h1 class="title">server configuration environment files</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:261183b349b7fa17e4c205c3cda8bf4b06e629c65d04ad4b7bfd105901c60da9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-env/tree/17.0/server_environment"><img alt="OCA/server-env" src="https://img.shields.io/badge/github-OCA%2Fserver--env-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-env-17-0/server-env-17-0-server_environment"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-env&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-env/tree/18.0/server_environment"><img alt="OCA/server-env" src="https://img.shields.io/badge/github-OCA%2Fserver--env-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-env-18-0/server-env-18-0-server_environment"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-env&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>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
Expand Down Expand Up @@ -555,7 +555,7 @@ <h1><a class="toc-backref" href="#toc-entry-9">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-env/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/server-env/issues/new?body=module:%20server_environment%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/server-env/issues/new?body=module:%20server_environment%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -592,7 +592,7 @@ <h2><a class="toc-backref" href="#toc-entry-13">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-env/tree/17.0/server_environment">OCA/server-env</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-env/tree/18.0/server_environment">OCA/server-env</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
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 8aa5fbb

Please sign in to comment.