orionis 0.24.0__py3-none-any.whl → 0.26.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- orionis/framework.py +1 -1
- orionis/luminate/app.py +6 -0
- orionis/luminate/bootstrap/cli_exception.py +54 -0
- orionis/luminate/bootstrap/commands/bootstrapper.py +99 -0
- orionis/luminate/{console → bootstrap/commands}/register.py +7 -13
- orionis/luminate/bootstrap/config/bootstrapper.py +20 -52
- orionis/luminate/cache/app/config.py +14 -7
- orionis/luminate/cache/console/commands.py +20 -21
- orionis/luminate/console/base/command.py +1 -1
- orionis/luminate/console/commands/cache_clear.py +3 -4
- orionis/luminate/console/commands/help.py +3 -4
- orionis/luminate/console/commands/schedule_work.py +3 -4
- orionis/luminate/console/commands/tests.py +3 -4
- orionis/luminate/console/commands/version.py +3 -4
- orionis/luminate/console/exceptions/cli_exception.py +43 -0
- orionis/luminate/console/kernel.py +1 -1
- orionis/luminate/console/output/console.py +1 -1
- orionis/luminate/console/output/executor.py +1 -1
- orionis/luminate/console/output/progress_bar.py +1 -1
- orionis/luminate/console/scripts/management.py +1 -1
- orionis/luminate/console/tasks/scheduler.py +1 -1
- orionis/luminate/container/container.py +19 -22
- orionis/luminate/contracts/bootstrap/commands/bootstrapper_interface.py +44 -0
- orionis/luminate/contracts/{console → bootstrap/commands}/register_interface.py +2 -1
- orionis/luminate/contracts/bootstrap/config/bootstrapper_interface.py +0 -24
- orionis/luminate/contracts/cache/app/config_interface.py +76 -0
- orionis/luminate/contracts/cache/{cache_commands_interface.py → console/commands_interface.py} +14 -5
- {orionis-0.24.0.dist-info → orionis-0.26.0.dist-info}/METADATA +1 -1
- {orionis-0.24.0.dist-info → orionis-0.26.0.dist-info}/RECORD +39 -37
- orionis/luminate/console/cache.py +0 -132
- orionis/luminate/contracts/console/cli_cache_interface.py +0 -34
- /orionis/luminate/contracts/console/{base_command_interface.py → base/base_command_interface.py} +0 -0
- /orionis/luminate/contracts/console/{console_interface.py → output/console_interface.py} +0 -0
- /orionis/luminate/contracts/console/{executor_interface.py → output/executor_interface.py} +0 -0
- /orionis/luminate/contracts/console/{progress_bar_interface.py → output/progress_bar_interface.py} +0 -0
- /orionis/luminate/contracts/console/{management_interface.py → scripts/management_interface.py} +0 -0
- /orionis/luminate/contracts/console/{schedule_interface.py → tasks/schedule_interface.py} +0 -0
- {orionis-0.24.0.dist-info → orionis-0.26.0.dist-info}/LICENCE +0 -0
- {orionis-0.24.0.dist-info → orionis-0.26.0.dist-info}/WHEEL +0 -0
- {orionis-0.24.0.dist-info → orionis-0.26.0.dist-info}/entry_points.txt +0 -0
- {orionis-0.24.0.dist-info → orionis-0.26.0.dist-info}/top_level.txt +0 -0
@@ -64,10 +64,7 @@ class Container(IContainer):
|
|
64
64
|
If the class is defined in the main module.
|
65
65
|
"""
|
66
66
|
if concrete.__module__ == "__main__":
|
67
|
-
raise OrionisContainerValueError(
|
68
|
-
"Cannot register a class from the main module in the container."
|
69
|
-
)
|
70
|
-
return f"{concrete.__module__}.{concrete.__name__}"
|
67
|
+
raise OrionisContainerValueError("Cannot register a class from the main module in the container.")
|
71
68
|
|
72
69
|
def _ensureUniqueService(self, obj: Any) -> None:
|
73
70
|
"""
|
@@ -101,9 +98,7 @@ class Container(IContainer):
|
|
101
98
|
If the implementation is not callable.
|
102
99
|
"""
|
103
100
|
if not callable(concrete):
|
104
|
-
raise OrionisContainerTypeError(
|
105
|
-
f"The implementation '{str(concrete)}' must be callable or an instantiable class."
|
106
|
-
)
|
101
|
+
raise OrionisContainerTypeError(f"The implementation '{str(concrete)}' must be callable or an instantiable class.")
|
107
102
|
|
108
103
|
def _ensureIsInstance(self, instance: Any) -> None:
|
109
104
|
"""
|
@@ -120,9 +115,7 @@ class Container(IContainer):
|
|
120
115
|
If the instance is not a valid object.
|
121
116
|
"""
|
122
117
|
if not isinstance(instance, object) or instance.__class__.__module__ in ['builtins', 'abc']:
|
123
|
-
raise OrionisContainerValueError(
|
124
|
-
f"The instance '{str(instance)}' must be a valid object."
|
125
|
-
)
|
118
|
+
raise OrionisContainerValueError(f"The instance '{str(instance)}' must be a valid object.")
|
126
119
|
|
127
120
|
def bind(self, concrete: Callable[..., Any]) -> str:
|
128
121
|
"""
|
@@ -142,7 +135,7 @@ class Container(IContainer):
|
|
142
135
|
|
143
136
|
key = f"{concrete.__module__}.{concrete.__name__}"
|
144
137
|
self._bindings[key] = {
|
145
|
-
'
|
138
|
+
'concrete': concrete,
|
146
139
|
'module': concrete.__module__,
|
147
140
|
'name': concrete.__name__,
|
148
141
|
'type': BINDING
|
@@ -165,7 +158,7 @@ class Container(IContainer):
|
|
165
158
|
|
166
159
|
key = f"{concrete.__module__}.{concrete.__name__}"
|
167
160
|
self._transients[key] = {
|
168
|
-
'
|
161
|
+
'concrete': concrete,
|
169
162
|
'module': concrete.__module__,
|
170
163
|
'name': concrete.__name__,
|
171
164
|
'type': TRANSIENT
|
@@ -190,7 +183,7 @@ class Container(IContainer):
|
|
190
183
|
|
191
184
|
key = f"{concrete.__module__}.{concrete.__name__}"
|
192
185
|
self._singletons[key] = {
|
193
|
-
'
|
186
|
+
'concrete': concrete,
|
194
187
|
'module': concrete.__module__,
|
195
188
|
'name': concrete.__name__,
|
196
189
|
'type': SINGLETON
|
@@ -215,7 +208,7 @@ class Container(IContainer):
|
|
215
208
|
|
216
209
|
key = f"{concrete.__module__}.{concrete.__name__}"
|
217
210
|
self._scoped_services[key] = {
|
218
|
-
'
|
211
|
+
'concrete': concrete,
|
219
212
|
'module': concrete.__module__,
|
220
213
|
'name': concrete.__name__,
|
221
214
|
'type': SCOPED
|
@@ -325,19 +318,19 @@ class Container(IContainer):
|
|
325
318
|
return self._instances[key]['instance']
|
326
319
|
|
327
320
|
if key in self._singletons:
|
328
|
-
self._instances[key] = {'instance': self._resolve(self._singletons[key]['
|
321
|
+
self._instances[key] = {'instance': self._resolve(self._singletons[key]['concrete'])}
|
329
322
|
return self._instances[key]['instance']
|
330
323
|
|
331
324
|
if key in self._scoped_services:
|
332
325
|
if key not in self._scoped_instances:
|
333
|
-
self._scoped_instances[key] = self._resolve(self._scoped_services[key]['
|
326
|
+
self._scoped_instances[key] = self._resolve(self._scoped_services[key]['concrete'])
|
334
327
|
return self._scoped_instances[key]
|
335
328
|
|
336
329
|
if key in self._transients:
|
337
|
-
return self._resolve(self._transients[key]['
|
330
|
+
return self._resolve(self._transients[key]['concrete'])
|
338
331
|
|
339
332
|
if key in self._bindings:
|
340
|
-
return self._resolve(self._bindings[key]['
|
333
|
+
return self._resolve(self._bindings[key]['concrete'])
|
341
334
|
|
342
335
|
raise OrionisContainerException(f"Service '{abstract}' is not registered in the container.")
|
343
336
|
|
@@ -362,8 +355,9 @@ class Container(IContainer):
|
|
362
355
|
|
363
356
|
# Step 3: Iterate through the parameters of the constructor.
|
364
357
|
for param_name, param in signature.parameters.items():
|
358
|
+
|
359
|
+
# Skip 'self' in methods
|
365
360
|
if param_name == 'self':
|
366
|
-
# Skip 'self' in methods
|
367
361
|
continue
|
368
362
|
|
369
363
|
# If parameter has no annotation and no default value, it's unresolved
|
@@ -374,15 +368,19 @@ class Container(IContainer):
|
|
374
368
|
# Resolve dependencies based on annotations (excluding primitive types)
|
375
369
|
if param.annotation is not param.empty:
|
376
370
|
param_type = param.annotation
|
371
|
+
|
377
372
|
# Check if it's a registered service, if so, resolve it through the container
|
378
373
|
if isinstance(param_type, type) and not isinstance(param_type, (int, str, bool, float)) and not issubclass(param_type, (int, str, bool, float)):
|
374
|
+
|
379
375
|
# Check if the service is registered in the container
|
380
376
|
if self.has(param_type):
|
381
377
|
resolved_dependencies[param_name] = self.make(f"{param_type.__module__}.{param_type.__name__}")
|
382
378
|
else:
|
383
379
|
resolved_dependencies[param_name] = self._resolve_dependency(param_type)
|
384
380
|
else:
|
385
|
-
|
381
|
+
|
382
|
+
# It's a primitive, use as-is
|
383
|
+
resolved_dependencies[param_name] = param_type
|
386
384
|
|
387
385
|
# Resolve parameters with default values (without annotations)
|
388
386
|
elif param.default is not param.empty:
|
@@ -407,8 +405,7 @@ class Container(IContainer):
|
|
407
405
|
This method looks for the type in the container and returns the instance,
|
408
406
|
respecting the lifecycle of the service (transient, singleton, etc.).
|
409
407
|
"""
|
410
|
-
# Check if the dependency exists in the container or create it if necessary
|
411
|
-
# If it's a class type
|
408
|
+
# Check if the dependency exists in the container or create it if necessary, If it's a class type
|
412
409
|
if isinstance(dep_type, type):
|
413
410
|
if self.has(dep_type):
|
414
411
|
# Resolves the service through the container
|
@@ -0,0 +1,44 @@
|
|
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,4 +1,5 @@
|
|
1
1
|
from abc import ABC, abstractmethod
|
2
|
+
from typing import Any, Callable
|
2
3
|
|
3
4
|
class IRegister(ABC):
|
4
5
|
"""
|
@@ -6,7 +7,7 @@ class IRegister(ABC):
|
|
6
7
|
"""
|
7
8
|
|
8
9
|
@abstractmethod
|
9
|
-
def command(self, command_class):
|
10
|
+
def command(self, command_class: Callable[..., Any]) -> None:
|
10
11
|
"""
|
11
12
|
Registers a command class after validating its structure.
|
12
13
|
|
@@ -12,35 +12,11 @@ class IBootstrapper(ABC):
|
|
12
12
|
|
13
13
|
Methods
|
14
14
|
-------
|
15
|
-
findClasses(file_path: str) -> List[str]
|
16
|
-
Parses a Python file to extract and return all defined class names.
|
17
|
-
|
18
15
|
autoload(directory: str) -> None
|
19
16
|
Scans a directory for Python files, imports them, finds configuration classes,
|
20
17
|
and registers them using the `Register` instance.
|
21
18
|
"""
|
22
19
|
|
23
|
-
@abstractmethod
|
24
|
-
def _definitions(self, file_path: str):
|
25
|
-
"""
|
26
|
-
Parses a Python file to extract and return all defined class names.
|
27
|
-
|
28
|
-
This method opens the file at the given path, parses it using the Abstract
|
29
|
-
Syntax Tree (AST) module to extract class definitions, and returns a
|
30
|
-
list of class names found within the file.
|
31
|
-
|
32
|
-
Parameters
|
33
|
-
----------
|
34
|
-
file_path : str
|
35
|
-
The path to the Python file to parse.
|
36
|
-
|
37
|
-
Returns
|
38
|
-
-------
|
39
|
-
List[str]
|
40
|
-
A list of class names defined in the provided Python file.
|
41
|
-
"""
|
42
|
-
pass
|
43
|
-
|
44
20
|
@abstractmethod
|
45
21
|
def _autoload(self, directory: str) -> None:
|
46
22
|
"""
|
@@ -0,0 +1,76 @@
|
|
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
|
orionis/luminate/contracts/cache/{cache_commands_interface.py → console/commands_interface.py}
RENAMED
@@ -1,15 +1,24 @@
|
|
1
1
|
from abc import ABC, abstractmethod
|
2
|
+
from typing import Any, Callable
|
2
3
|
|
3
4
|
class ICacheCommands(ABC):
|
4
5
|
"""
|
5
|
-
|
6
|
+
CacheCommands is a class that manages the registration, unregistration, and retrieval of command instances.
|
6
7
|
|
7
|
-
|
8
|
-
|
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.
|
9
18
|
"""
|
10
19
|
|
11
20
|
@abstractmethod
|
12
|
-
def register(self, signature: str, description: str,
|
21
|
+
def register(self, signature: str, description: str, arguments: list, concrete: Callable[..., Any]):
|
13
22
|
"""
|
14
23
|
Register a new command with its signature, description, and class instance.
|
15
24
|
|
@@ -19,7 +28,7 @@ class ICacheCommands(ABC):
|
|
19
28
|
The unique identifier (signature) for the command.
|
20
29
|
description : str
|
21
30
|
A brief description of what the command does.
|
22
|
-
|
31
|
+
concrete : class
|
23
32
|
The class or callable instance that defines the command behavior.
|
24
33
|
|
25
34
|
Raises
|
@@ -1,18 +1,21 @@
|
|
1
1
|
orionis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
orionis/cli_manager.py,sha256=9wNVJxB0HyqUbNesUvkwlsqTyUbZwK6R46iVLE5WVBQ,1715
|
3
|
-
orionis/framework.py,sha256=
|
3
|
+
orionis/framework.py,sha256=C_6r_m1L-u726uOgo7uSaFeWWG4ncGyPicnqt-KhKYw,1386
|
4
4
|
orionis/luminate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
orionis/luminate/app.py,sha256=
|
5
|
+
orionis/luminate/app.py,sha256=fh5p0w5VBb0zJ6qKNHOCs2vxIix6AborENZFW_GCvrw,152
|
6
6
|
orionis/luminate/bootstrap/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
+
orionis/luminate/bootstrap/cli_exception.py,sha256=wDKfEW295c7-bavr7YUHK2CLYcTSZgjT9ZRSBne6GOE,1356
|
8
|
+
orionis/luminate/bootstrap/commands/bootstrapper.py,sha256=0TtExkxyokfMSooR5-RieOQKiIt8dY_iodT_WA_Ncpc,3874
|
9
|
+
orionis/luminate/bootstrap/commands/register.py,sha256=YonMvfe1TQBVPLxqM7o7_mYaXPKoXvZNRSsW365uVtM,3734
|
7
10
|
orionis/luminate/bootstrap/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
-
orionis/luminate/bootstrap/config/bootstrapper.py,sha256=
|
11
|
+
orionis/luminate/bootstrap/config/bootstrapper.py,sha256=PtmZJIH8sHVOdGIogLlqTuPD0XZvR2DgOnPZDgSng9o,2971
|
9
12
|
orionis/luminate/bootstrap/config/parser.py,sha256=Ay8dh3aax9xhVgeLSHT71ubtZJiKAJAP85dLFF7djyA,1950
|
10
13
|
orionis/luminate/bootstrap/config/register.py,sha256=uX0XGEWdo3iJou5B96vxvhZEjliTGC1HBaT8w9enMmk,2760
|
11
14
|
orionis/luminate/cache/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
15
|
orionis/luminate/cache/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
|
-
orionis/luminate/cache/app/config.py,sha256=
|
16
|
+
orionis/luminate/cache/app/config.py,sha256=nhw9p7NUAC76Cl7secT5qWT5btRWSWBGHNctS4jxqok,2830
|
14
17
|
orionis/luminate/cache/console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
15
|
-
orionis/luminate/cache/console/commands.py,sha256=
|
18
|
+
orionis/luminate/cache/console/commands.py,sha256=NG-QWcOEC0iWuxwifKt5AeONljQ0JShmQhJhtrWDl_8,3237
|
16
19
|
orionis/luminate/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17
20
|
orionis/luminate/config/environment.py,sha256=QhiyZNnngh9Ol-SPIHIep4D3YCzVMxoMgCXeJjxV9FU,3301
|
18
21
|
orionis/luminate/config/dataclass/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -27,59 +30,58 @@ orionis/luminate/config/dataclass/mail.py,sha256=3iYXG72bXiVns4sEPZ_A3-cGcFjGEGD
|
|
27
30
|
orionis/luminate/config/dataclass/queue.py,sha256=DYjP5zD09ISsIX117wtOfjiG_iQrcrPoQVeeftmuO3c,1739
|
28
31
|
orionis/luminate/config/dataclass/session.py,sha256=7mOC_DfGIBDqAClSiewHoTA9Kht_zdHApvALcZc7cfY,1861
|
29
32
|
orionis/luminate/console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
30
|
-
orionis/luminate/console/cache.py,sha256=GuiCYaiU8fHTcPZauSOJJeXbRM6aau2PmDuJ00uD8kA,5125
|
31
33
|
orionis/luminate/console/command.py,sha256=bSFFniZds1L_GKPcotfQZlt8m-GKByvfZR1deTMLPb8,1381
|
32
34
|
orionis/luminate/console/command_filter.py,sha256=kSyIn2WMKsHdXfOS4EfUVO_sn0LSSU75YXeoIGgI3uk,1352
|
33
|
-
orionis/luminate/console/kernel.py,sha256=
|
35
|
+
orionis/luminate/console/kernel.py,sha256=6WeCLB42dN_vHmvJxX_XdUWPj2tD23oSXJh5DzdivDo,994
|
34
36
|
orionis/luminate/console/parser.py,sha256=WXdmaNQElF5revyzPXaKYSQfF6coS7PJ9jE-3SXX7PQ,5596
|
35
|
-
orionis/luminate/console/register.py,sha256=VXehiDD7nxvDl-XIYzquummeuhz0gQebKi1sGG-QiOU,3793
|
36
37
|
orionis/luminate/console/runner.py,sha256=M3S1gtiOldR8TlUCP2ocgeixyahtAieaXegBezG2CF0,4626
|
37
38
|
orionis/luminate/console/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
38
|
-
orionis/luminate/console/base/command.py,sha256=
|
39
|
+
orionis/luminate/console/base/command.py,sha256=M8mMzH-7CZWOqcLehVVOxAyh6YN5cddc-QbIYjOFjcU,12726
|
39
40
|
orionis/luminate/console/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
40
|
-
orionis/luminate/console/commands/cache_clear.py,sha256=
|
41
|
-
orionis/luminate/console/commands/help.py,sha256=
|
42
|
-
orionis/luminate/console/commands/schedule_work.py,sha256=
|
43
|
-
orionis/luminate/console/commands/tests.py,sha256=
|
44
|
-
orionis/luminate/console/commands/version.py,sha256=
|
41
|
+
orionis/luminate/console/commands/cache_clear.py,sha256=3Hapq-xY85uUkr5gVCmWvkVry5UFDBqIsuXTdG8ehw4,2246
|
42
|
+
orionis/luminate/console/commands/help.py,sha256=MKPhaQMFSkcBvwtkRguQ9b2ieH02kvCrV0CcSqHLPSE,2058
|
43
|
+
orionis/luminate/console/commands/schedule_work.py,sha256=OtU1FzvBxITGWr0PvSGrm4QSinnBNwkgRVnN_PpEBs8,1861
|
44
|
+
orionis/luminate/console/commands/tests.py,sha256=PtXxMmk3380yFVnQqPL13Og_3L6PsEueW4vxqtzKSJA,1424
|
45
|
+
orionis/luminate/console/commands/version.py,sha256=oM5Vr_2Xc7Eaq6VHbcMaTeteY0cDvdvC_hUoRyzEVMc,1259
|
45
46
|
orionis/luminate/console/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
46
|
-
orionis/luminate/console/exceptions/cli_exception.py,sha256=
|
47
|
+
orionis/luminate/console/exceptions/cli_exception.py,sha256=QM7tRdPBoo7WdmAb3Zasj8d3429zskftUGYHAvhcnSU,4631
|
47
48
|
orionis/luminate/console/output/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
48
|
-
orionis/luminate/console/output/console.py,sha256=
|
49
|
-
orionis/luminate/console/output/executor.py,sha256=
|
50
|
-
orionis/luminate/console/output/progress_bar.py,sha256=
|
49
|
+
orionis/luminate/console/output/console.py,sha256=KTQKMpVVOdCsGUxrKRSQzlqmz42wwWV-8b14q_mfrYI,14481
|
50
|
+
orionis/luminate/console/output/executor.py,sha256=J4lmWMRCXW2b5L8PbX31q1fGnnjYZOO93O4rtPyA_0A,3379
|
51
|
+
orionis/luminate/console/output/progress_bar.py,sha256=YT8Gl-_Zfc3E6foU-Dw7aAndZm4m-xY36G3MpPi3Aj4,3106
|
51
52
|
orionis/luminate/console/output/styles.py,sha256=fF_B1kw95lkiLUzq4cjYPppF-sLsx9_qmyhKqoeZrJ0,3604
|
52
53
|
orionis/luminate/console/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
53
|
-
orionis/luminate/console/scripts/management.py,sha256=
|
54
|
+
orionis/luminate/console/scripts/management.py,sha256=J5gLXtvX8I1zdNk6sa23njR18D5s4LJXZK7ElK0sFzI,2868
|
54
55
|
orionis/luminate/console/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
55
|
-
orionis/luminate/console/tasks/scheduler.py,sha256=
|
56
|
-
orionis/luminate/container/container.py,sha256=
|
56
|
+
orionis/luminate/console/tasks/scheduler.py,sha256=CUmv9ap7zq3IWVTPtpPBZ-x166jsj1e0lTvw3didUQM,22692
|
57
|
+
orionis/luminate/container/container.py,sha256=GMUsyKmlqzmsjJeMTYlwOzleEBWzTqlEyX-jLtZu9M8,16069
|
57
58
|
orionis/luminate/container/exception.py,sha256=ap1SqYEjQEEHXJJTNmL7V1jrmRjgT5_7geZ95MYkhMA,1691
|
58
59
|
orionis/luminate/container/types.py,sha256=PbPNOJ8e4SGzCmu-zOmCQmDzt1b9I73v3fw_xzLq9RU,932
|
59
60
|
orionis/luminate/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
60
|
-
orionis/luminate/contracts/bootstrap/
|
61
|
+
orionis/luminate/contracts/bootstrap/commands/bootstrapper_interface.py,sha256=z9x6yW205hta-OT1u_CHF0VWHIe0T6M0EWZ5RHHpXLU,1632
|
62
|
+
orionis/luminate/contracts/bootstrap/commands/register_interface.py,sha256=witwBVJtDPpNRxOWhz1OeDjOnDzp1D_EJSIXa_AcjTg,881
|
63
|
+
orionis/luminate/contracts/bootstrap/config/bootstrapper_interface.py,sha256=NQgPgm_vlZna1nPvOaEWWeJC1uzUvoGM8fjVHVE8EtY,1480
|
61
64
|
orionis/luminate/contracts/bootstrap/config/parser_interface.py,sha256=7DLnp7yB7edayVkSm-piTi8JSf0QKaYYI82qDZudgM0,1641
|
62
65
|
orionis/luminate/contracts/bootstrap/config/register_interface.py,sha256=7kMW04ptvQ51PnprtCIR-iLHljVSGiH58GN493igeuw,1506
|
63
66
|
orionis/luminate/contracts/cache/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
64
|
-
orionis/luminate/contracts/cache/
|
67
|
+
orionis/luminate/contracts/cache/app/config_interface.py,sha256=jOD-h6b41GYmIAZ6DO-2MIG4BM8RVoK_kQRPCJPaFjg,2118
|
68
|
+
orionis/luminate/contracts/cache/console/commands_interface.py,sha256=pmPe22OiWguu-b9s0VcS_e1ryr4I4Dz6H7-mdfnQN40,2407
|
65
69
|
orionis/luminate/contracts/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
66
70
|
orionis/luminate/contracts/config/config_interface.py,sha256=rbeojO2gm8XhSXIPY8EnUt4e0wO633OKF9Nx_tN5y60,785
|
67
71
|
orionis/luminate/contracts/config/environment_interface.py,sha256=a59CXhwEzQDnyhmPhsnWGranqFYJV8c5JpA6o6FIya4,1672
|
68
72
|
orionis/luminate/contracts/console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
69
|
-
orionis/luminate/contracts/console/base_command_interface.py,sha256=Lz0ktEjeXcqU5803BVIDT8H3fhbvfkd3Ngsa561lrZY,12241
|
70
|
-
orionis/luminate/contracts/console/cli_cache_interface.py,sha256=U39BOuEpneOnBGxrvCCyCy-lYGaCOMiMOTCYzh1xMhg,1160
|
71
73
|
orionis/luminate/contracts/console/command_filter_interface.py,sha256=g66AlKNjTyQfdarO23r27nFqwiCnrP6kjaZ7tUGql-c,937
|
72
74
|
orionis/luminate/contracts/console/command_interface.py,sha256=B5ete_yox0pcprdL0VmCPgOu3QW9y8vEd2UMOFy8_10,1208
|
73
|
-
orionis/luminate/contracts/console/console_interface.py,sha256=NL6GsbJy286y0wcWhAhqavC6G2EW_WZJYQdH9wMO8Vc,8517
|
74
|
-
orionis/luminate/contracts/console/executor_interface.py,sha256=MGMTTPSwF8dgCjHD3A4CKtYDaCcD-KU28dorC61Q04k,1411
|
75
75
|
orionis/luminate/contracts/console/kernel_interface.py,sha256=GtiGlWe7EQ9aeChHpQ-GlIJlJ5tEqpZYYkjNcrwXI94,945
|
76
|
-
orionis/luminate/contracts/console/management_interface.py,sha256=4Zc8da5iz3kHZju61A0krArKVZ5K39B0Imk1GmgTMks,1586
|
77
76
|
orionis/luminate/contracts/console/parser_interface.py,sha256=vMmTK0wMfTjt7H-tRf-WRLI8R-ghUzJauctwtgj0jFU,2082
|
78
|
-
orionis/luminate/contracts/console/progress_bar_interface.py,sha256=sOkQzQsliFemqZHMyzs4fWhNJfXDTk5KH3aExReetSE,1760
|
79
|
-
orionis/luminate/contracts/console/register_interface.py,sha256=rhHI_as_3yNWtdgQvwJb0NyNUfzAZDCJrqgPgpzjoAQ,819
|
80
77
|
orionis/luminate/contracts/console/runner_interface.py,sha256=vWLtMhl0m1T6rfCUHZbxGQJl9ZWTXlp3HjcTfCAztGk,1644
|
81
|
-
orionis/luminate/contracts/console/schedule_interface.py,sha256=_dsR0gCvJ7_67lwPUAzBwQFHNvWM6jVjcg1EdPqDIIo,10117
|
82
78
|
orionis/luminate/contracts/console/task_manager_interface.py,sha256=sOmeifoncpWCG2WYh4q3QZ7M7w7P9Onb3Jxw9X2lpXE,1197
|
79
|
+
orionis/luminate/contracts/console/base/base_command_interface.py,sha256=Lz0ktEjeXcqU5803BVIDT8H3fhbvfkd3Ngsa561lrZY,12241
|
80
|
+
orionis/luminate/contracts/console/output/console_interface.py,sha256=NL6GsbJy286y0wcWhAhqavC6G2EW_WZJYQdH9wMO8Vc,8517
|
81
|
+
orionis/luminate/contracts/console/output/executor_interface.py,sha256=MGMTTPSwF8dgCjHD3A4CKtYDaCcD-KU28dorC61Q04k,1411
|
82
|
+
orionis/luminate/contracts/console/output/progress_bar_interface.py,sha256=sOkQzQsliFemqZHMyzs4fWhNJfXDTk5KH3aExReetSE,1760
|
83
|
+
orionis/luminate/contracts/console/scripts/management_interface.py,sha256=4Zc8da5iz3kHZju61A0krArKVZ5K39B0Imk1GmgTMks,1586
|
84
|
+
orionis/luminate/contracts/console/tasks/schedule_interface.py,sha256=_dsR0gCvJ7_67lwPUAzBwQFHNvWM6jVjcg1EdPqDIIo,10117
|
83
85
|
orionis/luminate/contracts/container/container_interface.py,sha256=c_QRQHXGIujiDnYXyt--3J2LKXngVtoB3O-qchPmFDQ,6899
|
84
86
|
orionis/luminate/contracts/container/types_interface.py,sha256=GCH7x3PjpXKPET3l84GcXbcM8cpne8AGrmTw-uFaT24,526
|
85
87
|
orionis/luminate/contracts/facades/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -140,9 +142,9 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
140
142
|
tests/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
141
143
|
tests/tools/class_example.py,sha256=dIPD997Y15n6WmKhWoOFSwEldRm9MdOHTZZ49eF1p3c,1056
|
142
144
|
tests/tools/test_reflection.py,sha256=dNN5p_xAosyEf0ddAElmmmTfhcTtBd4zBNl7qzgnsc0,5242
|
143
|
-
orionis-0.
|
144
|
-
orionis-0.
|
145
|
-
orionis-0.
|
146
|
-
orionis-0.
|
147
|
-
orionis-0.
|
148
|
-
orionis-0.
|
145
|
+
orionis-0.26.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
|
146
|
+
orionis-0.26.0.dist-info/METADATA,sha256=obHD75IlsEwzGtfyvaJ5q2X6vsO3UkPk0OerwDtAwBQ,2978
|
147
|
+
orionis-0.26.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
148
|
+
orionis-0.26.0.dist-info/entry_points.txt,sha256=eef1_CVewfokKjrGBynXa06KabSJYo7LlDKKIKvs1cM,53
|
149
|
+
orionis-0.26.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
|
150
|
+
orionis-0.26.0.dist-info/RECORD,,
|
@@ -1,132 +0,0 @@
|
|
1
|
-
import os
|
2
|
-
from threading import Lock
|
3
|
-
from orionis.luminate.tools.reflection import Reflection
|
4
|
-
from orionis.luminate.cache.console.commands import CacheCommands
|
5
|
-
from orionis.luminate.contracts.console.cli_cache_interface import ICLICache
|
6
|
-
|
7
|
-
class CLICache(ICLICache):
|
8
|
-
"""
|
9
|
-
Singleton class responsible for managing the loading and execution of commands within the framework.
|
10
|
-
|
11
|
-
This class ensures that commands are loaded only once and are accessible for execution. It is designed to follow
|
12
|
-
the Singleton pattern, meaning only one instance of this class will exist in the application lifecycle.
|
13
|
-
|
14
|
-
Attributes
|
15
|
-
----------
|
16
|
-
_instance : CLICache
|
17
|
-
The singleton instance of the CLICache class.
|
18
|
-
_lock : threading.Lock
|
19
|
-
A lock used to ensure thread-safety during instance creation.
|
20
|
-
_initialized : bool
|
21
|
-
A flag indicating whether the class has been initialized.
|
22
|
-
paths : list
|
23
|
-
List of directories where commands are located.
|
24
|
-
|
25
|
-
Methods
|
26
|
-
-------
|
27
|
-
__new__ :
|
28
|
-
Creates and returns the singleton instance of the CLICache class.
|
29
|
-
__init__ :
|
30
|
-
Initializes the CLICache instance, loading commands if not already initialized.
|
31
|
-
_load_commands :
|
32
|
-
Loads command modules from predefined directories and imports them dynamically.
|
33
|
-
getCommands :
|
34
|
-
Returns the instance of CacheCommands containing the command cache.
|
35
|
-
"""
|
36
|
-
|
37
|
-
_instance = None
|
38
|
-
_lock = Lock()
|
39
|
-
|
40
|
-
def __new__(cls):
|
41
|
-
"""
|
42
|
-
Ensures only one instance of the CLICache class exists (Singleton pattern).
|
43
|
-
|
44
|
-
This method is responsible for controlling the instance creation process, ensuring that no more than one
|
45
|
-
CLICache instance is created in the system, even in multi-threaded environments.
|
46
|
-
|
47
|
-
Returns
|
48
|
-
-------
|
49
|
-
CLICache
|
50
|
-
The singleton instance of the CLICache class.
|
51
|
-
"""
|
52
|
-
with cls._lock:
|
53
|
-
if cls._instance is None:
|
54
|
-
cls._instance = super(CLICache, cls).__new__(cls)
|
55
|
-
cls._instance._initialized = False
|
56
|
-
return cls._instance
|
57
|
-
|
58
|
-
def __init__(self) -> None:
|
59
|
-
"""
|
60
|
-
Initializes the CLICache instance by loading commands if not already initialized.
|
61
|
-
|
62
|
-
This method will load command modules only once, ensuring that the commands are available for execution
|
63
|
-
across the application. It should not be called directly multiple times.
|
64
|
-
|
65
|
-
Attributes
|
66
|
-
----------
|
67
|
-
paths : list
|
68
|
-
List of directories containing command files to be loaded.
|
69
|
-
"""
|
70
|
-
if self._initialized:
|
71
|
-
return
|
72
|
-
|
73
|
-
self.paths = []
|
74
|
-
self._load_commands()
|
75
|
-
self._initialized = True
|
76
|
-
|
77
|
-
def _load_commands(self):
|
78
|
-
"""
|
79
|
-
Dynamically loads command modules from predefined directories.
|
80
|
-
|
81
|
-
This method traverses the specified directories, locates Python files, and imports them as modules.
|
82
|
-
It ensures that only the main directories are iterated over, avoiding subdirectories.
|
83
|
-
|
84
|
-
Directories searched:
|
85
|
-
---------------------
|
86
|
-
- app/console/commands (relative to the base path)
|
87
|
-
- Current directory of the module (this file's directory)
|
88
|
-
"""
|
89
|
-
paths = []
|
90
|
-
|
91
|
-
# Define the base path of the application
|
92
|
-
base_path = os.getcwd()
|
93
|
-
|
94
|
-
# Define command directories to be searched
|
95
|
-
command_dirs = [
|
96
|
-
os.path.join(base_path, 'app', 'console', 'commands'),
|
97
|
-
os.path.join(os.path.dirname(__file__), 'commands')
|
98
|
-
]
|
99
|
-
|
100
|
-
# Add valid directories to paths list
|
101
|
-
for command_dir in command_dirs:
|
102
|
-
if os.path.isdir(command_dir):
|
103
|
-
paths.append(command_dir)
|
104
|
-
|
105
|
-
# Iterate over each valid directory
|
106
|
-
for path in paths:
|
107
|
-
for current_directory, _, files in os.walk(path):
|
108
|
-
# Ensure to only iterate through the top-level directories
|
109
|
-
if current_directory == path:
|
110
|
-
pre_module = current_directory.replace(base_path, '').replace(os.sep, '.').lstrip('.')
|
111
|
-
for file in files:
|
112
|
-
if file.endswith('.py'):
|
113
|
-
# Construct the module name and path
|
114
|
-
module_name = file[:-3] # Remove the '.py' extension
|
115
|
-
module_path = f"{pre_module}.{module_name}".replace('venv.Lib.site-packages.', '')
|
116
|
-
|
117
|
-
# Use Reflection to load the module dynamically
|
118
|
-
Reflection(module=module_path)
|
119
|
-
|
120
|
-
def getCommands(self):
|
121
|
-
"""
|
122
|
-
Returns the instance of the CacheCommands containing the command cache.
|
123
|
-
|
124
|
-
This method provides access to the CacheCommands instance, which holds the loaded commands cache
|
125
|
-
and makes it available for use.
|
126
|
-
|
127
|
-
Returns
|
128
|
-
-------
|
129
|
-
CacheCommands
|
130
|
-
The instance of CacheCommands that holds the cached commands.
|
131
|
-
"""
|
132
|
-
return CacheCommands()
|
@@ -1,34 +0,0 @@
|
|
1
|
-
from abc import ABC, abstractmethod
|
2
|
-
from orionis.luminate.cache.console.commands import CacheCommands
|
3
|
-
|
4
|
-
class ICLICache(ABC):
|
5
|
-
"""
|
6
|
-
Interface for CLICache, defining the required methods for managing command caching.
|
7
|
-
|
8
|
-
This interface enforces a contract for any class that implements caching functionality
|
9
|
-
for command execution within the framework.
|
10
|
-
"""
|
11
|
-
|
12
|
-
@abstractmethod
|
13
|
-
def _load_commands(self) -> None:
|
14
|
-
"""
|
15
|
-
Loads command modules from predefined directories.
|
16
|
-
|
17
|
-
This method should traverse specified directories, locate Python files, and import them dynamically.
|
18
|
-
Implementations should ensure that only relevant directories are processed.
|
19
|
-
"""
|
20
|
-
pass
|
21
|
-
|
22
|
-
@abstractmethod
|
23
|
-
def getCommands(self) -> CacheCommands:
|
24
|
-
"""
|
25
|
-
Returns the instance of CacheCommands containing the command cache.
|
26
|
-
|
27
|
-
This method provides access to the CacheCommands instance, which holds the cached commands.
|
28
|
-
|
29
|
-
Returns
|
30
|
-
-------
|
31
|
-
CacheCommands
|
32
|
-
The instance of CacheCommands that holds the cached commands.
|
33
|
-
"""
|
34
|
-
pass
|
/orionis/luminate/contracts/console/{base_command_interface.py → base/base_command_interface.py}
RENAMED
File without changes
|
File without changes
|