orionis 0.44.0__py3-none-any.whl → 0.46.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- orionis/cli_manager.py +16 -30
- orionis/contracts/bootstrap/i_command_bootstrapper.py +59 -0
- orionis/contracts/bootstrap/i_config_bootstrapper.py +112 -0
- orionis/contracts/bootstrap/i_environment_bootstrapper.py +33 -0
- orionis/{luminate/contracts/console/base/base_command_interface.py → contracts/console/base/i_command.py} +0 -1
- orionis/contracts/facades/config/i_config_facade.py +37 -0
- orionis/contracts/facades/environment/i_environment_facade.py +40 -0
- orionis/{luminate/contracts/facades/paths_interface.py → contracts/facades/files/i_path_facade.py} +27 -20
- orionis/contracts/facades/log/i_log_facade.py +83 -0
- orionis/{luminate/contracts/facades/tests_interface.py → contracts/facades/tests/i_tests_facade.py} +3 -6
- orionis/{luminate/contracts/console/scripts/management_interface.py → contracts/installer/i_installer_manager.py} +19 -16
- orionis/contracts/installer/i_installer_output.py +101 -0
- orionis/contracts/installer/i_installer_setup.py +59 -0
- orionis/contracts/providers/i_service_provider.py +27 -0
- orionis/contracts/services/config/i_config_service.py +37 -0
- orionis/contracts/services/files/i_path_service.py +31 -0
- orionis/contracts/services/log/i_log_service.py +89 -0
- orionis/{luminate/facades/environment.py → contracts/support/i_environment.py} +25 -32
- orionis/{luminate/contracts/tools/exception_to_dict_interface.py → contracts/support/i_exception_to_dict.py} +0 -9
- orionis/{luminate/contracts/tools/reflection_interface.py → contracts/support/i_reflection.py} +17 -8
- orionis/{luminate/contracts/tools/std_interface.py → contracts/support/i_std.py} +3 -16
- orionis/framework.py +1 -1
- orionis/{luminate/console/scripts/management.py → installer/installer_manager.py} +22 -16
- orionis/{luminate/installer/output.py → installer/installer_output.py} +16 -10
- orionis/{luminate/installer/setup.py → installer/installer_setup.py} +13 -25
- orionis/luminate/app.py +15 -11
- orionis/luminate/bootstrap/command_bootstrapper.py +150 -0
- orionis/luminate/bootstrap/config_bootstrapper.py +168 -0
- orionis/luminate/bootstrap/environment_bootstrapper.py +67 -0
- orionis/luminate/config/helpers.py +20 -0
- orionis/luminate/console/base/command.py +1 -3
- orionis/luminate/console/command_filter.py +2 -2
- orionis/luminate/console/commands/cache_clear.py +17 -5
- orionis/luminate/console/commands/help.py +19 -13
- orionis/luminate/console/commands/schedule_work.py +6 -3
- orionis/luminate/console/commands/tests.py +1 -6
- orionis/luminate/console/commands/version.py +0 -5
- orionis/luminate/console/exceptions/cli_exception.py +1 -4
- orionis/luminate/console/kernel.py +2 -2
- orionis/luminate/console/output/console.py +2 -2
- orionis/luminate/console/output/executor.py +1 -1
- orionis/luminate/console/output/progress_bar.py +1 -1
- orionis/luminate/console/parser.py +2 -2
- orionis/luminate/console/runner.py +127 -126
- orionis/luminate/console/tasks/scheduler.py +8 -7
- orionis/luminate/container/container.py +1 -1
- orionis/luminate/container/types.py +38 -12
- orionis/luminate/facades/config/config_facade.py +43 -0
- orionis/luminate/facades/environment/environment_facade.py +68 -0
- orionis/luminate/facades/{paths.py → files/path_facade.py} +50 -6
- orionis/luminate/facades/log/__init__.py +0 -0
- orionis/luminate/facades/log/log_facade.py +95 -0
- orionis/luminate/facades/tests/__init__.py +0 -0
- orionis/luminate/facades/{tests.py → tests/tests_facade.py} +1 -1
- orionis/luminate/patterns/__init__.py +0 -0
- orionis/luminate/pipelines/cli_pipeline.py +122 -116
- orionis/luminate/providers/__init__.py +0 -0
- orionis/luminate/providers/config/__init__.py +0 -0
- orionis/luminate/providers/config/config_service_provider.py +26 -0
- orionis/luminate/providers/files/__init__.py +0 -0
- orionis/luminate/providers/files/path_service_provider.py +26 -0
- orionis/luminate/providers/log/__init__.py +0 -0
- orionis/luminate/providers/log/log_service_provider.py +26 -0
- orionis/luminate/services/__init__.py +0 -0
- orionis/luminate/services/config/__init__.py +0 -0
- orionis/luminate/services/config/config_service.py +72 -0
- orionis/luminate/services/files/__init__.py +0 -0
- orionis/luminate/services/files/path_service.py +71 -0
- orionis/luminate/services/log/__init__.py +0 -0
- orionis/luminate/services/log/log_service.py +159 -0
- orionis/luminate/{config → support}/environment.py +21 -32
- orionis/luminate/{tools → support}/exception_to_dict.py +1 -1
- orionis/luminate/{tools → support}/reflection.py +1 -1
- orionis/luminate/{tools → support}/std.py +1 -1
- orionis/luminate/test/unit_test.py +1 -2
- {orionis-0.44.0.dist-info → orionis-0.46.0.dist-info}/METADATA +1 -1
- orionis-0.46.0.dist-info/RECORD +157 -0
- tests/tools/test_reflection.py +1 -1
- orionis/luminate/bootstrap/commands/bootstrapper.py +0 -101
- orionis/luminate/bootstrap/commands/register.py +0 -92
- orionis/luminate/bootstrap/config/bootstrapper.py +0 -79
- orionis/luminate/bootstrap/config/parser.py +0 -53
- orionis/luminate/bootstrap/config/register.py +0 -76
- orionis/luminate/cache/app/config.py +0 -91
- orionis/luminate/cache/console/commands.py +0 -97
- orionis/luminate/console/cache.py +0 -87
- orionis/luminate/console/command.py +0 -40
- orionis/luminate/contracts/bootstrap/commands/bootstrapper_interface.py +0 -44
- orionis/luminate/contracts/bootstrap/commands/register_interface.py +0 -33
- orionis/luminate/contracts/bootstrap/config/bootstrapper_interface.py +0 -40
- orionis/luminate/contracts/bootstrap/config/parser_interface.py +0 -46
- orionis/luminate/contracts/bootstrap/config/register_interface.py +0 -47
- orionis/luminate/contracts/cache/app/config_interface.py +0 -76
- orionis/luminate/contracts/cache/console/commands_interface.py +0 -78
- orionis/luminate/contracts/config/environment_interface.py +0 -64
- orionis/luminate/contracts/console/command_interface.py +0 -36
- orionis/luminate/contracts/console/runner_interface.py +0 -50
- orionis/luminate/contracts/facades/env_interface.py +0 -64
- orionis/luminate/contracts/facades/log_interface.py +0 -48
- orionis/luminate/contracts/files/paths_interface.py +0 -29
- orionis/luminate/contracts/installer/output_interface.py +0 -125
- orionis/luminate/contracts/installer/setup_interface.py +0 -29
- orionis/luminate/contracts/installer/upgrade_interface.py +0 -24
- orionis/luminate/contracts/log/logger_interface.py +0 -33
- orionis/luminate/contracts/pipelines/cli_pipeline_interface.py +0 -84
- orionis/luminate/contracts/publisher/pypi_publisher_interface.py +0 -36
- orionis/luminate/contracts/test/unit_test_interface.py +0 -51
- orionis/luminate/facades/config.py +0 -10
- orionis/luminate/facades/log.py +0 -56
- orionis/luminate/files/paths.py +0 -56
- orionis/luminate/installer/upgrade.py +0 -42
- orionis/luminate/log/logger.py +0 -116
- orionis/luminate/publisher/pypi.py +0 -215
- orionis-0.44.0.dist-info/RECORD +0 -156
- /orionis/{luminate/bootstrap/config → contracts}/__init__.py +0 -0
- /orionis/{luminate/cache → contracts/config}/__init__.py +0 -0
- /orionis/{luminate/contracts/config/config_interface.py → contracts/config/i_config.py} +0 -0
- /orionis/{luminate/cache/app → contracts/console}/__init__.py +0 -0
- /orionis/{luminate/cache/console → contracts/console/base}/__init__.py +0 -0
- /orionis/{luminate/contracts/console/command_filter_interface.py → contracts/console/i_command_filter.py} +0 -0
- /orionis/{luminate/contracts/console/kernel_interface.py → contracts/console/i_kernel.py} +0 -0
- /orionis/{luminate/contracts/console/parser_interface.py → contracts/console/i_parser.py} +0 -0
- /orionis/{luminate/contracts/console/task_manager_interface.py → contracts/console/i_task_manager.py} +0 -0
- /orionis/{luminate/config/dataclass → contracts/console/output}/__init__.py +0 -0
- /orionis/{luminate/contracts/console/output/console_interface.py → contracts/console/output/i_console.py} +0 -0
- /orionis/{luminate/contracts/console/output/executor_interface.py → contracts/console/output/i_executor.py} +0 -0
- /orionis/{luminate/contracts/console/output/progress_bar_interface.py → contracts/console/output/i_progress_bar.py} +0 -0
- /orionis/{luminate/console/scripts → contracts/console/tasks}/__init__.py +0 -0
- /orionis/{luminate/contracts/console/tasks/schedule_interface.py → contracts/console/tasks/i_schedule.py} +0 -0
- /orionis/{luminate/contracts/container/container_interface.py → contracts/container/i_container.py} +0 -0
- /orionis/{luminate/contracts/container/types_interface.py → contracts/container/i_types.py} +0 -0
- /orionis/{luminate/contracts → contracts/facades}/__init__.py +0 -0
- /orionis/{luminate/contracts/cache → contracts/facades/config}/__init__.py +0 -0
- /orionis/{luminate/contracts/config → contracts/facades/environment}/__init__.py +0 -0
- /orionis/{luminate/contracts/console → contracts/facades/files}/__init__.py +0 -0
- /orionis/{luminate/contracts/facades → contracts/facades/log}/__init__.py +0 -0
- /orionis/{luminate/contracts/files → contracts/facades/tests}/__init__.py +0 -0
- /orionis/{luminate/contracts → contracts}/installer/__init__.py +0 -0
- /orionis/{luminate/contracts/log → contracts/providers}/__init__.py +0 -0
- /orionis/{luminate/contracts/publisher → contracts/services}/__init__.py +0 -0
- /orionis/{luminate/contracts/test → contracts/services/config}/__init__.py +0 -0
- /orionis/{luminate/contracts/tools → contracts/services/files}/__init__.py +0 -0
- /orionis/{luminate/files → contracts/services/log}/__init__.py +0 -0
- /orionis/{luminate/installer → installer}/__init__.py +0 -0
- /orionis/luminate/bootstrap/{cli_exception.py → exception_bootstrapper.py} +0 -0
- /orionis/luminate/config/{dataclass/app.py → app.py} +0 -0
- /orionis/luminate/config/{dataclass/auth.py → auth.py} +0 -0
- /orionis/luminate/config/{dataclass/cache.py → cache.py} +0 -0
- /orionis/luminate/config/{dataclass/cors.py → cors.py} +0 -0
- /orionis/luminate/config/{dataclass/database.py → database.py} +0 -0
- /orionis/luminate/config/{dataclass/filesystems.py → filesystems.py} +0 -0
- /orionis/luminate/config/{dataclass/logging.py → logging.py} +0 -0
- /orionis/luminate/config/{dataclass/mail.py → mail.py} +0 -0
- /orionis/luminate/config/{dataclass/queue.py → queue.py} +0 -0
- /orionis/luminate/config/{dataclass/session.py → session.py} +0 -0
- /orionis/luminate/{log → facades/config}/__init__.py +0 -0
- /orionis/luminate/{publisher → facades/environment}/__init__.py +0 -0
- /orionis/luminate/{tools → facades/files}/__init__.py +0 -0
- /orionis/luminate/{tools → support}/dot_dict.py +0 -0
- /orionis/{luminate/installer → static/ascii}/icon.ascii +0 -0
- /orionis/{luminate/installer → static/ascii}/info.ascii +0 -0
- /orionis/{luminate/static → static}/bg/galaxy.jpg +0 -0
- /orionis/{luminate/static → static}/favicon/OrionisFrameworkFavicon.png +0 -0
- /orionis/{luminate/static → static}/logos/OrionisFramework.jpg +0 -0
- /orionis/{luminate/static → static}/logos/OrionisFramework.png +0 -0
- /orionis/{luminate/static → static}/logos/OrionisFramework.psd +0 -0
- /orionis/{luminate/static → static}/logos/OrionisFramework2.png +0 -0
- /orionis/{luminate/static → static}/logos/OrionisFramework3.png +0 -0
- {orionis-0.44.0.dist-info → orionis-0.46.0.dist-info}/LICENCE +0 -0
- {orionis-0.44.0.dist-info → orionis-0.46.0.dist-info}/WHEEL +0 -0
- {orionis-0.44.0.dist-info → orionis-0.46.0.dist-info}/entry_points.txt +0 -0
- {orionis-0.44.0.dist-info → orionis-0.46.0.dist-info}/top_level.txt +0 -0
@@ -1,40 +0,0 @@
|
|
1
|
-
from typing import Any
|
2
|
-
from orionis.luminate.console.runner import CLIRunner
|
3
|
-
from orionis.luminate.contracts.console.command_interface import ICommand
|
4
|
-
|
5
|
-
class Command(ICommand):
|
6
|
-
"""
|
7
|
-
Command class for managing and executing registered CLI commands.
|
8
|
-
|
9
|
-
This class provides a static method to invoke commands registered in the
|
10
|
-
`CacheCommands` singleton, passing the required signature and any additional
|
11
|
-
parameters.
|
12
|
-
|
13
|
-
Methods
|
14
|
-
-------
|
15
|
-
call(signature: str, vars: dict[str, Any] = {}, *args: Any, **kwargs: Any) -> Any
|
16
|
-
Executes the specified command with the provided arguments.
|
17
|
-
"""
|
18
|
-
|
19
|
-
@staticmethod
|
20
|
-
def call(signature: str, vars: dict[str, Any] = {}, *args: Any, **kwargs: Any) -> Any:
|
21
|
-
"""
|
22
|
-
Calls a registered command using the `CLIRunner`.
|
23
|
-
|
24
|
-
Parameters
|
25
|
-
----------
|
26
|
-
signature : str
|
27
|
-
The command signature (name) to execute.
|
28
|
-
vars : dict[str, Any], optional
|
29
|
-
A dictionary containing named arguments for the command (default is `{}`).
|
30
|
-
*args : Any
|
31
|
-
Additional positional arguments.
|
32
|
-
**kwargs : Any
|
33
|
-
Additional keyword arguments.
|
34
|
-
|
35
|
-
Returns
|
36
|
-
-------
|
37
|
-
Any
|
38
|
-
The output of the executed command.
|
39
|
-
"""
|
40
|
-
return CLIRunner.handle(signature, vars, *args, **kwargs)
|
@@ -1,44 +0,0 @@
|
|
1
|
-
from abc import ABC, abstractmethod
|
2
|
-
|
3
|
-
class IBootstrapper(ABC):
|
4
|
-
"""
|
5
|
-
Manages the automatic loading and registration of command classes
|
6
|
-
from Python files located in predefined directories.
|
7
|
-
|
8
|
-
The `Bootstrapper` class scans specific directories for Python files, dynamically
|
9
|
-
imports them, and registers classes that inherit from `BaseCommand`.
|
10
|
-
|
11
|
-
Attributes
|
12
|
-
----------
|
13
|
-
register : Register
|
14
|
-
An instance of the `Register` class used to register command classes.
|
15
|
-
|
16
|
-
Methods
|
17
|
-
-------
|
18
|
-
__init__(register: Register) -> None
|
19
|
-
Initializes the `Bootstrapper` with a `Register` instance and triggers autoloading.
|
20
|
-
_autoload() -> None
|
21
|
-
Scans predefined directories for Python files, dynamically imports modules,
|
22
|
-
and registers classes that extend `BaseCommand`.
|
23
|
-
"""
|
24
|
-
|
25
|
-
@abstractmethod
|
26
|
-
def _autoload(self) -> None:
|
27
|
-
"""
|
28
|
-
Autoloads command modules from specified directories and registers command classes.
|
29
|
-
|
30
|
-
This method searches for Python files in the predefined command directories,
|
31
|
-
dynamically imports the modules, and registers classes that inherit from `BaseCommand`.
|
32
|
-
|
33
|
-
The command directories searched are:
|
34
|
-
- `app/console/commands` relative to the current working directory.
|
35
|
-
- `console/commands` relative to the parent directory of the current file.
|
36
|
-
|
37
|
-
It skips `__init__.py` files and ignores directories that do not exist.
|
38
|
-
|
39
|
-
Raises
|
40
|
-
------
|
41
|
-
BootstrapRuntimeError
|
42
|
-
If an error occurs while loading a module.
|
43
|
-
"""
|
44
|
-
pass
|
@@ -1,33 +0,0 @@
|
|
1
|
-
from abc import ABC, abstractmethod
|
2
|
-
from typing import Any, Callable
|
3
|
-
|
4
|
-
class IRegister(ABC):
|
5
|
-
"""
|
6
|
-
Interface for a command register.
|
7
|
-
"""
|
8
|
-
|
9
|
-
@abstractmethod
|
10
|
-
def command(self, command_class: Callable[..., Any]) -> None:
|
11
|
-
"""
|
12
|
-
Registers a command class after validating its structure.
|
13
|
-
|
14
|
-
Parameters
|
15
|
-
----------
|
16
|
-
command_class : type
|
17
|
-
The command class to register.
|
18
|
-
|
19
|
-
Returns
|
20
|
-
-------
|
21
|
-
type
|
22
|
-
The registered command class.
|
23
|
-
|
24
|
-
Raises
|
25
|
-
------
|
26
|
-
ValueError
|
27
|
-
If 'signature' is missing, invalid, contains spaces, or is not a string.
|
28
|
-
If 'description' is missing or not a string.
|
29
|
-
If 'handle' method is missing.
|
30
|
-
TypeError
|
31
|
-
If the class does not inherit from 'BaseCommand'.
|
32
|
-
"""
|
33
|
-
pass
|
@@ -1,40 +0,0 @@
|
|
1
|
-
from abc import ABC, abstractmethod
|
2
|
-
|
3
|
-
class IBootstrapper(ABC):
|
4
|
-
"""
|
5
|
-
Interface for managing the automatic loading and registration of configuration
|
6
|
-
classes from Python files located in a specified directory.
|
7
|
-
|
8
|
-
The `IBootstrapper` interface defines methods for scanning directories for
|
9
|
-
Python files and dynamically importing them to find configuration classes.
|
10
|
-
Implementations of this interface should provide the logic for registering
|
11
|
-
the found classes using a `Register` instance.
|
12
|
-
|
13
|
-
Methods
|
14
|
-
-------
|
15
|
-
autoload(directory: str) -> None
|
16
|
-
Scans a directory for Python files, imports them, finds configuration classes,
|
17
|
-
and registers them using the `Register` instance.
|
18
|
-
"""
|
19
|
-
|
20
|
-
@abstractmethod
|
21
|
-
def _autoload(self, directory: str) -> None:
|
22
|
-
"""
|
23
|
-
Automatically registers configuration classes found in a given directory.
|
24
|
-
|
25
|
-
This method walks through the specified directory, imports all Python files,
|
26
|
-
and scans for class definitions. If a class is found, it is registered using
|
27
|
-
the `Register` instance. Only classes defined in Python files (excluding
|
28
|
-
`__init__.py`) are considered.
|
29
|
-
|
30
|
-
Parameters
|
31
|
-
----------
|
32
|
-
directory : str
|
33
|
-
The directory to scan for Python configuration files.
|
34
|
-
|
35
|
-
Raises
|
36
|
-
------
|
37
|
-
FileNotFoundError
|
38
|
-
If the provided directory does not exist.
|
39
|
-
"""
|
40
|
-
pass
|
@@ -1,46 +0,0 @@
|
|
1
|
-
from abc import ABC, abstractmethod
|
2
|
-
from typing import Any
|
3
|
-
|
4
|
-
class IParser(ABC):
|
5
|
-
"""
|
6
|
-
A class responsible for parsing an instance's configuration and outputting it as a dictionary.
|
7
|
-
|
8
|
-
This class uses Python's `dataclasses.asdict()` method to convert an instance's `config` attribute to a dictionary.
|
9
|
-
|
10
|
-
Methods
|
11
|
-
-------
|
12
|
-
parse(instance: Any) -> dict
|
13
|
-
Takes an instance with a `config` attribute and returns its dictionary representation.
|
14
|
-
|
15
|
-
Notes
|
16
|
-
-----
|
17
|
-
- This method expects the instance to have a `config` attribute that is a dataclass or any object that supports `asdict()`.
|
18
|
-
- The `asdict()` function will recursively convert dataclass fields into a dictionary format.
|
19
|
-
- If `instance.config` is not a dataclass, this could raise an exception depending on the type.
|
20
|
-
"""
|
21
|
-
|
22
|
-
@abstractmethod
|
23
|
-
def toDict(self, instance: Any) -> dict:
|
24
|
-
"""
|
25
|
-
Converts the `config` attribute of the provided instance to a dictionary and returns it.
|
26
|
-
|
27
|
-
Parameters
|
28
|
-
----------
|
29
|
-
instance : Any
|
30
|
-
The instance to parse. It is expected that the instance has a `config` attribute
|
31
|
-
that is a dataclass or any object that supports `asdict()`.
|
32
|
-
|
33
|
-
Returns
|
34
|
-
-------
|
35
|
-
dict
|
36
|
-
The dictionary representation of the `config` attribute.
|
37
|
-
|
38
|
-
Raises
|
39
|
-
------
|
40
|
-
AttributeError
|
41
|
-
If the `instance` does not have a `config` attribute.
|
42
|
-
TypeError
|
43
|
-
If the `instance.config` is not a valid dataclass or object that supports `asdict()`.
|
44
|
-
"""
|
45
|
-
pass
|
46
|
-
|
@@ -1,47 +0,0 @@
|
|
1
|
-
from abc import ABC, abstractmethod
|
2
|
-
|
3
|
-
class IRegister(ABC):
|
4
|
-
"""
|
5
|
-
Handles the registration of configuration classes within the application.
|
6
|
-
|
7
|
-
This class ensures that only valid configuration classes are registered
|
8
|
-
while enforcing structure and type safety.
|
9
|
-
|
10
|
-
Attributes
|
11
|
-
----------
|
12
|
-
cache_config : CacheConfig
|
13
|
-
An instance of `CacheConfig` used to store registered configurations.
|
14
|
-
|
15
|
-
Methods
|
16
|
-
-------
|
17
|
-
config(config_class: type) -> None
|
18
|
-
Registers a configuration class and ensures it meets the necessary criteria.
|
19
|
-
"""
|
20
|
-
|
21
|
-
@abstractmethod
|
22
|
-
def config(self, config_class: type) -> None:
|
23
|
-
"""
|
24
|
-
Registers a configuration class and ensures it meets the required structure.
|
25
|
-
|
26
|
-
This method performs multiple validation steps, including checking if the input
|
27
|
-
is a class, verifying the existence of a `config` attribute, and confirming
|
28
|
-
inheritance from `IConfig`.
|
29
|
-
|
30
|
-
Parameters
|
31
|
-
----------
|
32
|
-
config_class : type
|
33
|
-
The class to be registered as a configuration.
|
34
|
-
|
35
|
-
Returns
|
36
|
-
-------
|
37
|
-
type
|
38
|
-
The same class passed as an argument, if registration is successful.
|
39
|
-
|
40
|
-
Raises
|
41
|
-
------
|
42
|
-
TypeError
|
43
|
-
If `config_class` is not a class or does not inherit from `IConfig`.
|
44
|
-
ValueError
|
45
|
-
If `config_class` does not have a `config` attribute or is already registered.
|
46
|
-
"""
|
47
|
-
pass
|
@@ -1,76 +0,0 @@
|
|
1
|
-
from abc import ABC, abstractmethod
|
2
|
-
from typing import Dict, Any
|
3
|
-
|
4
|
-
class ICacheConfig(ABC):
|
5
|
-
"""
|
6
|
-
CacheConfig is a class that manages the registration, unregistration, and retrieval of configuration sections.
|
7
|
-
|
8
|
-
Methods
|
9
|
-
-------
|
10
|
-
__init__()
|
11
|
-
Initializes a new instance of the class with an empty configuration dictionary.
|
12
|
-
register(section: str, data: Dict[str, Any])
|
13
|
-
Registers a configuration section with its associated data.
|
14
|
-
unregister(section: str)
|
15
|
-
Unregisters a previously registered configuration section.
|
16
|
-
get(section: str)
|
17
|
-
Retrieves the configuration data for a specific section.
|
18
|
-
"""
|
19
|
-
|
20
|
-
@abstractmethod
|
21
|
-
def register(self, section: str, data: Dict[str, Any]) -> None:
|
22
|
-
"""
|
23
|
-
Registers a configuration section.
|
24
|
-
|
25
|
-
Parameters
|
26
|
-
----------
|
27
|
-
section : str
|
28
|
-
The name of the configuration section to register.
|
29
|
-
data : dict
|
30
|
-
The configuration data associated with the section.
|
31
|
-
|
32
|
-
Raises
|
33
|
-
------
|
34
|
-
ValueError
|
35
|
-
If the section is already registered.
|
36
|
-
"""
|
37
|
-
pass
|
38
|
-
|
39
|
-
@abstractmethod
|
40
|
-
def unregister(self, section: str) -> None:
|
41
|
-
"""
|
42
|
-
Unregisters a previously registered configuration section.
|
43
|
-
|
44
|
-
Parameters
|
45
|
-
----------
|
46
|
-
section : str
|
47
|
-
The name of the configuration section to remove.
|
48
|
-
|
49
|
-
Raises
|
50
|
-
------
|
51
|
-
KeyError
|
52
|
-
If the section is not found in the registered configurations.
|
53
|
-
"""
|
54
|
-
pass
|
55
|
-
|
56
|
-
@abstractmethod
|
57
|
-
def get(self, section: str) -> Dict[str, Any]:
|
58
|
-
"""
|
59
|
-
Retrieves the configuration for a specific section.
|
60
|
-
|
61
|
-
Parameters
|
62
|
-
----------
|
63
|
-
section : str
|
64
|
-
The name of the configuration section to retrieve.
|
65
|
-
|
66
|
-
Returns
|
67
|
-
-------
|
68
|
-
dict
|
69
|
-
The configuration data for the specified section.
|
70
|
-
|
71
|
-
Raises
|
72
|
-
------
|
73
|
-
KeyError
|
74
|
-
If the requested section is not found.
|
75
|
-
"""
|
76
|
-
pass
|
@@ -1,78 +0,0 @@
|
|
1
|
-
from abc import ABC, abstractmethod
|
2
|
-
from typing import Any, Callable
|
3
|
-
|
4
|
-
class ICacheCommands(ABC):
|
5
|
-
"""
|
6
|
-
CacheCommands is a class that manages the registration, unregistration, and retrieval of command instances.
|
7
|
-
|
8
|
-
Methods
|
9
|
-
-------
|
10
|
-
__init__()
|
11
|
-
Initializes the command cache with an empty dictionary.
|
12
|
-
register(signature: str, description: str, arguments: list, concrete: Callable[..., Any])
|
13
|
-
Register a new command with its signature, description, and class instance.
|
14
|
-
unregister(signature: str)
|
15
|
-
Unregister an existing command by its signature.
|
16
|
-
get(signature: str)
|
17
|
-
Retrieve the information of a registered command by its signature.
|
18
|
-
"""
|
19
|
-
|
20
|
-
@abstractmethod
|
21
|
-
def register(self, signature: str, description: str, arguments: list, concrete: Callable[..., Any]):
|
22
|
-
"""
|
23
|
-
Register a new command with its signature, description, and class instance.
|
24
|
-
|
25
|
-
Parameters
|
26
|
-
----------
|
27
|
-
signature : str
|
28
|
-
The unique identifier (signature) for the command.
|
29
|
-
description : str
|
30
|
-
A brief description of what the command does.
|
31
|
-
concrete : class
|
32
|
-
The class or callable instance that defines the command behavior.
|
33
|
-
|
34
|
-
Raises
|
35
|
-
------
|
36
|
-
ValueError
|
37
|
-
If a command with the given signature already exists.
|
38
|
-
"""
|
39
|
-
pass
|
40
|
-
|
41
|
-
@abstractmethod
|
42
|
-
def unregister(self, signature: str):
|
43
|
-
"""
|
44
|
-
Unregister an existing command by its signature.
|
45
|
-
|
46
|
-
Parameters
|
47
|
-
----------
|
48
|
-
signature : str
|
49
|
-
The unique identifier (signature) for the command to unregister.
|
50
|
-
|
51
|
-
Raises
|
52
|
-
------
|
53
|
-
KeyError
|
54
|
-
If the command with the given signature does not exist.
|
55
|
-
"""
|
56
|
-
pass
|
57
|
-
|
58
|
-
@abstractmethod
|
59
|
-
def get(self, signature: str):
|
60
|
-
"""
|
61
|
-
Retrieve the information of a registered command by its signature.
|
62
|
-
|
63
|
-
Parameters
|
64
|
-
----------
|
65
|
-
signature : str
|
66
|
-
The unique identifier (signature) for the command.
|
67
|
-
|
68
|
-
Returns
|
69
|
-
-------
|
70
|
-
dict
|
71
|
-
A dictionary containing the class, signature, and description of the command.
|
72
|
-
|
73
|
-
Raises
|
74
|
-
------
|
75
|
-
KeyError
|
76
|
-
If the command with the given signature does not exist.
|
77
|
-
"""
|
78
|
-
pass
|
@@ -1,64 +0,0 @@
|
|
1
|
-
from abc import ABC, abstractmethod
|
2
|
-
from typing import Optional, Dict
|
3
|
-
|
4
|
-
class IEnvironment(ABC):
|
5
|
-
"""
|
6
|
-
Interface for managing environment variables from a .env file.
|
7
|
-
"""
|
8
|
-
|
9
|
-
@abstractmethod
|
10
|
-
def get(self, key: str, default: Optional[str] = None) -> Optional[str]:
|
11
|
-
"""
|
12
|
-
Retrieve the value of an environment variable.
|
13
|
-
|
14
|
-
Parameters
|
15
|
-
----------
|
16
|
-
key : str
|
17
|
-
The key of the environment variable.
|
18
|
-
default : Optional[str], optional
|
19
|
-
Default value if the key does not exist, by default None.
|
20
|
-
|
21
|
-
Returns
|
22
|
-
-------
|
23
|
-
Optional[str]
|
24
|
-
The value of the environment variable or the default value.
|
25
|
-
"""
|
26
|
-
pass
|
27
|
-
|
28
|
-
@abstractmethod
|
29
|
-
def set(self, key: str, value: str) -> None:
|
30
|
-
"""
|
31
|
-
Set the value of an environment variable in the .env file.
|
32
|
-
|
33
|
-
Parameters
|
34
|
-
----------
|
35
|
-
key : str
|
36
|
-
The key of the environment variable.
|
37
|
-
value : str
|
38
|
-
The value to set.
|
39
|
-
"""
|
40
|
-
pass
|
41
|
-
|
42
|
-
@abstractmethod
|
43
|
-
def unset(self, key: str) -> None:
|
44
|
-
"""
|
45
|
-
Remove an environment variable from the .env file.
|
46
|
-
|
47
|
-
Parameters
|
48
|
-
----------
|
49
|
-
key : str
|
50
|
-
The key of the environment variable to remove.
|
51
|
-
"""
|
52
|
-
pass
|
53
|
-
|
54
|
-
@abstractmethod
|
55
|
-
def all(self) -> Dict[str, str]:
|
56
|
-
"""
|
57
|
-
Retrieve all environment variable values from the .env file.
|
58
|
-
|
59
|
-
Returns
|
60
|
-
-------
|
61
|
-
Dict[str, str]
|
62
|
-
A dictionary of all environment variables and their values.
|
63
|
-
"""
|
64
|
-
pass
|
@@ -1,36 +0,0 @@
|
|
1
|
-
from typing import Any
|
2
|
-
from abc import ABC, abstractmethod
|
3
|
-
|
4
|
-
class ICommand(ABC):
|
5
|
-
"""
|
6
|
-
Interface for managing and executing registered commands.
|
7
|
-
|
8
|
-
This interface ensures that any class implementing it will provide a method
|
9
|
-
for executing commands from a cache by their signature.
|
10
|
-
"""
|
11
|
-
|
12
|
-
@abstractmethod
|
13
|
-
def call(signature: str, vars: dict[str, Any] = {}, *args: Any, **kwargs: Any) -> Any:
|
14
|
-
"""
|
15
|
-
Calls a registered command from the CacheCommands singleton.
|
16
|
-
|
17
|
-
This method retrieves the command class associated with the given
|
18
|
-
signature, instantiates it, and executes the `handle` method of
|
19
|
-
the command instance.
|
20
|
-
|
21
|
-
Parameters
|
22
|
-
----------
|
23
|
-
signature : str
|
24
|
-
The unique identifier (signature) of the command to be executed.
|
25
|
-
**kwargs : dict
|
26
|
-
Additional keyword arguments to be passed to the command instance
|
27
|
-
when it is created.
|
28
|
-
|
29
|
-
Raises
|
30
|
-
------
|
31
|
-
KeyError
|
32
|
-
If no command with the given signature is found in the cache.
|
33
|
-
RuntimeError
|
34
|
-
If an error occurs while executing the command.
|
35
|
-
"""
|
36
|
-
pass
|
@@ -1,50 +0,0 @@
|
|
1
|
-
from abc import ABC, abstractmethod
|
2
|
-
from typing import Any
|
3
|
-
|
4
|
-
class ICLIRunner(ABC):
|
5
|
-
"""
|
6
|
-
Interface for CLIRunner, defining the structure for handling CLI command execution.
|
7
|
-
|
8
|
-
This interface ensures that any implementing class properly processes and executes CLI commands.
|
9
|
-
|
10
|
-
Methods
|
11
|
-
-------
|
12
|
-
handle(signature: str = None, vars: dict = {}, *args, **kwargs) -> Any
|
13
|
-
Processes and executes a CLI command based on provided arguments.
|
14
|
-
"""
|
15
|
-
|
16
|
-
@abstractmethod
|
17
|
-
def handle(self, signature: str = None, vars: dict = {}, *args, **kwargs) -> Any:
|
18
|
-
"""
|
19
|
-
Processes and executes a CLI command.
|
20
|
-
|
21
|
-
This method:
|
22
|
-
- Determines whether the command is invoked from `sys.argv` or as a function.
|
23
|
-
- Extracts the command signature and arguments.
|
24
|
-
- Executes the command pipeline.
|
25
|
-
- Logs execution status and handles errors.
|
26
|
-
|
27
|
-
Parameters
|
28
|
-
----------
|
29
|
-
signature : str, optional
|
30
|
-
The command signature (default is None, meaning it is extracted from `sys.argv`).
|
31
|
-
vars : dict, optional
|
32
|
-
Named arguments for the command (default is an empty dictionary).
|
33
|
-
*args
|
34
|
-
Additional arguments for the command.
|
35
|
-
**kwargs
|
36
|
-
Additional keyword arguments for the command.
|
37
|
-
|
38
|
-
Returns
|
39
|
-
-------
|
40
|
-
Any
|
41
|
-
The output of the executed command.
|
42
|
-
|
43
|
-
Raises
|
44
|
-
------
|
45
|
-
ValueError
|
46
|
-
If no command signature is provided.
|
47
|
-
Exception
|
48
|
-
If an unexpected error occurs during execution.
|
49
|
-
"""
|
50
|
-
pass
|
@@ -1,64 +0,0 @@
|
|
1
|
-
from abc import ABC, abstractmethod
|
2
|
-
from typing import Optional, Dict
|
3
|
-
|
4
|
-
class IEnv(ABC):
|
5
|
-
"""
|
6
|
-
Interface for managing environment variables from a .env file.
|
7
|
-
"""
|
8
|
-
|
9
|
-
@abstractmethod
|
10
|
-
def get(self, key: str, default: Optional[str] = None) -> Optional[str]:
|
11
|
-
"""
|
12
|
-
Retrieve the value of an environment variable.
|
13
|
-
|
14
|
-
Parameters
|
15
|
-
----------
|
16
|
-
key : str
|
17
|
-
The key of the environment variable.
|
18
|
-
default : Optional[str], optional
|
19
|
-
Default value if the key does not exist, by default None.
|
20
|
-
|
21
|
-
Returns
|
22
|
-
-------
|
23
|
-
Optional[str]
|
24
|
-
The value of the environment variable or the default value.
|
25
|
-
"""
|
26
|
-
pass
|
27
|
-
|
28
|
-
@abstractmethod
|
29
|
-
def set(self, key: str, value: str) -> None:
|
30
|
-
"""
|
31
|
-
Set the value of an environment variable in the .env file.
|
32
|
-
|
33
|
-
Parameters
|
34
|
-
----------
|
35
|
-
key : str
|
36
|
-
The key of the environment variable.
|
37
|
-
value : str
|
38
|
-
The value to set.
|
39
|
-
"""
|
40
|
-
pass
|
41
|
-
|
42
|
-
@abstractmethod
|
43
|
-
def unset(self, key: str) -> None:
|
44
|
-
"""
|
45
|
-
Remove an environment variable from the .env file.
|
46
|
-
|
47
|
-
Parameters
|
48
|
-
----------
|
49
|
-
key : str
|
50
|
-
The key of the environment variable to remove.
|
51
|
-
"""
|
52
|
-
pass
|
53
|
-
|
54
|
-
@abstractmethod
|
55
|
-
def all(self) -> Dict[str, str]:
|
56
|
-
"""
|
57
|
-
Retrieve all environment variable values from the .env file.
|
58
|
-
|
59
|
-
Returns
|
60
|
-
-------
|
61
|
-
Dict[str, str]
|
62
|
-
A dictionary of all environment variables and their values.
|
63
|
-
"""
|
64
|
-
pass
|
@@ -1,48 +0,0 @@
|
|
1
|
-
from abc import ABC, abstractmethod
|
2
|
-
from typing import Optional
|
3
|
-
import logging
|
4
|
-
from orionis.luminate.contracts.log.logger_interface import ILogger
|
5
|
-
|
6
|
-
class ILogFacade(ABC):
|
7
|
-
"""
|
8
|
-
Facade interface for simplified access to logging operations.
|
9
|
-
|
10
|
-
Methods
|
11
|
-
-------
|
12
|
-
info(message: str) -> None
|
13
|
-
Logs an informational message.
|
14
|
-
error(message: str) -> None
|
15
|
-
Logs an error message.
|
16
|
-
success(message: str) -> None
|
17
|
-
Logs a success message (treated as info).
|
18
|
-
warning(message: str) -> None
|
19
|
-
Logs a warning message.
|
20
|
-
debug(message: str) -> None
|
21
|
-
Logs a debug message.
|
22
|
-
configure(path: Optional[str], level: int) -> ILogger
|
23
|
-
Configures and returns the logger instance.
|
24
|
-
"""
|
25
|
-
|
26
|
-
@abstractmethod
|
27
|
-
def info(self, message: str) -> None:
|
28
|
-
pass
|
29
|
-
|
30
|
-
@abstractmethod
|
31
|
-
def error(self, message: str) -> None:
|
32
|
-
pass
|
33
|
-
|
34
|
-
@abstractmethod
|
35
|
-
def success(self, message: str) -> None:
|
36
|
-
pass
|
37
|
-
|
38
|
-
@abstractmethod
|
39
|
-
def warning(self, message: str) -> None:
|
40
|
-
pass
|
41
|
-
|
42
|
-
@abstractmethod
|
43
|
-
def debug(self, message: str) -> None:
|
44
|
-
pass
|
45
|
-
|
46
|
-
@abstractmethod
|
47
|
-
def configure(self, path: Optional[str] = None, level: int = logging.INFO) -> ILogger:
|
48
|
-
pass
|