rougail.output_table 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,12 @@
1
+ ## 0.1.0 (2026-06-21)
2
+
3
+ ### Feat
4
+
5
+ - github: enter in table is <br/>
6
+ - first version
7
+
8
+ ### Fix
9
+
10
+ - rougail dependencies
11
+ - black
12
+ - without namespace
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
@@ -0,0 +1,44 @@
1
+ Metadata-Version: 2.4
2
+ Name: rougail.output_table
3
+ Version: 0.1.0
4
+ Summary: Rougail output table
5
+ Author-email: Emmanuel Garette <gnunux@gnunux.info>
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
8
+ Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
9
+ Classifier: Programming Language :: Python
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Programming Language :: Python :: 3.14
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Natural Language :: English
17
+ Classifier: Natural Language :: French
18
+ License-File: LICENSE
19
+ Requires-Dist: rougail-base >= 1.2.0,<2
20
+ Requires-Dist: tabulate ~= 0.10.0
21
+ Project-URL: Home, https://forge.cloud.silique.fr/stove/rougail-output-exporter
22
+
23
+ ---
24
+ gitea: none
25
+ include_toc: true
26
+ ---
27
+ [🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md)
28
+
29
+ ## Displays the data in a table
30
+
31
+ > [!NOTE]
32
+ >
33
+ > The goal is not to display all the variables in the configuration, but only a selection using the labeling mechanism.\
34
+ > **Path**: table\
35
+ > *`disabled`*\
36
+ > **Disabled**: if table is not set in "[select for output](#step.output)".
37
+
38
+ | Variable | Description | Default value | Type | Validator |
39
+ |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|
40
+ | **<a id="table.first_column" name="table.first_column">table.first_column</a>**<br/>**Command line**: <br/>--table.first_column<br/>**Environment variable**: ROUGAILCLI_TABLE.FIRST_COLUMN | Content of the first column. | First column is description if "[Tag names](#table.columns)" has only one value, otherwise it's namespace. | [`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Tag name must not have the same name has first column.<br/>**Choices**: <br/>•&nbsp;description<br/>•&nbsp;namespace |
41
+ | **<a id="table.columns" name="table.columns">table.columns</a>**<br/>**Command line**: <br/>--table.columns<br/>**Environment variable**: ROUGAILCLI_TABLE.COLUMNS | Tag names.<br/>Each tag creates a column. The content of the columns comes from the variables with the defined tags. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` `mandatory` | `unique` |
42
+ | **<a id="table.output_format" name="table.output_format">table.output_format</a>**<br/>**Command line**: <br/>--table.output_format<br/>**Environment variable**: ROUGAILCLI_TABLE.OUTPUT_FORMAT | Tag names. | console | [`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | **Choices**: <br/>•&nbsp;console<br/>•&nbsp;github<br/>•&nbsp;asciidoc<br/>•&nbsp;html<br/>•&nbsp;rst |
43
+ | **<a id="table.header" name="table.header">table.header</a>**<br/>**Command line**: <br/>•&nbsp;--table.header<br/>•&nbsp;--table.no-header<br/>**Environment variable**: ROUGAILCLI_TABLE.HEADER | Add header in table. | true | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | |
44
+
@@ -0,0 +1,21 @@
1
+ ---
2
+ gitea: none
3
+ include_toc: true
4
+ ---
5
+ [🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md)
6
+
7
+ ## Affiche les données dans un tableau
8
+
9
+ > [!NOTE]
10
+ >
11
+ > L'objectif n'est pas d'afficher toutes les variables de la configuration, mais seulement une sélection à l'aide du mécanisme d'étiquetage.\
12
+ > **Chemin** : table\
13
+ > *`désactivé`*\
14
+ > **Désactivé** : si table n'est pas mis dans "[sélection pour sortie](#step.output)".
15
+
16
+ | Variable | Description | Valeur par défaut | Type | Validateur |
17
+ |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|
18
+ | **<a id="table.first_column" name="table.first_column">table.first_column</a>**<br/>**Ligne de commande** : <br/>--table.first_column<br/>**Variable d'environnement** : ROUGAILCLI_TABLE.FIRST_COLUMN | Contenu de la première colonne. | La première colonne est description si "[Noms des étiquettes](#table.columns)" n'a qu'une valeur, sinon c'est namespace. | [`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | Le nom de l'étiquette ne doit pas avoir le même nom que la première colonne.<br/>**Choix** : <br/>•&nbsp;description<br/>•&nbsp;namespace |
19
+ | **<a id="table.columns" name="table.columns">table.columns</a>**<br/>**Ligne de commande** : <br/>--table.columns<br/>**Variable d'environnement** : ROUGAILCLI_TABLE.COLUMNS | Noms des étiquettes.<br/>Chaque étiquette créée une colonne. Le contenu des colonnes viennent des variables avec les étiquettes définis. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` `obligatoire` | `unique` |
20
+ | **<a id="table.output_format" name="table.output_format">table.output_format</a>**<br/>**Ligne de commande** : <br/>--table.output_format<br/>**Variable d'environnement** : ROUGAILCLI_TABLE.OUTPUT_FORMAT | Noms des étiquettes. | console | [`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | **Choix** : <br/>•&nbsp;console<br/>•&nbsp;github<br/>•&nbsp;asciidoc<br/>•&nbsp;html<br/>•&nbsp;rst |
21
+ | **<a id="table.header" name="table.header">table.header</a>**<br/>**Ligne de commande** : <br/>•&nbsp;--table.header<br/>•&nbsp;--table.no-header<br/>**Variable d'environnement** : ROUGAILCLI_TABLE.HEADER | Ajouter l&#x27;entête dans le tableau. | true | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | |
@@ -0,0 +1,21 @@
1
+ ---
2
+ gitea: none
3
+ include_toc: true
4
+ ---
5
+ [🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md)
6
+
7
+ ## Displays the data in a table
8
+
9
+ > [!NOTE]
10
+ >
11
+ > The goal is not to display all the variables in the configuration, but only a selection using the labeling mechanism.\
12
+ > **Path**: table\
13
+ > *`disabled`*\
14
+ > **Disabled**: if table is not set in "[select for output](#step.output)".
15
+
16
+ | Variable | Description | Default value | Type | Validator |
17
+ |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|
18
+ | **<a id="table.first_column" name="table.first_column">table.first_column</a>**<br/>**Command line**: <br/>--table.first_column<br/>**Environment variable**: ROUGAILCLI_TABLE.FIRST_COLUMN | Content of the first column. | First column is description if "[Tag names](#table.columns)" has only one value, otherwise it's namespace. | [`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Tag name must not have the same name has first column.<br/>**Choices**: <br/>•&nbsp;description<br/>•&nbsp;namespace |
19
+ | **<a id="table.columns" name="table.columns">table.columns</a>**<br/>**Command line**: <br/>--table.columns<br/>**Environment variable**: ROUGAILCLI_TABLE.COLUMNS | Tag names.<br/>Each tag creates a column. The content of the columns comes from the variables with the defined tags. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` `mandatory` | `unique` |
20
+ | **<a id="table.output_format" name="table.output_format">table.output_format</a>**<br/>**Command line**: <br/>--table.output_format<br/>**Environment variable**: ROUGAILCLI_TABLE.OUTPUT_FORMAT | Tag names. | console | [`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | **Choices**: <br/>•&nbsp;console<br/>•&nbsp;github<br/>•&nbsp;asciidoc<br/>•&nbsp;html<br/>•&nbsp;rst |
21
+ | **<a id="table.header" name="table.header">table.header</a>**<br/>**Command line**: <br/>•&nbsp;--table.header<br/>•&nbsp;--table.no-header<br/>**Environment variable**: ROUGAILCLI_TABLE.HEADER | Add header in table. | true | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | |
@@ -0,0 +1,70 @@
1
+ # SOME DESCRIPTIVE TITLE.
2
+ # Copyright (C) YEAR ORGANIZATION
3
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4
+ #
5
+ msgid ""
6
+ msgstr ""
7
+ "Project-Id-Version: \n"
8
+ "POT-Creation-Date: 2025-12-21 21:58+0100\n"
9
+ "PO-Revision-Date: 2025-12-21 22:00+0100\n"
10
+ "Last-Translator: \n"
11
+ "Language-Team: \n"
12
+ "Language: fr\n"
13
+ "MIME-Version: 1.0\n"
14
+ "Content-Type: text/plain; charset=UTF-8\n"
15
+ "Content-Transfer-Encoding: 8bit\n"
16
+ "Generated-By: pygettext.py 1.5\n"
17
+ "X-Generator: Poedit 3.8\n"
18
+
19
+ #: src/rougail/output_table/__init__.py:55
20
+ msgid "the \"step.output\" is not set to \"{0}\""
21
+ msgstr "\"step.output\" n'est pas mis à \"{0}\""
22
+
23
+ #: src/rougail/output_table/config.py:28
24
+ msgid "Displays the data in a table"
25
+ msgstr "Affiche les données dans un tableau"
26
+
27
+ #: src/rougail/output_table/config.py:29
28
+ msgid ""
29
+ "The goal is not to display all the variables in the configuration, but only "
30
+ "a selection using the labeling mechanism."
31
+ msgstr ""
32
+ "L'objectif n'est pas d'afficher toutes les variables de la configuration, "
33
+ "mais seulement une sélection à l'aide du mécanisme d'étiquetage."
34
+
35
+ #: src/rougail/output_table/config.py:34
36
+ msgid "if table is not set in \"step.output\""
37
+ msgstr "si table n'est pas mis dans \"step.output\""
38
+
39
+ #: src/rougail/output_table/config.py:37
40
+ msgid "Content of the first column"
41
+ msgstr "Contenu de la première colonne"
42
+
43
+ #: src/rougail/output_table/config.py:48
44
+ msgid ""
45
+ "First column is description if \"_.columns\" has only one value, otherwise "
46
+ "it's namespace"
47
+ msgstr ""
48
+ "La première colonne est description si \"_.columns\" n'a qu'une valeur, "
49
+ "sinon c'est namespace"
50
+
51
+ #: src/rougail/output_table/config.py:53
52
+ msgid "Tag name must not have the same name has first column"
53
+ msgstr ""
54
+ "Le nom de l'étiquette ne doit pas avoir le même nom que la première colonne"
55
+
56
+ #: src/rougail/output_table/config.py:56 src/rougail/output_table/config.py:61
57
+ msgid "Tag names"
58
+ msgstr "Noms des étiquettes"
59
+
60
+ #: src/rougail/output_table/config.py:57
61
+ msgid ""
62
+ "Each tag creates a column. The content of the columns comes from the "
63
+ "variables with the defined tags."
64
+ msgstr ""
65
+ "Chaque étiquette créée une colonne. Le contenu des colonnes viennent des "
66
+ "variables avec les étiquettes définis."
67
+
68
+ #: src/rougail/output_table/config.py:70
69
+ msgid "Add header in table"
70
+ msgstr "Ajouter l'entête dans le tableau"
@@ -0,0 +1,57 @@
1
+ # SOME DESCRIPTIVE TITLE.
2
+ # Copyright (C) YEAR ORGANIZATION
3
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4
+ #
5
+ msgid ""
6
+ msgstr ""
7
+ "Project-Id-Version: PACKAGE VERSION\n"
8
+ "POT-Creation-Date: 2025-12-21 22:00+0100\n"
9
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
10
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
11
+ "Language-Team: LANGUAGE <LL@li.org>\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "Generated-By: pygettext.py 1.5\n"
16
+
17
+
18
+ #: src/rougail/output_table/__init__.py:55
19
+ msgid "the \"step.output\" is not set to \"{0}\""
20
+ msgstr ""
21
+
22
+ #: src/rougail/output_table/config.py:28
23
+ msgid "Displays the data in a table"
24
+ msgstr ""
25
+
26
+ #: src/rougail/output_table/config.py:29
27
+ msgid "The goal is not to display all the variables in the configuration, but only a selection using the labeling mechanism."
28
+ msgstr ""
29
+
30
+ #: src/rougail/output_table/config.py:34
31
+ msgid "if table is not set in \"step.output\""
32
+ msgstr ""
33
+
34
+ #: src/rougail/output_table/config.py:37
35
+ msgid "Content of the first column"
36
+ msgstr ""
37
+
38
+ #: src/rougail/output_table/config.py:48
39
+ msgid "First column is description if \"_.columns\" has only one value, otherwise it's namespace"
40
+ msgstr ""
41
+
42
+ #: src/rougail/output_table/config.py:53
43
+ msgid "Tag name must not have the same name has first column"
44
+ msgstr ""
45
+
46
+ #: src/rougail/output_table/config.py:56 src/rougail/output_table/config.py:61
47
+ msgid "Tag names"
48
+ msgstr ""
49
+
50
+ #: src/rougail/output_table/config.py:57
51
+ msgid "Each tag creates a column. The content of the columns comes from the variables with the defined tags."
52
+ msgstr ""
53
+
54
+ #: src/rougail/output_table/config.py:70
55
+ msgid "Add header in table"
56
+ msgstr ""
57
+
@@ -0,0 +1,44 @@
1
+ [build-system]
2
+ build-backend = "flit_core.buildapi"
3
+ requires = ["flit_core >=3.8.0,<4"]
4
+
5
+ [project]
6
+ name = "rougail.output_table"
7
+ version = "0.1.0"
8
+ authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
9
+ readme = "README.md"
10
+ description = "Rougail output table"
11
+ requires-python = ">=3.8"
12
+ license = {file = "LICENSE"}
13
+ classifiers = [
14
+ "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
15
+ "Programming Language :: Python",
16
+ "Programming Language :: Python :: 3.11",
17
+ "Programming Language :: Python :: 3.12",
18
+ "Programming Language :: Python :: 3.13",
19
+ "Programming Language :: Python :: 3.14",
20
+ "Programming Language :: Python :: 3",
21
+ "Operating System :: OS Independent",
22
+ "Natural Language :: English",
23
+ "Natural Language :: French",
24
+
25
+ ]
26
+ dependencies = [
27
+ "rougail-base >= 1.2.0,<2",
28
+ "tabulate ~= 0.10.0",
29
+ ]
30
+
31
+ [project.urls]
32
+ Home = "https://forge.cloud.silique.fr/stove/rougail-output-exporter"
33
+
34
+ [tool.commitizen]
35
+ name = "cz_conventional_commits"
36
+ tag_format = "$version"
37
+ version_scheme = "pep440"
38
+ version_provider = "pep621"
39
+ version_files = [
40
+ "src/rougail/output_doc/__version__.py",
41
+ "pyproject.toml:version"
42
+ ]
43
+ update_changelog_on_bump = true
44
+ changelog_merge_prerelease = true
@@ -0,0 +1,154 @@
1
+ """
2
+ Silique (https://www.silique.fr)
3
+ Copyright (C) 2022-2026
4
+
5
+ This program is free software: you can redistribute it and/or modify it
6
+ under the terms of the GNU Lesser General Public License as published by the
7
+ Free Software Foundation, either version 3 of the License, or (at your
8
+ option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful, but WITHOUT
11
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12
+ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13
+ details.
14
+
15
+ You should have received a copy of the GNU Lesser General Public License
16
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ """
18
+
19
+ from typing import Optional
20
+
21
+ from tabulate import tabulate
22
+
23
+ from tiramisu import groups
24
+ from tiramisu.error import PropertiesOptionError, ConfigError
25
+ from rougail.error import ExtensionError
26
+
27
+ from .i18n import _
28
+ from .__version__ import __version__
29
+
30
+
31
+ TABULATE = {
32
+ "console": "heavy_grid",
33
+ "html": "unsafehtml",
34
+ }
35
+ ENTER = {"github": "<br/>"}
36
+
37
+
38
+ class RougailOutputTable:
39
+ output_name = "table"
40
+
41
+ def __init__(
42
+ self,
43
+ config: "Config",
44
+ *,
45
+ rougailconfig: "RougailConfig" = None,
46
+ user_data_errors: Optional[list] = None,
47
+ user_data_warnings: Optional[list] = None,
48
+ **kwargs,
49
+ ) -> None:
50
+ if rougailconfig is None:
51
+ from rougail import RougailConfig
52
+
53
+ rougailconfig = RougailConfig
54
+ rougailconfig["step.output"] = self.output_name
55
+ if rougailconfig["step.output"] != self.output_name:
56
+ raise ExtensionError(
57
+ _('the "step.output" is not set to "{0}"').format(self.output_name)
58
+ )
59
+ self.rougailconfig = rougailconfig
60
+ self.config = config
61
+ self.support_namespace = rougailconfig["main_namespace"] is not None
62
+ if user_data_errors:
63
+ self.errors = user_data_errors.copy()
64
+ else:
65
+ self.errors = []
66
+ if user_data_warnings:
67
+ self.warnings = user_data_warnings.copy()
68
+ else:
69
+ self.warnings = []
70
+ self.datas = {}
71
+
72
+ def run(self) -> None:
73
+ self.config.property.read_only()
74
+ self.output_format = self.rougailconfig["table.output_format"]
75
+ if self.output_format in TABULATE:
76
+ self.output_format = TABULATE[self.output_format]
77
+ self.columns = self.rougailconfig["table.columns"].copy()
78
+ self.first_column = self.rougailconfig["table.first_column"]
79
+ if self.first_column == "namespace":
80
+ if self.support_namespace:
81
+ self.columns.insert(0, "namespace")
82
+ else:
83
+ self.columns.insert(0, "description")
84
+ for option in self.config:
85
+ if (
86
+ self.support_namespace
87
+ and self.first_column == "namespace"
88
+ and option.group_type() is groups.namespace
89
+ ):
90
+ namespace = option.description()
91
+ else:
92
+ namespace = ""
93
+ if option.isoptiondescription():
94
+ self.walk(option, namespace)
95
+ else:
96
+ self.manage(option, namespace)
97
+ if self.rougailconfig["table.header"]:
98
+ headers = tuple([col.capitalize() for col in self.columns])
99
+ else:
100
+ headers = ()
101
+ if self.datas:
102
+ datas = []
103
+ for data in self.datas.values():
104
+ enter = ENTER.get(self.output_format, "\n")
105
+ datas.append([enter.join(data.get(col, [])) for col in self.columns])
106
+ msg = (
107
+ tabulate(
108
+ datas,
109
+ headers=headers,
110
+ tablefmt=self.output_format,
111
+ )
112
+ + "\n"
113
+ )
114
+ else:
115
+ msg = ""
116
+ return True, msg
117
+
118
+ def print(self) -> str:
119
+ ret, datas = self.run()
120
+ print(datas)
121
+ return ret
122
+
123
+ def walk(self, config, namespace):
124
+ for option in config:
125
+ self.manage(option, namespace)
126
+
127
+ def manage(self, option, namespace):
128
+ if option.isoptiondescription():
129
+ self.walk(option, namespace)
130
+ tags = option.information.get("tags", [])
131
+ if not tags:
132
+ return
133
+ for col in self.columns:
134
+ if col in tags:
135
+ value = option.value.get()
136
+ if self.first_column == "namespace":
137
+ key = namespace
138
+ else:
139
+ key = option.description()
140
+ if isinstance(value, list):
141
+ self.datas.setdefault(key, {}).setdefault(col, []).extend(
142
+ [str(val) for val in value]
143
+ )
144
+ else:
145
+ self.datas.setdefault(key, {}).setdefault(col, []).append(
146
+ str(value)
147
+ )
148
+ self.datas[key][self.first_column] = [key]
149
+
150
+
151
+ RougailOutput = RougailOutputTable
152
+
153
+
154
+ __all__ = ("RougailOutputTable",)
@@ -0,0 +1 @@
1
+ __version__ = "0.0.0"
@@ -0,0 +1,80 @@
1
+ """
2
+ Silique (https://www.silique.fr)
3
+ Copyright (C) 2025-2026
4
+
5
+ This program is free software: you can redistribute it and/or modify it
6
+ under the terms of the GNU Lesser General Public License as published by the
7
+ Free Software Foundation, either version 3 of the License, or (at your
8
+ option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful, but WITHOUT
11
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12
+ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13
+ details.
14
+
15
+ You should have received a copy of the GNU Lesser General Public License
16
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ """
18
+
19
+ from .i18n import _
20
+
21
+
22
+ def get_rougail_config(
23
+ *,
24
+ backward_compatibility=True, # pylint: disable=unused-argument
25
+ ) -> dict:
26
+ rougail_options = f"""
27
+ table:
28
+ description: {_('Displays the data in a table')}
29
+ help: {_('The goal is not to display all the variables in the configuration, but only a selection using the labeling mechanism.')}
30
+ disabled:
31
+ jinja: |-
32
+ {{{{ step.output is propertyerror or step.output != 'table' }}}}
33
+ return_type: boolean
34
+ description: {_('if table is not set in "step.output"')}
35
+
36
+ first_column:
37
+ description: {_("Content of the first column")}
38
+ choices:
39
+ - description
40
+ - namespace
41
+ default:
42
+ jinja: |-
43
+ {{% if _.columns | length == 1 %}}
44
+ description
45
+ {{% else %}}
46
+ namespace
47
+ {{% endif %}}
48
+ description: {_('First column is description if "_.columns" has only one value, otherwise it\'s namespace')}
49
+ validators:
50
+ - jinja: |-
51
+ {{{{ _.first_column in _.columns }}}}
52
+ return_type: boolean
53
+ description: {_("Tag name must not have the same name has first column")}
54
+
55
+ columns:
56
+ description: {_('Tag names')}
57
+ help: {_('Each tag creates a column. The content of the columns comes from the variables with the defined tags.')}
58
+ multi: true
59
+
60
+ output_format:
61
+ description: {_('Tag names')}
62
+ choices:
63
+ - console
64
+ - github
65
+ - asciidoc
66
+ - html
67
+ - rst
68
+ default: console
69
+
70
+ header: true # {_("Add header in table")}
71
+ """
72
+ return {
73
+ "name": "table",
74
+ "process": "output",
75
+ "options": rougail_options,
76
+ "level": 60,
77
+ }
78
+
79
+
80
+ __all__ = ("get_rougail_config",)
@@ -0,0 +1,26 @@
1
+ """Internationalisation utilities
2
+ Silique (https://www.silique.fr)
3
+ Copyright (C) 2025-2026
4
+
5
+ This program is free software: you can redistribute it and/or modify it
6
+ under the terms of the GNU Lesser General Public License as published by the
7
+ Free Software Foundation, either version 3 of the License, or (at your
8
+ option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful, but WITHOUT
11
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12
+ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13
+ details.
14
+
15
+ You should have received a copy of the GNU Lesser General Public License
16
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ """
18
+
19
+ from gettext import translation
20
+ from pathlib import Path
21
+
22
+ t = translation(
23
+ "rougail_output_table", str(Path(__file__).parent / "locale"), fallback=True
24
+ )
25
+
26
+ _ = t.gettext