orionis 0.44.0__py3-none-any.whl → 0.47.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.47.0.dist-info}/METADATA +1 -1
- orionis-0.47.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.47.0.dist-info}/LICENCE +0 -0
- {orionis-0.44.0.dist-info → orionis-0.47.0.dist-info}/WHEEL +0 -0
- {orionis-0.44.0.dist-info → orionis-0.47.0.dist-info}/entry_points.txt +0 -0
- {orionis-0.44.0.dist-info → orionis-0.47.0.dist-info}/top_level.txt +0 -0
orionis/cli_manager.py
CHANGED
@@ -1,47 +1,33 @@
|
|
1
1
|
import argparse
|
2
|
-
from orionis.
|
2
|
+
from orionis.installer.installer_manager import InstallerManager
|
3
|
+
from orionis.installer.installer_output import InstallerOutput
|
3
4
|
|
5
|
+
# Main entry point for the Orionis CLI tool.
|
4
6
|
def main():
|
5
|
-
"""
|
6
|
-
Main entry point for the Orionis CLI tool.
|
7
|
-
"""
|
8
7
|
|
9
|
-
#
|
8
|
+
# Initialize the argument parser
|
10
9
|
parser = argparse.ArgumentParser(description="Orionis Command Line Tool")
|
11
|
-
|
12
|
-
# Optional argument for displaying the current Orionis version
|
13
10
|
parser.add_argument('--version', action='store_true', help="Show Orionis version.")
|
14
|
-
|
15
|
-
# Optional argument for upgrading Orionis to the latest version
|
16
11
|
parser.add_argument('--upgrade', action='store_true', help="Upgrade Orionis to the latest version.")
|
17
|
-
|
18
|
-
# Command to create a new Orionis app (requires an app name)
|
19
12
|
parser.add_argument('command', nargs='?', choices=['new'], help="Available command: 'new'.")
|
20
|
-
|
21
|
-
# Name of the application to be created (defaults to 'example-app')
|
22
13
|
parser.add_argument('name', nargs='?', help="The name of the Orionis application to create.", default="example-app")
|
23
14
|
|
24
15
|
# Parse the provided arguments
|
25
16
|
args = parser.parse_args()
|
26
17
|
|
27
18
|
# Initialize the Orionis tools for handling operations
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
cli_manager.createNewApp(args.name or 'example-app')
|
41
|
-
|
42
|
-
# If no valid command is provided, show the help message
|
43
|
-
else:
|
44
|
-
cli_manager.displayInfo()
|
19
|
+
try:
|
20
|
+
installer = InstallerManager()
|
21
|
+
if args.version:
|
22
|
+
installer.handleVersion()
|
23
|
+
elif args.upgrade:
|
24
|
+
installer.handleUpgrade()
|
25
|
+
elif args.command == 'new':
|
26
|
+
installer.handleNewApp(args.name)
|
27
|
+
else:
|
28
|
+
installer.handleInfo()
|
29
|
+
except Exception as e:
|
30
|
+
InstallerOutput.error(f"An error occurred: {e}", e)
|
45
31
|
|
46
32
|
# Execute the main function if the script is run directly
|
47
33
|
if __name__ == "__main__":
|
@@ -0,0 +1,59 @@
|
|
1
|
+
from abc import ABC, abstractmethod
|
2
|
+
from typing import Any, Callable, Dict
|
3
|
+
|
4
|
+
class ICommandsBootstrapper(ABC):
|
5
|
+
"""
|
6
|
+
Attributes
|
7
|
+
----------
|
8
|
+
_commands : Dict[str, Dict[str, Any]]
|
9
|
+
A dictionary to store registered commands, where the key is the command signature
|
10
|
+
and the value is a dictionary containing the command class, arguments, description,
|
11
|
+
and signature.
|
12
|
+
|
13
|
+
Methods
|
14
|
+
-------
|
15
|
+
__init__()
|
16
|
+
Initializes the `CommandsBootstrapper` and triggers the autoload process.
|
17
|
+
_autoload()
|
18
|
+
Scans the command directories and loads command classes.
|
19
|
+
_register(concrete: Callable[..., Any])
|
20
|
+
Validates and registers a command class.
|
21
|
+
"""
|
22
|
+
|
23
|
+
@abstractmethod
|
24
|
+
def _autoload(self) -> None:
|
25
|
+
"""
|
26
|
+
Scans the command directories and loads command classes.
|
27
|
+
|
28
|
+
This method searches for Python files in the specified directories, imports them,
|
29
|
+
and registers any class that inherits from `BaseCommand`.
|
30
|
+
|
31
|
+
Raises
|
32
|
+
------
|
33
|
+
BootstrapRuntimeError
|
34
|
+
If there is an error loading a module.
|
35
|
+
"""
|
36
|
+
pass
|
37
|
+
|
38
|
+
@abstractmethod
|
39
|
+
def _register(self, concrete: Callable[..., Any]) -> None:
|
40
|
+
"""
|
41
|
+
Validates and registers a command class.
|
42
|
+
|
43
|
+
This method ensures that the provided class is valid (inherits from `BaseCommand`,
|
44
|
+
has a `signature`, `description`, and `handle` method) and registers it in the
|
45
|
+
`_commands` dictionary.
|
46
|
+
|
47
|
+
Parameters
|
48
|
+
----------
|
49
|
+
concrete : Callable[..., Any]
|
50
|
+
The command class to register.
|
51
|
+
|
52
|
+
Raises
|
53
|
+
------
|
54
|
+
TypeError
|
55
|
+
If the input is not a class or does not inherit from `BaseCommand`.
|
56
|
+
ValueError
|
57
|
+
If the class does not have required attributes or methods.
|
58
|
+
"""
|
59
|
+
pass
|
@@ -0,0 +1,112 @@
|
|
1
|
+
from abc import ABC, abstractmethod
|
2
|
+
from typing import Any, Dict, Optional
|
3
|
+
|
4
|
+
class IConfigBootstrapper(ABC):
|
5
|
+
"""
|
6
|
+
Attributes
|
7
|
+
----------
|
8
|
+
_config : Dict[str, Any]
|
9
|
+
A dictionary to store registered configuration sections and their data.
|
10
|
+
|
11
|
+
Methods
|
12
|
+
-------
|
13
|
+
__init__()
|
14
|
+
Initializes the `ConfigBootstrapper` and triggers the autoload process.
|
15
|
+
_autoload()
|
16
|
+
Scans the configuration directory and loads configuration classes.
|
17
|
+
_set(concrete: Any, section: str)
|
18
|
+
Validates and registers a configuration class.
|
19
|
+
_parse(data: Any) -> Dict[str, Any]
|
20
|
+
Converts the 'config' attribute of a class into a dictionary.
|
21
|
+
_register(section: str, data: Dict[str, Any])
|
22
|
+
Registers a configuration section.
|
23
|
+
set(key: str, value: Any)
|
24
|
+
Dynamically sets a configuration value using dot notation.
|
25
|
+
get(key: str, default: Optional[Any] = None) -> Any
|
26
|
+
Retrieves a configuration value using dot notation.
|
27
|
+
"""
|
28
|
+
|
29
|
+
@abstractmethod
|
30
|
+
def _autoload(self) -> None:
|
31
|
+
"""
|
32
|
+
Scans the configuration directory and loads configuration classes.
|
33
|
+
|
34
|
+
This method searches for Python files in the specified directory, imports them,
|
35
|
+
and registers any class named `Config` that inherits from `IConfig`.
|
36
|
+
|
37
|
+
Raises
|
38
|
+
------
|
39
|
+
FileNotFoundError
|
40
|
+
If the configuration directory does not exist.
|
41
|
+
BootstrapRuntimeError
|
42
|
+
If there is an error loading a module.
|
43
|
+
"""
|
44
|
+
pass
|
45
|
+
|
46
|
+
@abstractmethod
|
47
|
+
def _set(self, concrete: Any, section: str) -> None:
|
48
|
+
"""
|
49
|
+
Validates and registers a configuration class.
|
50
|
+
|
51
|
+
This method ensures that the provided class is valid (inherits from `IConfig`
|
52
|
+
and has a `config` attribute) and registers it in the `_config` dictionary.
|
53
|
+
|
54
|
+
Parameters
|
55
|
+
----------
|
56
|
+
concrete : Any
|
57
|
+
The configuration class to register.
|
58
|
+
section : str
|
59
|
+
The section name under which the configuration will be registered.
|
60
|
+
|
61
|
+
Raises
|
62
|
+
------
|
63
|
+
TypeError
|
64
|
+
If the input is not a class or does not inherit from `IConfig`.
|
65
|
+
ValueError
|
66
|
+
If the class does not have a `config` attribute.
|
67
|
+
"""
|
68
|
+
pass
|
69
|
+
|
70
|
+
@abstractmethod
|
71
|
+
def _parse(data: Any) -> Dict[str, Any]:
|
72
|
+
"""
|
73
|
+
Converts the 'config' attribute of a class into a dictionary.
|
74
|
+
|
75
|
+
If the input is already a dictionary, it is returned as-is. If the input is a
|
76
|
+
dataclass, it is converted to a dictionary using `asdict`.
|
77
|
+
|
78
|
+
Parameters
|
79
|
+
----------
|
80
|
+
data : Any
|
81
|
+
The data to convert into a dictionary.
|
82
|
+
|
83
|
+
Returns
|
84
|
+
-------
|
85
|
+
Dict[str, Any]
|
86
|
+
The converted dictionary.
|
87
|
+
|
88
|
+
Raises
|
89
|
+
------
|
90
|
+
TypeError
|
91
|
+
If the data cannot be converted to a dictionary.
|
92
|
+
"""
|
93
|
+
pass
|
94
|
+
|
95
|
+
@abstractmethod
|
96
|
+
def _register(self, section: str, data: Dict[str, Any]) -> None:
|
97
|
+
"""
|
98
|
+
Registers a configuration section.
|
99
|
+
|
100
|
+
Parameters
|
101
|
+
----------
|
102
|
+
section : str
|
103
|
+
The name of the configuration section.
|
104
|
+
data : Dict[str, Any]
|
105
|
+
The configuration data to register.
|
106
|
+
|
107
|
+
Raises
|
108
|
+
------
|
109
|
+
ValueError
|
110
|
+
If the section is already registered.
|
111
|
+
"""
|
112
|
+
pass
|
@@ -0,0 +1,33 @@
|
|
1
|
+
from abc import ABC, abstractmethod
|
2
|
+
from typing import Any, Optional
|
3
|
+
|
4
|
+
class IEnvironmentBootstrapper(ABC):
|
5
|
+
"""
|
6
|
+
Attributes
|
7
|
+
----------
|
8
|
+
_environment_vars : Dict[str, str]
|
9
|
+
A dictionary to store the loaded environment variables.
|
10
|
+
path : Path
|
11
|
+
The path to the `.env` file.
|
12
|
+
|
13
|
+
Methods
|
14
|
+
-------
|
15
|
+
_autoload()
|
16
|
+
Loads environment variables from the `.env` file or creates the file if it does not exist.
|
17
|
+
"""
|
18
|
+
|
19
|
+
@abstractmethod
|
20
|
+
def _autoload(self) -> None:
|
21
|
+
"""
|
22
|
+
Loads environment variables from the `.env` file or creates the file if it does not exist.
|
23
|
+
|
24
|
+
This method checks if the `.env` file exists in the current working directory.
|
25
|
+
If the file does not exist, it creates an empty `.env` file. If the file exists,
|
26
|
+
it loads the environment variables into the `_environment_vars` dictionary.
|
27
|
+
|
28
|
+
Raises
|
29
|
+
------
|
30
|
+
PermissionError
|
31
|
+
If the `.env` file cannot be created or read due to insufficient permissions.
|
32
|
+
"""
|
33
|
+
pass
|
@@ -0,0 +1,37 @@
|
|
1
|
+
from abc import ABC, abstractmethod
|
2
|
+
from typing import Any, Optional
|
3
|
+
|
4
|
+
class IConfig(ABC):
|
5
|
+
|
6
|
+
@abstractmethod
|
7
|
+
def set(key: str, value: Any) -> None:
|
8
|
+
"""
|
9
|
+
Dynamically sets a configuration value using dot notation.
|
10
|
+
|
11
|
+
Parameters
|
12
|
+
----------
|
13
|
+
key : str
|
14
|
+
The configuration key (e.g., 'app.debug').
|
15
|
+
value : Any
|
16
|
+
The value to set.
|
17
|
+
"""
|
18
|
+
pass
|
19
|
+
|
20
|
+
@abstractmethod
|
21
|
+
def get(key: str, default: Optional[Any] = None) -> Any:
|
22
|
+
"""
|
23
|
+
Retrieves a configuration value using dot notation.
|
24
|
+
|
25
|
+
Parameters
|
26
|
+
----------
|
27
|
+
key : str
|
28
|
+
The configuration key (e.g., 'app.debug').
|
29
|
+
default : Optional[Any]
|
30
|
+
The default value to return if the key is not found.
|
31
|
+
|
32
|
+
Returns
|
33
|
+
-------
|
34
|
+
Any
|
35
|
+
The configuration value or the default value if the key is not found.
|
36
|
+
"""
|
37
|
+
pass
|
@@ -0,0 +1,40 @@
|
|
1
|
+
|
2
|
+
from abc import ABC, abstractmethod
|
3
|
+
|
4
|
+
class IEnv(ABC):
|
5
|
+
"""
|
6
|
+
A facade class for accessing environment variables.
|
7
|
+
|
8
|
+
This class provides a static method to retrieve environment variables
|
9
|
+
stored in the application context. It implements the `IEnv` interface.
|
10
|
+
|
11
|
+
Methods
|
12
|
+
-------
|
13
|
+
get(key: str, default=None) -> str
|
14
|
+
Retrieves the value of an environment variable.
|
15
|
+
"""
|
16
|
+
|
17
|
+
@abstractmethod
|
18
|
+
def get(key: str, default=None) -> str:
|
19
|
+
"""
|
20
|
+
Retrieves the value of an environment variable.
|
21
|
+
|
22
|
+
This method provides a convenient way to access environment variables
|
23
|
+
stored in the application context. If the variable does not exist, it
|
24
|
+
returns the specified default value.
|
25
|
+
|
26
|
+
Parameters
|
27
|
+
----------
|
28
|
+
key : str
|
29
|
+
The name of the environment variable to retrieve.
|
30
|
+
default : Any, optional
|
31
|
+
The default value to return if the environment variable does not exist.
|
32
|
+
Defaults to None.
|
33
|
+
|
34
|
+
Returns
|
35
|
+
-------
|
36
|
+
str
|
37
|
+
The value of the environment variable, or the default value if the variable
|
38
|
+
does not exist.
|
39
|
+
"""
|
40
|
+
pass
|
orionis/{luminate/contracts/facades/paths_interface.py → contracts/facades/files/i_path_facade.py}
RENAMED
@@ -1,25 +1,32 @@
|
|
1
1
|
from abc import ABC, abstractmethod
|
2
2
|
|
3
3
|
class IPath(ABC):
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
4
|
+
"""
|
5
|
+
A facade class for resolving absolute paths to various application directories.
|
6
|
+
|
7
|
+
This class provides static methods to resolve paths to common directories such as
|
8
|
+
'app', 'config', 'database', 'resources', 'routes', 'storage', and 'tests'.
|
9
|
+
It uses the `PathService` to resolve and validate paths.
|
10
|
+
|
11
|
+
Methods
|
12
|
+
-------
|
13
|
+
_resolve_directory(directory: str, file: str = None) -> SkeletonPath
|
14
|
+
Resolves the absolute path for a given directory and optional file.
|
15
|
+
app(file: str = None) -> SkeletonPath
|
16
|
+
Returns the absolute path for a file inside the 'app' directory.
|
17
|
+
config(file: str = None) -> SkeletonPath
|
18
|
+
Returns the absolute path for a file inside the 'config' directory.
|
19
|
+
database(file: str = None) -> SkeletonPath
|
20
|
+
Returns the absolute path for a file inside the 'database' directory.
|
21
|
+
resource(file: str = None) -> SkeletonPath
|
22
|
+
Returns the absolute path for a file inside the 'resource' directory.
|
23
|
+
routes(file: str = None) -> SkeletonPath
|
24
|
+
Returns the absolute path for a file inside the 'routes' directory.
|
25
|
+
storage(file: str = None) -> SkeletonPath
|
26
|
+
Returns the absolute path for a file inside the 'storage' directory.
|
27
|
+
tests(file: str = None) -> SkeletonPath
|
28
|
+
Returns the absolute path for a file inside the 'tests' directory.
|
29
|
+
"""
|
23
30
|
|
24
31
|
@abstractmethod
|
25
32
|
def app(file: str = None):
|
@@ -138,4 +145,4 @@ class IPath(ABC):
|
|
138
145
|
SkeletonPath
|
139
146
|
The resolved path wrapped in a SkeletonPath object.
|
140
147
|
"""
|
141
|
-
pass
|
148
|
+
pass
|
@@ -0,0 +1,83 @@
|
|
1
|
+
from abc import ABC, abstractmethod
|
2
|
+
|
3
|
+
class ILog(ABC):
|
4
|
+
"""
|
5
|
+
A facade class for logging messages with different severity levels.
|
6
|
+
|
7
|
+
This class provides static methods to log messages using the `LogguerService`.
|
8
|
+
It simplifies the process of logging by abstracting the service resolution
|
9
|
+
and providing a clean interface for logging.
|
10
|
+
|
11
|
+
Methods
|
12
|
+
-------
|
13
|
+
info(message: str) -> None
|
14
|
+
Logs an informational message.
|
15
|
+
error(message: str) -> None
|
16
|
+
Logs an error message.
|
17
|
+
success(message: str) -> None
|
18
|
+
Logs a success message.
|
19
|
+
warning(message: str) -> None
|
20
|
+
Logs a warning message.
|
21
|
+
debug(message: str) -> None
|
22
|
+
Logs a debug message.
|
23
|
+
"""
|
24
|
+
|
25
|
+
@abstractmethod
|
26
|
+
def info(message: str) -> None:
|
27
|
+
"""
|
28
|
+
Logs an informational message.
|
29
|
+
|
30
|
+
Parameters
|
31
|
+
----------
|
32
|
+
message : str
|
33
|
+
The message to log.
|
34
|
+
"""
|
35
|
+
pass
|
36
|
+
|
37
|
+
@abstractmethod
|
38
|
+
def error(message: str) -> None:
|
39
|
+
"""
|
40
|
+
Logs an error message.
|
41
|
+
|
42
|
+
Parameters
|
43
|
+
----------
|
44
|
+
message : str
|
45
|
+
The message to log.
|
46
|
+
"""
|
47
|
+
pass
|
48
|
+
|
49
|
+
@abstractmethod
|
50
|
+
def success(message: str) -> None:
|
51
|
+
"""
|
52
|
+
Logs a success message.
|
53
|
+
|
54
|
+
Parameters
|
55
|
+
----------
|
56
|
+
message : str
|
57
|
+
The message to log.
|
58
|
+
"""
|
59
|
+
pass
|
60
|
+
|
61
|
+
@abstractmethod
|
62
|
+
def warning(message: str) -> None:
|
63
|
+
"""
|
64
|
+
Logs a warning message.
|
65
|
+
|
66
|
+
Parameters
|
67
|
+
----------
|
68
|
+
message : str
|
69
|
+
The message to log.
|
70
|
+
"""
|
71
|
+
pass
|
72
|
+
|
73
|
+
@abstractmethod
|
74
|
+
def debug(message: str) -> None:
|
75
|
+
"""
|
76
|
+
Logs a debug message.
|
77
|
+
|
78
|
+
Parameters
|
79
|
+
----------
|
80
|
+
message : str
|
81
|
+
The message to log.
|
82
|
+
"""
|
83
|
+
pass
|
orionis/{luminate/contracts/facades/tests_interface.py → contracts/facades/tests/i_tests_facade.py}
RENAMED
@@ -2,16 +2,13 @@ from abc import ABC, abstractmethod
|
|
2
2
|
|
3
3
|
class IUnitTests(ABC):
|
4
4
|
"""
|
5
|
-
Interface for executing unit tests
|
6
|
-
|
7
|
-
This class defines the abstract structure for any unit test executor,
|
8
|
-
enforcing the implementation of the 'execute' method in any subclass.
|
5
|
+
Interface for executing unit tests based on a specified pattern.
|
9
6
|
|
10
7
|
Methods
|
11
8
|
-------
|
12
9
|
execute(pattern: str) -> dict
|
13
|
-
Executes
|
14
|
-
|
10
|
+
Executes unit tests by iterating over the 'tests' directory and its subdirectories,
|
11
|
+
matching test files based on the provided pattern.
|
15
12
|
"""
|
16
13
|
|
17
14
|
@abstractmethod
|
@@ -1,28 +1,30 @@
|
|
1
|
+
|
1
2
|
from abc import ABC, abstractmethod
|
2
3
|
|
3
|
-
class
|
4
|
+
class IInstallerManager(ABC):
|
4
5
|
"""
|
5
|
-
Interface
|
6
|
-
|
7
|
-
This interface ensures that any implementing class provides methods for
|
8
|
-
displaying the framework version, upgrading the framework, creating a new
|
9
|
-
application, and displaying additional information.
|
6
|
+
Interface for the InstallerManager class.
|
10
7
|
"""
|
11
8
|
|
12
9
|
@abstractmethod
|
13
|
-
def
|
10
|
+
def handleVersion(self) -> str:
|
14
11
|
"""
|
15
|
-
Display the current version of the framework.
|
12
|
+
Display the current version of the framework in ASCII format.
|
16
13
|
|
17
14
|
Returns
|
18
15
|
-------
|
19
16
|
str
|
20
17
|
The ASCII representation of the framework version.
|
18
|
+
|
19
|
+
Raises
|
20
|
+
------
|
21
|
+
Exception
|
22
|
+
If an error occurs while generating the ASCII version output.
|
21
23
|
"""
|
22
24
|
pass
|
23
25
|
|
24
26
|
@abstractmethod
|
25
|
-
def
|
27
|
+
def handleUpgrade(self) -> None:
|
26
28
|
"""
|
27
29
|
Execute the framework upgrade process to the latest version.
|
28
30
|
|
@@ -33,15 +35,16 @@ class IManagement(ABC):
|
|
33
35
|
"""
|
34
36
|
pass
|
35
37
|
|
38
|
+
|
36
39
|
@abstractmethod
|
37
|
-
def
|
40
|
+
def handleNewApp(self, name_app: str = "example-app") -> None:
|
38
41
|
"""
|
39
|
-
Create a new application with the
|
42
|
+
Create a new application with the specified name.
|
40
43
|
|
41
44
|
Parameters
|
42
45
|
----------
|
43
|
-
name_app : str
|
44
|
-
The name of the new application.
|
46
|
+
name_app : str, optional
|
47
|
+
The name of the new application (default is "example-app").
|
45
48
|
|
46
49
|
Raises
|
47
50
|
------
|
@@ -51,13 +54,13 @@ class IManagement(ABC):
|
|
51
54
|
pass
|
52
55
|
|
53
56
|
@abstractmethod
|
54
|
-
def
|
57
|
+
def handleInfo(self) -> None:
|
55
58
|
"""
|
56
|
-
Display additional information
|
59
|
+
Display additional framework information in ASCII format.
|
57
60
|
|
58
61
|
Raises
|
59
62
|
------
|
60
63
|
Exception
|
61
64
|
If an error occurs while displaying information.
|
62
65
|
"""
|
63
|
-
pass
|
66
|
+
pass
|