New features on branch v6.2.5:

- New capability in base.py to patch the database
    - Some minor updates on installation.py.
    - Translation feature:
        - New library requirement (pyyaml)
        - New translation systeme implemented.
        - New class translation.py added.
        - Module folder updated by adding new folder language.
        - Core module updated as well with new language folder.
This commit is contained in:
adator
2025-08-25 22:31:07 +02:00
parent 0a2e3f724b
commit 0c6fcb7710
22 changed files with 346 additions and 92 deletions

View File

@@ -11,6 +11,7 @@ class Command:
def __init__(self, loader: 'Loader'):
self.Loader = loader
self.Base = loader.Base
self.Logs = loader.Logs
def build(self, new_command_obj: MCommand) -> bool:
@@ -45,6 +46,27 @@ class Command:
return False
def drop_command_by_module(self, module_name: str) -> bool:
"""Drop all command by module
Args:
module_name (str): The module name
Returns:
bool: True
"""
tmp_model: list[MCommand] = []
for command in self.DB_COMMANDS:
if command.module_name.lower() == module_name.lower():
tmp_model.append(command)
for c in tmp_model:
self.DB_COMMANDS.remove(c)
self.Logs.debug(f"[COMMAND] Drop command for module {module_name}")
return True
def get_ordered_commands(self) -> list[MCommand]:
return sorted(self.DB_COMMANDS, key=lambda c: (c.command_level, c.module_name))