Compare commits

...

27 commits

Author SHA256 Message Date
04b85c0250 bump: version 1.0.0rc3 → 1.0.0 2026-06-21 17:26:44 +02:00
e23a7e6c4b fix: rougail dependencies 2026-06-21 17:26:30 +02:00
e0a3cdd7a4 fix: black 2026-06-21 17:07:53 +02:00
80eecbc4f4 bump: version 1.0.0rc2 → 1.0.0rc3 2026-06-21 14:46:14 +02:00
9cca9a7443 fix: update tests 2026-06-21 14:45:56 +02:00
1496210928 bump: version 1.0.0rc1 → 1.0.0rc2 2026-06-18 07:48:47 +02:00
c5757e0824 fix: dependencies 2026-06-18 07:48:39 +02:00
fcbc9e295f bump: version 1.0.0rc0 → 1.0.0rc1 2026-06-18 07:47:19 +02:00
e876e90d5c fix: dependencies 2026-06-18 07:47:01 +02:00
6d97d4810e bump: version 0.1.0a7 → 1.0.0rc0 2026-06-16 08:30:00 +02:00
c99ec4dc66 bump: version 0.1.0a6 → 0.1.0a7 2026-06-12 22:37:37 +02:00
04adac7b7a fix: add allow_unknown option 2026-06-12 22:37:26 +02:00
6a36d31c83 bump: version 0.1.0a5 → 0.1.0a6 2026-05-04 13:36:44 +02:00
3b79ff479a feat: multi layers 2026-05-04 11:15:17 +02:00
c006dea8c8 bump: version 0.1.0a4 → 0.1.0a5 2026-01-21 08:58:59 +01:00
8506ec673b fix: update tests 2026-01-20 12:38:25 +01:00
7efcca3fb8 bump: version 0.1.0a3 → 0.1.0a4 2025-12-30 10:48:18 +01:00
0f292ce0be fix: update tests 2025-12-29 17:59:20 +01:00
9f01a4ce15 bump: version 0.1.0a2 → 0.1.0a3 2025-11-21 08:01:05 +01:00
c98c06c7ff fix: ExtentionError => ExtensionError 2025-11-21 08:00:57 +01:00
6419cba45a bump: version 0.1.0a1 → 0.1.0a2 2025-11-06 06:26:29 +01:00
5d59a183ff fix: update tests 2025-11-05 21:36:02 +01:00
25b7d09f82 bump: version 0.1.0a0 → 0.1.0a1 2025-10-10 08:11:42 +02:00
23336b708c fix: remove print 2025-10-10 08:06:35 +02:00
2bc6664c83 feat: add tests 2025-10-07 20:54:52 +02:00
4346d57dde bump: version 0.0.0 → 0.1.0a0 2025-10-06 21:15:45 +02:00
faeeab7e62 feat: first version 2025-10-06 21:15:35 +02:00
1824 changed files with 11983 additions and 0 deletions

21
CHANGELOG.md Normal file
View file

@ -0,0 +1,21 @@
## 1.0.0 (2026-06-21)
### Feat
- multi layers
- add tests
- first version
### Fix
- rougail dependencies
- black
- update tests
- dependencies
- dependencies
- add allow_unknown option
- update tests
- update tests
- ExtentionError => ExtensionError
- update tests
- remove print

0
README.fr.md Normal file
View file

View file

@ -0,0 +1,25 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2026-06-12 19:57+0200\n"
"PO-Revision-Date: 2026-06-12 19:58+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 3.9\n"
#: src/rougail/user_data_commandline/__init__.py:52
msgid "\"commandline\" is not set in step.user_data"
msgstr "\"commandline\" n'est pas défini dans step.user_data"
#: src/rougail/user_data_commandline/__init__.py:82
msgid "the command line"
msgstr "la ligne de commande"

View file

@ -0,0 +1,25 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2026-06-12 22:02+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
#: src/rougail/user_data_commandline/__init__.py:52
msgid "\"commandline\" is not set in step.user_data"
msgstr ""
#: src/rougail/user_data_commandline/__init__.py:82
msgid "the command line"
msgstr ""

44
pyproject.toml Normal file
View file

@ -0,0 +1,44 @@
[build-system]
build-backend = "flit_core.buildapi"
requires = ["flit_core >=3.8.0,<4"]
[project]
name = "rougail.user_data_commandline"
version = "1.0.0"
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
readme = "README.md"
description = "Rougail user_data Bitwarden"
requires-python = ">=3.8"
license = {file = "LICENSE"}
classifiers = [
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
"Programming Language :: Python",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
"Natural Language :: English",
"Natural Language :: French",
]
dependencies = [
"rougail >= 1.2.0,<2",
"tiramisu_cmdline_parser >= 1.0.0,<2",
]
[project.urls]
Home = "https://forge.cloud.silique.fr/stove/rougail-user-data-commandline"
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "$version"
version_scheme = "pep440"
version_provider = "pep621"
version_files = [
"src/rougail/user_data_commandline/__version__.py",
"pyproject.toml:version"
]
update_changelog_on_bump = true
changelog_merge_prerelease = true

View file

@ -0,0 +1,93 @@
"""
Silique (https://www.silique.fr)
Copyright (C) 2025-2026
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from argparse import ArgumentError
from tiramisu_cmdline_parser import TiramisuCmdlineParser
from rougail.error import ExtensionError
from .i18n import _
from .__version__ import __version__
class RougailUserDataCommandline:
"""Load parameter for commande line"""
def __init__(
self,
config: "Config",
*,
rougailconfig: "RougailConfig" = None,
arguments=None,
prog=None,
allow_unknown: bool = False,
**kwargs,
):
# this is the tiramisu config object
self.config = config.config.copy().unrestraint
if rougailconfig is None:
from rougail.config import RougailConfig
rougailconfig = RougailConfig
user_data = rougailconfig["step.user_data"]
if "commandline" not in user_data:
user_data.append("commandline")
rougailconfig["step.user_data"] = user_data
user_data = rougailconfig["step.user_data"]
if "commandline" not in user_data:
raise ExtensionError(_('"commandline" is not set in step.user_data'))
self.rougailconfig = rougailconfig
self.arguments = arguments
self.errors = []
self.warnings = []
self.allow_unknown = allow_unknown
self.parser = TiramisuCmdlineParser(
self.config, prog=prog, exit_on_error=False, **kwargs
)
def run(self):
try:
if self.allow_unknown:
self.parser.parse_known_args(self.arguments, valid_mandatory=False)
else:
self.parser.parse_args(self.arguments, valid_mandatory=False)
except ArgumentError as err:
self.errors.append(str(err))
values = {}
for key in self.config.value.exportation():
option = self.config.option(key)
if not option.isfollower():
values[key] = self.config.option(key).value.get()
else:
values[key] = [
self.config.option(key, index).value.get()
for index in range(option.value.len())
]
return [
{
"source": _("the command line"),
"errors": self.errors,
"warnings": self.warnings,
"values": values,
}
]
RougailUserData = RougailUserDataCommandline
__all__ = ("RougailUserDataCommandline",)

View file

@ -0,0 +1 @@
__version__ = "1.0.0"

View file

@ -0,0 +1,33 @@
"""
Silique (https://www.silique.fr)
Copyright (C) 2025-2026
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
def get_rougail_config(
*,
backward_compatibility: bool = True, # pylint: disable=unused-argument
) -> dict:
"""get rougail config for commandline"""
return {
"name": "commandline",
"process": "user data",
"level": 55,
}
__all__ = ("get_rougail_config",)

View file

@ -0,0 +1,28 @@
"""Internationalisation utilities
Silique (https://www.silique.fr)
Copyright (C) 2025-2026
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from gettext import translation
from pathlib import Path
t = translation(
"rougail_user_data_commandline",
str(Path(__file__).parent / "locale"),
fallback=True,
)
_ = t.gettext

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
{}

View file

@ -0,0 +1 @@
{}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1 @@
{}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
[
"--rougail.version",
"string1"
]

View file

@ -0,0 +1,4 @@
[
"--rougail.version",
"string1"
]

View file

@ -0,0 +1,3 @@
{
"rougail.version": "string1"
}

View file

@ -0,0 +1,3 @@
{
"rougail.version": "string1"
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
[
"--rougail.empty",
"string1"
]

View file

@ -0,0 +1,4 @@
[
"--rougail.empty",
"string1"
]

View file

@ -0,0 +1,3 @@
{
"rougail.empty": "string1"
}

View file

@ -0,0 +1,3 @@
{
"rougail.empty": "string1"
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,8 @@
[
"--rougail.var1",
"string1",
"--rougail.var2",
"string1",
"string2",
"string3"
]

View file

@ -0,0 +1,8 @@
{
"rougail.var1": "string1",
"rougail.var2": [
"string1",
"string2",
"string3"
]
}

View file

@ -0,0 +1,6 @@
{
"rougail.var1": "no",
"rougail.var2": [
"no"
]
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,10 @@
[
"--rougail.var1",
"string1",
"string2",
"string3",
"--rougail.var2",
"string1",
"string2",
"string3"
]

View file

@ -0,0 +1,12 @@
{
"rougail.var1": [
"string1",
"string2",
"string3"
],
"rougail.var2": [
"string1",
"string2",
"string3"
]
}

View file

@ -0,0 +1,12 @@
{
"rougail.var1": [
"no",
"yes",
"maybe"
],
"rougail.var2": [
"no",
"yes",
"maybe"
]
}

View file

@ -0,0 +1,11 @@
{
"errors": [],
"warnings": [
[
"family \"leadership\" has property hidden, so cannot access to \"var1\" (a first variable), it will be ignored when loading from the command line"
],
[
"family \"leadership\" is hidden, \"var2\" (a first variable) at index \"0\", it will be ignored when loading from the command line"
]
]
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,14 @@
[
"--rougail.leadership.var1",
"string1",
"string2",
"string3",
"--rougail.leadership.var2",
"0",
"string1",
"--rougail.leadership.var2",
"0",
"string1",
"--rougail.var2",
"string1"
]

View file

@ -0,0 +1,9 @@
{
"rougail.leadership.var1": [
{
"rougail.leadership.var1": "a_value",
"rougail.leadership.var2": "a_value"
}
],
"rougail.var2": "string1"
}

View file

@ -0,0 +1,9 @@
{
"rougail.leadership.var1": [
{
"rougail.leadership.var1": "a_value",
"rougail.leadership.var2": "a_value"
}
],
"rougail.var2": "a_value"
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,8 @@
[
"--rougail.var1",
"domain1.lan",
"domain2.lan",
"--rougail.var2",
"domain1.lan",
"domain2.lan"
]

View file

@ -0,0 +1,5 @@
[
"--rougail.var1",
"domain1.lan",
"domain2.lan"
]

View file

@ -0,0 +1,10 @@
{
"rougail.var1": [
"domain1.lan",
"domain2.lan"
],
"rougail.var2": [
"domain1.lan",
"domain2.lan"
]
}

View file

@ -0,0 +1,10 @@
{
"rougail.var1": [
"domain1.lan",
"domain2.lan"
],
"rougail.var2": [
"domain1.lan",
"domain2.lan"
]
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,6 @@
[
"--rougail.var1",
"string1",
"--rougail.var2",
"string1"
]

View file

@ -0,0 +1,4 @@
[
"--rougail.var1",
"string1"
]

View file

@ -0,0 +1,4 @@
{
"rougail.var1": "string1",
"rougail.var2": "string1"
}

View file

@ -0,0 +1,4 @@
{
"rougail.var1": "string1",
"rougail.var2": "string1"
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,8 @@
[
"--rougail.var1",
"string1",
"--rougail.var2",
"string1",
"--rougail.var3",
"string1"
]

View file

@ -0,0 +1,6 @@
[
"--rougail.var1",
"string1",
"--rougail.var3",
"string1"
]

View file

@ -0,0 +1,5 @@
{
"rougail.var1": "string1",
"rougail.var2": "string1",
"rougail.var3": "string1"
}

View file

@ -0,0 +1,5 @@
{
"rougail.var1": "string1",
"rougail.var2": "string1",
"rougail.var3": "string1"
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,8 @@
[
"--rougail.var1",
"domain1.lan",
"domain2.lan",
"--rougail.var2",
"domain1.lan",
"domain2.lan"
]

View file

@ -0,0 +1,5 @@
[
"--rougail.var1",
"domain1.lan",
"domain2.lan"
]

View file

@ -0,0 +1,10 @@
{
"rougail.var1": [
"domain1.lan",
"domain2.lan"
],
"rougail.var2": [
"domain1.lan",
"domain2.lan"
]
}

View file

@ -0,0 +1,10 @@
{
"rougail.var1": [
"domain1.lan",
"domain2.lan"
],
"rougail.var2": [
"domain1.lan",
"domain2.lan"
]
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,6 @@
[
"--rougail.var1",
"string1",
"--rougail.var2",
"string1"
]

View file

@ -0,0 +1,6 @@
[
"--rougail.var1",
"string1",
"--rougail.var2",
"string1"
]

View file

@ -0,0 +1,4 @@
{
"rougail.var1": "string1",
"rougail.var2": "string1"
}

View file

@ -0,0 +1,4 @@
{
"rougail.var1": "string1",
"rougail.var2": "string1"
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
[
"--rougail.without_type",
"string1"
]

View file

@ -0,0 +1,3 @@
{
"rougail.without_type": "string1"
}

View file

@ -0,0 +1,3 @@
{
"rougail.without_type": "non"
}

Some files were not shown because too many files have changed in this diff Show more