From 00c93906335147d5687801ce99d0d554822cb394 Mon Sep 17 00:00:00 2001 From: Khoi Vo Date: Mon, 7 Oct 2024 15:48:52 +0700 Subject: [PATCH] [IMP] mail_inline_css: pre-commit auto fixes --- mail_inline_css/README.rst | 44 +++++++++++-------- mail_inline_css/models/mail_template.py | 2 +- mail_inline_css/pyproject.toml | 3 ++ mail_inline_css/readme/CONTRIBUTORS.md | 13 ++++++ mail_inline_css/readme/CONTRIBUTORS.rst | 8 ---- .../readme/{CREDITS.rst => CREDITS.md} | 3 +- .../{DESCRIPTION.rst => DESCRIPTION.md} | 4 +- mail_inline_css/static/description/index.html | 24 +++++----- .../tests/test_mail_inline_styles.py | 2 +- 9 files changed, 61 insertions(+), 42 deletions(-) create mode 100644 mail_inline_css/pyproject.toml create mode 100644 mail_inline_css/readme/CONTRIBUTORS.md delete mode 100644 mail_inline_css/readme/CONTRIBUTORS.rst rename mail_inline_css/readme/{CREDITS.rst => CREDITS.md} (73%) rename mail_inline_css/readme/{DESCRIPTION.rst => DESCRIPTION.md} (63%) diff --git a/mail_inline_css/README.rst b/mail_inline_css/README.rst index d05d1229..ddb3647e 100644 --- a/mail_inline_css/README.rst +++ b/mail_inline_css/README.rst @@ -17,21 +17,21 @@ Mail Inline CSS :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github - :target: https://github.com/OCA/social/tree/16.0/mail_inline_css + :target: https://github.com/OCA/social/tree/18.0/mail_inline_css :alt: OCA/social .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mail_inline_css + :target: https://translation.odoo-community.org/projects/social-18-0/social-18-0-mail_inline_css :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/social&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/social&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| Convert styles to inline styles and make them play nice with emails. -This module sole usage is to provide the same parsing functionality as in -the web editor but for the templates imported directly in database. +This module sole usage is to provide the same parsing functionality as +in the web editor but for the templates imported directly in database. **Table of contents** @@ -44,7 +44,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. @@ -52,30 +52,36 @@ Credits ======= Authors -~~~~~~~ +------- * Akretion * camptocamp Contributors -~~~~~~~~~~~~ +------------ -* David BEAL -* Akim Juillerat -* Simone Orsi -* Patrick Tombez -* Phuc Tran Thanh -* `Trobz `_: +- David BEAL - * Son Ho +- Akim Juillerat + +- Simone Orsi + +- Patrick Tombez + +- Phuc Tran Thanh + +- `Trobz `__: + + - Son Ho Other credits -~~~~~~~~~~~~~ +------------- -The migration of this module from 15.0 to 16.0 was financially supported by Camptocamp +The migration of this module from 15.0 to 16.0 was financially supported +by Camptocamp Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -87,6 +93,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/social `_ project on GitHub. +This module is part of the `OCA/social `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mail_inline_css/models/mail_template.py b/mail_inline_css/models/mail_template.py index f31703a2..96fa7862 100644 --- a/mail_inline_css/models/mail_template.py +++ b/mail_inline_css/models/mail_template.py @@ -7,7 +7,7 @@ try: from premailer import Premailer -except (ImportError, IOError) as err: # pragma: no cover +except (OSError, ImportError) as err: # pragma: no cover import logging _logger = logging.getLogger(__name__) diff --git a/mail_inline_css/pyproject.toml b/mail_inline_css/pyproject.toml new file mode 100644 index 00000000..4231d0cc --- /dev/null +++ b/mail_inline_css/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/mail_inline_css/readme/CONTRIBUTORS.md b/mail_inline_css/readme/CONTRIBUTORS.md new file mode 100644 index 00000000..04e458cf --- /dev/null +++ b/mail_inline_css/readme/CONTRIBUTORS.md @@ -0,0 +1,13 @@ +- David BEAL \<\> + +- Akim Juillerat \<\> + +- Simone Orsi \<\> + +- Patrick Tombez \<\> + +- Phuc Tran Thanh \<\> + +- [Trobz](https://trobz.com): + + > - Son Ho \<\> diff --git a/mail_inline_css/readme/CONTRIBUTORS.rst b/mail_inline_css/readme/CONTRIBUTORS.rst deleted file mode 100644 index 76100846..00000000 --- a/mail_inline_css/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,8 +0,0 @@ -* David BEAL -* Akim Juillerat -* Simone Orsi -* Patrick Tombez -* Phuc Tran Thanh -* `Trobz `_: - - * Son Ho diff --git a/mail_inline_css/readme/CREDITS.rst b/mail_inline_css/readme/CREDITS.md similarity index 73% rename from mail_inline_css/readme/CREDITS.rst rename to mail_inline_css/readme/CREDITS.md index 70bc307a..291e14c8 100644 --- a/mail_inline_css/readme/CREDITS.rst +++ b/mail_inline_css/readme/CREDITS.md @@ -1 +1,2 @@ -The migration of this module from 15.0 to 16.0 was financially supported by Camptocamp +The migration of this module from 15.0 to 16.0 was financially supported +by Camptocamp diff --git a/mail_inline_css/readme/DESCRIPTION.rst b/mail_inline_css/readme/DESCRIPTION.md similarity index 63% rename from mail_inline_css/readme/DESCRIPTION.rst rename to mail_inline_css/readme/DESCRIPTION.md index 30957362..16543a80 100644 --- a/mail_inline_css/readme/DESCRIPTION.rst +++ b/mail_inline_css/readme/DESCRIPTION.md @@ -1,4 +1,4 @@ Convert styles to inline styles and make them play nice with emails. -This module sole usage is to provide the same parsing functionality as in -the web editor but for the templates imported directly in database. +This module sole usage is to provide the same parsing functionality as +in the web editor but for the templates imported directly in database. diff --git a/mail_inline_css/static/description/index.html b/mail_inline_css/static/description/index.html index 5fc54920..09745d66 100644 --- a/mail_inline_css/static/description/index.html +++ b/mail_inline_css/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -368,10 +369,10 @@

Mail Inline CSS

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:e3cd02099a2beb9db6980920f3d0547a5154e4a386f2f3e3bf189342a85a2110 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/social Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/social Translate me on Weblate Try me on Runboat

Convert styles to inline styles and make them play nice with emails.

-

This module sole usage is to provide the same parsing functionality as in -the web editor but for the templates imported directly in database.

+

This module sole usage is to provide the same parsing functionality as +in the web editor but for the templates imported directly in database.

Table of contents

    @@ -390,7 +391,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.

@@ -426,16 +427,19 @@

Contributors

Other credits

-

The migration of this module from 15.0 to 16.0 was financially supported by Camptocamp

+

The migration of this module from 15.0 to 16.0 was financially supported +by Camptocamp

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

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/social project on GitHub.

+

This module is part of the OCA/social project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/mail_inline_css/tests/test_mail_inline_styles.py b/mail_inline_css/tests/test_mail_inline_styles.py index e518d75d..09e1598e 100644 --- a/mail_inline_css/tests/test_mail_inline_styles.py +++ b/mail_inline_css/tests/test_mail_inline_styles.py @@ -24,7 +24,7 @@ def parse_node_style(self, node): return res def find_by_id(self, node, html_id): - return node.xpath('//*[@id="{}"]'.format(html_id)) + return node.xpath(f'//*[@id="{html_id}"]') def assertNodeStyle(self, node, expected): self.assertIn("style", node.attrib)