Compare commits

..

No commits in common. "15a545395ea6beb50d432bb83c5f84f86ffc8512" and "998d84863bfcb7d049d9baea97e8b0d462f2b0b6" have entirely different histories.

10 changed files with 18 additions and 189 deletions

View file

@ -1,9 +0,0 @@
## 0.1.0rc0 (2024-10-31)
### Feat
- improvemnt + translation
### Fix
- remove extra options in commandline parser

View file

@ -2,7 +2,6 @@
import re import re
import sys import sys
from rougail.cli.__main__ import main from rougail.cli.__main__ import main
if __name__ == '__main__': if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main()) sys.exit(main())

Binary file not shown.

View file

@ -1,29 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2024-10-31 09:57+0100\n"
"PO-Revision-Date: 2024-10-31 10:00+0100\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.5\n"
#: src/rougail/cli/__main__.py:43
msgid "cannot find \"user_data\" module \"{0}\""
msgstr "ne peut trouve le module \"user_data\" \"{0}\""
#: src/rougail/cli/__main__.py:56
msgid "cannot find cli file for \"output_name\" module \"{0}\""
msgstr "ne peut trouve le fichier cli pour le module \"output_name\" \"{0}\""
#: src/rougail/cli/__main__.py:69
msgid "ERROR: {0}"
msgstr "ERREUR : {0}"

View file

@ -1,29 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-10-31 10:00+0100\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/cli/__main__.py:43
msgid "cannot find \"user_data\" module \"{0}\""
msgstr ""
#: src/rougail/cli/__main__.py:56
msgid "cannot find cli file for \"output_name\" module \"{0}\""
msgstr ""
#: src/rougail/cli/__main__.py:69
msgid "ERROR: {0}"
msgstr ""

View file

@ -1,28 +0,0 @@
[build-system]
build-backend = "flit_core.buildapi"
requires = ["flit_core >=3.8.0,<4"]
[project]
name = "rougail.cli"
version = "0.1.0rc0"
authors = [
{name = "Emmanuel Garette", email = "gnunux@gnunux.info"},
]
readme = "README.md"
description = "CLI for Rougail"
license = {file = "LICENSE"}
classifiers = ["License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)"]
dependencies = [
"rougail ~= 1.1.0",
]
[project.urls]
Home = "https://forge.cloud.silique.fr/stove/rougail-cli"
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "$version"
version_scheme = "pep440"
version_provider = "pep621"
update_changelog_on_bump = true

View file

@ -1,18 +0,0 @@
"""
Silique (https://www.silique.fr)
Copyright (C) 2024
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Mtools 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with Mtools. If not, see <http://www.gnu.org/licenses/>.
"""

View file

@ -1,32 +1,13 @@
"""
Silique (https://www.silique.fr)
Copyright (C) 2024
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Mtools 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with Mtools. If not, see <http://www.gnu.org/licenses/>.
"""
from tiramisu_cmdline_parser import TiramisuCmdlineParser from tiramisu_cmdline_parser import TiramisuCmdlineParser
from tiramisu import Config from tiramisu import Config
from pathlib import Path from pathlib import Path
from rougail import Rougail from rougail import Rougail
from rougail.config import get_rougail_config from rougail.config import get_rougail_config
from rougail.update import RougailUpgrade
from rougail.utils import load_modules from rougail.utils import load_modules
def _main(): def main():
rougailconfig = get_rougail_config(backward_compatibility=False, add_extra_options=False) rougailconfig = get_rougail_config(backward_compatibility=False, add_extra_options=False)
cmd_config = rougailconfig.config cmd_config = rougailconfig.config
cmd_config.property.read_write() cmd_config.property.read_write()
@ -38,9 +19,6 @@ def _main():
parser.parse_args() parser.parse_args()
cmd_config.property.remove('not_for_commandline') cmd_config.property.remove('not_for_commandline')
cmd_config.property.read_only() cmd_config.property.read_only()
if rougailconfig['upgrade']:
RougailUpgrade(rougailconfig=rougailconfig).run()
return
user_data_names = rougailconfig['step.user_data'] user_data_names = rougailconfig['step.user_data']
output_name = rougailconfig['step.output'] output_name = rougailconfig['step.output']
# structural # structural
@ -54,35 +32,25 @@ def _main():
user_datas = None user_datas = None
else: else:
config.property.read_write() config.property.read_write()
user_datas = [] user_datas = {'errors': [],
'warnings': [],
}
for user_data_name in user_data_names: for user_data_name in user_data_names:
path = Path(__file__).parent.parent / ('user_data_' + user_data_name) / '__init__.py' path = Path(__file__).parent.parent / ('user_data_' + user_data_name) / 'cli.py'
if not path.is_file(): if not path.is_file():
raise Exception(_('cannot find "user_data" module "{0}"').format(user_data_name)) raise Exception(f'cannot find cli file for "user_data" module "{user_data_name}"')
module = load_modules('rougail.user_data_' + user_data_name, str(path)) module = load_modules('rougail.user_data_' + user_data_name + '.cli', str(path))
user_datas.extend(module.RougailUserData(config, module.run(rougailconfig,
rougailconfig=rougailconfig, config,
).run()) user_datas,
if user_datas: )
err_warn = rougail.user_datas(user_datas)
else:
err_warn = {'errors': [], 'warnings': []}
# output # output
config.property.read_only() config.property.read_only()
path = Path(__file__).parent.parent / ('output_' + output_name) / '__init__.py' path = Path(__file__).parent.parent / ('output_' + output_name) / 'cli.py'
if not path.is_file(): if not path.is_file():
raise Exception(_('cannot find cli file for "output_name" module "{0}"').format(output_name)) raise Exception(f'cannot find cli file for "output_name" module "{output_name}"')
module = load_modules('rougail.output_' + output_name, str(path)) module = load_modules('rougail.output_' + output_name + '.cli', str(path))
module.RougailOutput(config=config, module.run(rougailconfig,
rougailconfig=rougailconfig, config,
user_data_errors = err_warn['errors'], user_datas,
user_data_warnings = err_warn['warnings'], )
).run()
def main():
try:
_main()
except Exception as err:
print(_('ERROR: {0}').format(err))
exit(1)

View file

@ -1,25 +0,0 @@
"""Internationalisation utilities
Silique (https://www.silique.fr)
Copyright (C) 2024
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Mtools 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with Mtools. If not, see <http://www.gnu.org/licenses/>.
"""
from gettext import translation
from pathlib import Path
t = translation('rougail.cli', str(Path(__file__).parent / 'locale'))
_ = t.gettext