orionis 0.658.0__py3-none-any.whl → 0.660.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/console/args/argument.py +5 -6
- orionis/console/commands/log_clear.py +2 -2
- orionis/console/commands/make_command.py +1 -1
- orionis/console/commands/scheduler_list.py +3 -7
- orionis/console/commands/scheduler_work.py +3 -9
- orionis/console/contracts/base_command.py +0 -3
- orionis/console/core/reactor.py +3 -3
- orionis/console/entities/scheduler_error.py +2 -2
- orionis/console/entities/scheduler_paused.py +2 -2
- orionis/console/entities/scheduler_resumed.py +2 -1
- orionis/console/entities/scheduler_shutdown.py +2 -1
- orionis/console/entities/scheduler_started.py +2 -1
- orionis/console/fluent/event.py +43 -38
- orionis/console/kernel.py +1 -2
- orionis/console/output/console.py +3 -1
- orionis/console/request/cli_request.py +1 -1
- orionis/console/tasks/schedule.py +20 -11
- orionis/container/container.py +17 -62
- orionis/metadata/framework.py +1 -1
- {orionis-0.658.0.dist-info → orionis-0.660.0.dist-info}/METADATA +1 -1
- {orionis-0.658.0.dist-info → orionis-0.660.0.dist-info}/RECORD +24 -24
- {orionis-0.658.0.dist-info → orionis-0.660.0.dist-info}/WHEEL +0 -0
- {orionis-0.658.0.dist-info → orionis-0.660.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.658.0.dist-info → orionis-0.660.0.dist-info}/top_level.txt +0 -0
orionis/console/args/argument.py
CHANGED
|
@@ -113,7 +113,7 @@ class CLIArgument:
|
|
|
113
113
|
}
|
|
114
114
|
)
|
|
115
115
|
|
|
116
|
-
def __post_init__(self):
|
|
116
|
+
def __post_init__(self): # NOSONAR
|
|
117
117
|
"""
|
|
118
118
|
Validate and normalize all argument attributes after initialization.
|
|
119
119
|
|
|
@@ -260,10 +260,9 @@ class CLIArgument:
|
|
|
260
260
|
object.__setattr__(self, 'type', None) # const actions don't use type
|
|
261
261
|
|
|
262
262
|
# Handle nargs '?' - optional single argument
|
|
263
|
-
elif self.nargs == '?':
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
object.__setattr__(self, 'const', True if self.type is bool else self.dest)
|
|
263
|
+
elif self.nargs == '?' and self.const is None and is_optional:
|
|
264
|
+
# For optional arguments with nargs='?', set a reasonable const
|
|
265
|
+
object.__setattr__(self, 'const', True if self.type is bool else self.dest)
|
|
267
266
|
|
|
268
267
|
# Validate nargs compatibility
|
|
269
268
|
if self.nargs is not None:
|
|
@@ -330,7 +329,7 @@ class CLIArgument:
|
|
|
330
329
|
except Exception as e:
|
|
331
330
|
raise CLIOrionisValueError(f"Error adding argument {self.flags}: {e}")
|
|
332
331
|
|
|
333
|
-
def _buildParserKwargs(self) -> Dict[str, Any]:
|
|
332
|
+
def _buildParserKwargs(self) -> Dict[str, Any]: # NOSONAR
|
|
334
333
|
"""
|
|
335
334
|
Build the keyword arguments dictionary for argparse compatibility.
|
|
336
335
|
|
|
@@ -40,7 +40,7 @@ class LogClearCommand(BaseCommand):
|
|
|
40
40
|
# Command description
|
|
41
41
|
description: str = "Eliminar todos los logs existentes de la aplicacion."
|
|
42
42
|
|
|
43
|
-
def handle(self, app: IApplication) -> bool:
|
|
43
|
+
def handle(self, app: IApplication) -> bool: # NOSONAR
|
|
44
44
|
"""
|
|
45
45
|
Clears all existing log files and directories in the application's log storage.
|
|
46
46
|
|
|
@@ -78,7 +78,7 @@ class LogClearCommand(BaseCommand):
|
|
|
78
78
|
|
|
79
79
|
# Truncate file contents
|
|
80
80
|
with open(entry, 'w'):
|
|
81
|
-
|
|
81
|
+
...
|
|
82
82
|
|
|
83
83
|
# Attempt to delete the file
|
|
84
84
|
entry.unlink()
|
|
@@ -35,7 +35,7 @@ class ScheduleListCommand(BaseCommand):
|
|
|
35
35
|
# Command description
|
|
36
36
|
description: str = "Lists all scheduled jobs defined in the application."
|
|
37
37
|
|
|
38
|
-
async def handle(self, app: IApplication, console: Console) ->
|
|
38
|
+
async def handle(self, app: IApplication, console: Console) -> None:
|
|
39
39
|
"""
|
|
40
40
|
Displays a table of scheduled jobs defined in the application.
|
|
41
41
|
|
|
@@ -54,9 +54,7 @@ class ScheduleListCommand(BaseCommand):
|
|
|
54
54
|
|
|
55
55
|
Returns
|
|
56
56
|
-------
|
|
57
|
-
|
|
58
|
-
Returns True if the scheduled jobs are listed successfully or if no jobs are found.
|
|
59
|
-
Raises CLIOrionisRuntimeError if an error occurs during execution.
|
|
57
|
+
None
|
|
60
58
|
"""
|
|
61
59
|
try:
|
|
62
60
|
|
|
@@ -77,7 +75,6 @@ class ScheduleListCommand(BaseCommand):
|
|
|
77
75
|
console.line()
|
|
78
76
|
console.print(Panel("No scheduled jobs found.", border_style="green"))
|
|
79
77
|
console.line()
|
|
80
|
-
return True
|
|
81
78
|
|
|
82
79
|
# Create and configure a table to display scheduled jobs
|
|
83
80
|
table = Table(title="Scheduled Jobs", show_lines=True)
|
|
@@ -105,11 +102,10 @@ class ScheduleListCommand(BaseCommand):
|
|
|
105
102
|
console.line()
|
|
106
103
|
console.print(table)
|
|
107
104
|
console.line()
|
|
108
|
-
return True
|
|
109
105
|
|
|
110
106
|
except Exception as e:
|
|
111
107
|
|
|
112
108
|
# Catch any unexpected exceptions and raise as a CLIOrionisRuntimeError
|
|
113
109
|
raise CLIOrionisRuntimeError(
|
|
114
110
|
f"An unexpected error occurred while listing the scheduled jobs: {e}"
|
|
115
|
-
)
|
|
111
|
+
) from e
|
|
@@ -42,7 +42,7 @@ class ScheduleWorkCommand(BaseCommand):
|
|
|
42
42
|
# Command description
|
|
43
43
|
description: str = "Executes the scheduled tasks defined in the application."
|
|
44
44
|
|
|
45
|
-
async def handle(self, app: IApplication, console: Console) ->
|
|
45
|
+
async def handle(self, app: IApplication, console: Console) -> None:
|
|
46
46
|
"""
|
|
47
47
|
Executes the scheduled tasks defined in the application's scheduler.
|
|
48
48
|
|
|
@@ -59,8 +59,8 @@ class ScheduleWorkCommand(BaseCommand):
|
|
|
59
59
|
|
|
60
60
|
Returns
|
|
61
61
|
-------
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
None
|
|
63
|
+
This method does not return a value.
|
|
64
64
|
|
|
65
65
|
Raises
|
|
66
66
|
------
|
|
@@ -100,9 +100,6 @@ class ScheduleWorkCommand(BaseCommand):
|
|
|
100
100
|
console.print(Panel("No scheduled jobs found.", border_style="green"))
|
|
101
101
|
console.line()
|
|
102
102
|
|
|
103
|
-
# Return True indicating the command completed successfully
|
|
104
|
-
return True
|
|
105
|
-
|
|
106
103
|
# If there are scheduled jobs and the scheduler has an onStarted method
|
|
107
104
|
if rf_scheduler.hasMethod("onStarted"):
|
|
108
105
|
schedule_service.setListener(ListeningEvent.SCHEDULER_STARTED, scheduler.onStarted)
|
|
@@ -126,9 +123,6 @@ class ScheduleWorkCommand(BaseCommand):
|
|
|
126
123
|
# Start the scheduler worker asynchronously
|
|
127
124
|
await schedule_service.start()
|
|
128
125
|
|
|
129
|
-
# Flag to indicate the scheduler is running
|
|
130
|
-
return True
|
|
131
|
-
|
|
132
126
|
except Exception as e:
|
|
133
127
|
|
|
134
128
|
# Raise any unexpected exceptions as CLIOrionisRuntimeError
|
|
@@ -26,9 +26,6 @@ class IBaseCommand(ABC):
|
|
|
26
26
|
# Human-readable description for documentation and help display
|
|
27
27
|
description: str
|
|
28
28
|
|
|
29
|
-
# Dictionary to store parsed command-line arguments and options
|
|
30
|
-
__args: Dict[str, Any] = {}
|
|
31
|
-
|
|
32
29
|
@abstractmethod
|
|
33
30
|
async def options(self) -> List[CLIArgument]:
|
|
34
31
|
"""
|
orionis/console/core/reactor.py
CHANGED
|
@@ -127,7 +127,7 @@ class Reactor(IReactor):
|
|
|
127
127
|
self.__loadFluentCommands()
|
|
128
128
|
self.__load_fluent_commands = True
|
|
129
129
|
|
|
130
|
-
def __loadFluentCommands(self) -> None:
|
|
130
|
+
def __loadFluentCommands(self) -> None: # NOSONAR
|
|
131
131
|
"""
|
|
132
132
|
Loads and registers commands defined using the fluent interface.
|
|
133
133
|
|
|
@@ -330,7 +330,7 @@ class Reactor(IReactor):
|
|
|
330
330
|
args=args
|
|
331
331
|
)
|
|
332
332
|
|
|
333
|
-
def __loadCustomCommands(self) -> None:
|
|
333
|
+
def __loadCustomCommands(self) -> None: # NOSONAR
|
|
334
334
|
"""
|
|
335
335
|
Loads command classes from Python files in the specified commands directory.
|
|
336
336
|
|
|
@@ -660,7 +660,7 @@ class Reactor(IReactor):
|
|
|
660
660
|
parsed_args = command.args.parse_args(args)
|
|
661
661
|
|
|
662
662
|
# Raise a CLIOrionisRuntimeError with the help message included in the exception
|
|
663
|
-
except
|
|
663
|
+
except Exception:
|
|
664
664
|
raise CLIOrionisRuntimeError(
|
|
665
665
|
f"Failed to parse arguments for command '{command.signature}'.\n"
|
|
666
666
|
f"{command.args.format_help()}\n"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
from datetime import datetime
|
|
3
|
-
from typing import Optional
|
|
3
|
+
from typing import Optional, Union
|
|
4
4
|
from orionis.console.entities.scheduler_event_data import SchedulerEventData
|
|
5
5
|
|
|
6
6
|
@dataclass(kw_only=True)
|
|
@@ -28,7 +28,7 @@ class SchedulerError(SchedulerEventData):
|
|
|
28
28
|
"""
|
|
29
29
|
|
|
30
30
|
# The time when the error occurred (string or datetime)
|
|
31
|
-
time: str
|
|
31
|
+
time: Optional[Union[str, datetime]] = None
|
|
32
32
|
|
|
33
33
|
# Exception that caused the scheduler error, if present
|
|
34
34
|
exception: Optional[BaseException] = None
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
from datetime import datetime
|
|
3
|
+
from typing import Optional, Union
|
|
3
4
|
from orionis.console.entities.scheduler_event_data import SchedulerEventData
|
|
4
5
|
|
|
5
6
|
@dataclass(kw_only=True)
|
|
@@ -28,6 +29,5 @@ class SchedulerPaused(SchedulerEventData):
|
|
|
28
29
|
SchedulerPaused
|
|
29
30
|
An instance of `SchedulerPaused` containing information about the pause event.
|
|
30
31
|
"""
|
|
31
|
-
|
|
32
32
|
# The time when the scheduler was paused; can be a string or datetime object
|
|
33
|
-
time: str
|
|
33
|
+
time: Optional[Union[str, datetime]] = None
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
from datetime import datetime
|
|
3
|
+
from typing import Optional, Union
|
|
3
4
|
from orionis.console.entities.scheduler_event_data import SchedulerEventData
|
|
4
5
|
|
|
5
6
|
@dataclass(kw_only=True)
|
|
@@ -22,4 +23,4 @@ class SchedulerResumed(SchedulerEventData):
|
|
|
22
23
|
"""
|
|
23
24
|
|
|
24
25
|
# The time when the scheduler was resumed; can be a string or datetime object
|
|
25
|
-
time: str
|
|
26
|
+
time: Optional[Union[str, datetime]] = None
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
from datetime import datetime
|
|
3
|
+
from typing import Optional, Union
|
|
3
4
|
from orionis.console.entities.scheduler_event_data import SchedulerEventData
|
|
4
5
|
|
|
5
6
|
@dataclass(kw_only=True)
|
|
@@ -24,4 +25,4 @@ class SchedulerShutdown(SchedulerEventData):
|
|
|
24
25
|
"""
|
|
25
26
|
|
|
26
27
|
# The time when the scheduler was shut down; can be a string or datetime object
|
|
27
|
-
time: str
|
|
28
|
+
time: Optional[Union[str, datetime]] = None
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
from datetime import datetime
|
|
3
|
+
from typing import Optional, Union
|
|
3
4
|
from orionis.console.entities.scheduler_event_data import SchedulerEventData
|
|
4
5
|
|
|
5
6
|
@dataclass(kw_only=True)
|
|
@@ -24,4 +25,4 @@ class SchedulerStarted(SchedulerEventData):
|
|
|
24
25
|
"""
|
|
25
26
|
|
|
26
27
|
# The time when the scheduler started; can be a string or datetime object
|
|
27
|
-
time: str
|
|
28
|
+
time: Optional[Union[str, datetime]] = None
|
orionis/console/fluent/event.py
CHANGED
|
@@ -11,6 +11,11 @@ from orionis.console.exceptions import CLIOrionisValueError
|
|
|
11
11
|
|
|
12
12
|
class Event(IEvent):
|
|
13
13
|
|
|
14
|
+
ERROR_MSG_INVALID_INTERVAL = "Interval value must be a positive integer."
|
|
15
|
+
ERROR_MSG_INVALID_MINUTE = "Minute must be between 0 and 59."
|
|
16
|
+
ERROR_MSG_INVALID_SECOND = "Second must be between 0 and 59."
|
|
17
|
+
ERROR_MSG_INVALID_HOUR = "Hour must be between 0 and 23."
|
|
18
|
+
|
|
14
19
|
def __init__(
|
|
15
20
|
self,
|
|
16
21
|
signature: str,
|
|
@@ -80,7 +85,7 @@ class Event(IEvent):
|
|
|
80
85
|
# Initialize the misfire grace time attribute as None
|
|
81
86
|
self.__misfire_grace_time: Optional[int] = None
|
|
82
87
|
|
|
83
|
-
def toEntity(
|
|
88
|
+
def toEntity( # NOSONAR
|
|
84
89
|
self
|
|
85
90
|
) -> EventEntity:
|
|
86
91
|
"""
|
|
@@ -490,7 +495,7 @@ class Event(IEvent):
|
|
|
490
495
|
"""
|
|
491
496
|
# Validate that the seconds parameter is a positive integer.
|
|
492
497
|
if not isinstance(seconds, int) or seconds <= 0:
|
|
493
|
-
raise CLIOrionisValueError(
|
|
498
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_INTERVAL)
|
|
494
499
|
|
|
495
500
|
# Configure the trigger to execute the event at the specified interval,
|
|
496
501
|
# using any previously set start_date and end_date.
|
|
@@ -828,7 +833,7 @@ class Event(IEvent):
|
|
|
828
833
|
|
|
829
834
|
# Validate that the minutes parameter is a positive integer.
|
|
830
835
|
if not isinstance(minutes, int) or minutes <= 0:
|
|
831
|
-
raise CLIOrionisValueError(
|
|
836
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_INTERVAL)
|
|
832
837
|
|
|
833
838
|
# Configure the trigger to execute the event at the specified interval,
|
|
834
839
|
# using any previously set start_date, end_date, and random_delay (jitter).
|
|
@@ -1747,11 +1752,11 @@ class Event(IEvent):
|
|
|
1747
1752
|
|
|
1748
1753
|
# Validate that minute is within the range [0, 59].
|
|
1749
1754
|
if not (0 <= minute < 60):
|
|
1750
|
-
raise CLIOrionisValueError(
|
|
1755
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_MINUTE)
|
|
1751
1756
|
|
|
1752
1757
|
# Validate that second is within the range [0, 59].
|
|
1753
1758
|
if not (0 <= second < 60):
|
|
1754
|
-
raise CLIOrionisValueError(
|
|
1759
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_SECOND)
|
|
1755
1760
|
|
|
1756
1761
|
# Set up the trigger to execute the event every hour at the specified minute and second.
|
|
1757
1762
|
# The IntervalTrigger ensures the event is triggered at hourly intervals.
|
|
@@ -1876,7 +1881,7 @@ class Event(IEvent):
|
|
|
1876
1881
|
|
|
1877
1882
|
# Validate that the `hours` parameter is a positive integer.
|
|
1878
1883
|
if not isinstance(hours, int) or hours <= 0:
|
|
1879
|
-
raise CLIOrionisValueError(
|
|
1884
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_INTERVAL)
|
|
1880
1885
|
|
|
1881
1886
|
# Configure the trigger to execute the event at the specified interval.
|
|
1882
1887
|
# The `start_date` and `end_date` define the optional scheduling window.
|
|
@@ -1935,7 +1940,7 @@ class Event(IEvent):
|
|
|
1935
1940
|
|
|
1936
1941
|
# Validate that the `hours` parameter is a positive integer.
|
|
1937
1942
|
if not isinstance(hours, int) or hours <= 0:
|
|
1938
|
-
raise CLIOrionisValueError(
|
|
1943
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_INTERVAL)
|
|
1939
1944
|
|
|
1940
1945
|
# Validate that minute and second are integers.
|
|
1941
1946
|
if not isinstance(minute, int) or not isinstance(second, int):
|
|
@@ -1943,11 +1948,11 @@ class Event(IEvent):
|
|
|
1943
1948
|
|
|
1944
1949
|
# Validate that minute is within the range [0, 59].
|
|
1945
1950
|
if not (0 <= minute < 60):
|
|
1946
|
-
raise CLIOrionisValueError(
|
|
1951
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_MINUTE)
|
|
1947
1952
|
|
|
1948
1953
|
# Validate that second is within the range [0, 59].
|
|
1949
1954
|
if not (0 <= second < 60):
|
|
1950
|
-
raise CLIOrionisValueError(
|
|
1955
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_SECOND)
|
|
1951
1956
|
|
|
1952
1957
|
# Configure the trigger to execute the event every hour at the specified minute and second.
|
|
1953
1958
|
# The IntervalTrigger ensures the event is triggered at hourly intervals.
|
|
@@ -2781,13 +2786,13 @@ class Event(IEvent):
|
|
|
2781
2786
|
|
|
2782
2787
|
# Validate that hour is within valid range.
|
|
2783
2788
|
if not (0 <= hour < 24):
|
|
2784
|
-
raise CLIOrionisValueError(
|
|
2789
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_HOUR)
|
|
2785
2790
|
|
|
2786
2791
|
# Validate that minute and second are within valid ranges.
|
|
2787
2792
|
if not (0 <= minute < 60):
|
|
2788
|
-
raise CLIOrionisValueError(
|
|
2793
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_MINUTE)
|
|
2789
2794
|
if not (0 <= second < 60):
|
|
2790
|
-
raise CLIOrionisValueError(
|
|
2795
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_SECOND)
|
|
2791
2796
|
|
|
2792
2797
|
# Set up the trigger to execute the event daily at the specified time using CronTrigger.
|
|
2793
2798
|
self.__trigger = CronTrigger(
|
|
@@ -2842,7 +2847,7 @@ class Event(IEvent):
|
|
|
2842
2847
|
|
|
2843
2848
|
# Validate that the days parameter is a positive integer.
|
|
2844
2849
|
if not isinstance(days, int) or days <= 0:
|
|
2845
|
-
raise CLIOrionisValueError(
|
|
2850
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_INTERVAL)
|
|
2846
2851
|
|
|
2847
2852
|
# Configure the trigger to execute the event at the specified interval,
|
|
2848
2853
|
# using any previously set start_date, end_date, and random_delay (jitter).
|
|
@@ -2913,13 +2918,13 @@ class Event(IEvent):
|
|
|
2913
2918
|
|
|
2914
2919
|
# Validate that hour is within the valid range [0, 23].
|
|
2915
2920
|
if not (0 <= hour < 24):
|
|
2916
|
-
raise CLIOrionisValueError(
|
|
2921
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_HOUR)
|
|
2917
2922
|
|
|
2918
2923
|
# Validate that minute and second are within the valid range [0, 59].
|
|
2919
2924
|
if not (0 <= minute < 60):
|
|
2920
|
-
raise CLIOrionisValueError(
|
|
2925
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_MINUTE)
|
|
2921
2926
|
if not (0 <= second < 60):
|
|
2922
|
-
raise CLIOrionisValueError(
|
|
2927
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_SECOND)
|
|
2923
2928
|
|
|
2924
2929
|
# Set up the trigger to execute the event every N days at the specified time using CronTrigger.
|
|
2925
2930
|
self.__trigger = CronTrigger(
|
|
@@ -3393,15 +3398,15 @@ class Event(IEvent):
|
|
|
3393
3398
|
|
|
3394
3399
|
# Validate that the hour is within the valid range [0, 23].
|
|
3395
3400
|
if not (0 <= hour < 24):
|
|
3396
|
-
raise CLIOrionisValueError(
|
|
3401
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_HOUR)
|
|
3397
3402
|
|
|
3398
3403
|
# Validate that the minute is within the valid range [0, 59].
|
|
3399
3404
|
if not (0 <= minute < 60):
|
|
3400
|
-
raise CLIOrionisValueError(
|
|
3405
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_MINUTE)
|
|
3401
3406
|
|
|
3402
3407
|
# Validate that the second is within the valid range [0, 59].
|
|
3403
3408
|
if not (0 <= second < 60):
|
|
3404
|
-
raise CLIOrionisValueError(
|
|
3409
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_SECOND)
|
|
3405
3410
|
|
|
3406
3411
|
# Configure the trigger to execute the event every Monday at the specified hour, minute, and second.
|
|
3407
3412
|
# The `CronTrigger` is used to specify the day of the week and time for the event.
|
|
@@ -3464,15 +3469,15 @@ class Event(IEvent):
|
|
|
3464
3469
|
|
|
3465
3470
|
# Validate that the hour is within the valid range [0, 23].
|
|
3466
3471
|
if not (0 <= hour < 24):
|
|
3467
|
-
raise CLIOrionisValueError(
|
|
3472
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_HOUR)
|
|
3468
3473
|
|
|
3469
3474
|
# Validate that the minute is within the valid range [0, 59].
|
|
3470
3475
|
if not (0 <= minute < 60):
|
|
3471
|
-
raise CLIOrionisValueError(
|
|
3476
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_MINUTE)
|
|
3472
3477
|
|
|
3473
3478
|
# Validate that the second is within the valid range [0, 59].
|
|
3474
3479
|
if not (0 <= second < 60):
|
|
3475
|
-
raise CLIOrionisValueError(
|
|
3480
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_SECOND)
|
|
3476
3481
|
|
|
3477
3482
|
# Configure the trigger to execute the event every Tuesday at the specified hour, minute, and second.
|
|
3478
3483
|
self.__trigger = CronTrigger(
|
|
@@ -3534,15 +3539,15 @@ class Event(IEvent):
|
|
|
3534
3539
|
|
|
3535
3540
|
# Validate that the hour is within the valid range [0, 23].
|
|
3536
3541
|
if not (0 <= hour < 24):
|
|
3537
|
-
raise CLIOrionisValueError(
|
|
3542
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_HOUR)
|
|
3538
3543
|
|
|
3539
3544
|
# Validate that the minute is within the valid range [0, 59].
|
|
3540
3545
|
if not (0 <= minute < 60):
|
|
3541
|
-
raise CLIOrionisValueError(
|
|
3546
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_MINUTE)
|
|
3542
3547
|
|
|
3543
3548
|
# Validate that the second is within the valid range [0, 59].
|
|
3544
3549
|
if not (0 <= second < 60):
|
|
3545
|
-
raise CLIOrionisValueError(
|
|
3550
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_SECOND)
|
|
3546
3551
|
|
|
3547
3552
|
# Configure the trigger to execute the event every Wednesday at the specified hour, minute, and second.
|
|
3548
3553
|
self.__trigger = CronTrigger(
|
|
@@ -3604,15 +3609,15 @@ class Event(IEvent):
|
|
|
3604
3609
|
|
|
3605
3610
|
# Validate that the hour is within the valid range [0, 23].
|
|
3606
3611
|
if not (0 <= hour < 24):
|
|
3607
|
-
raise CLIOrionisValueError(
|
|
3612
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_HOUR)
|
|
3608
3613
|
|
|
3609
3614
|
# Validate that the minute is within the valid range [0, 59].
|
|
3610
3615
|
if not (0 <= minute < 60):
|
|
3611
|
-
raise CLIOrionisValueError(
|
|
3616
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_MINUTE)
|
|
3612
3617
|
|
|
3613
3618
|
# Validate that the second is within the valid range [0, 59].
|
|
3614
3619
|
if not (0 <= second < 60):
|
|
3615
|
-
raise CLIOrionisValueError(
|
|
3620
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_SECOND)
|
|
3616
3621
|
|
|
3617
3622
|
# Configure the trigger to execute the event every Thursday at the specified hour, minute, and second.
|
|
3618
3623
|
self.__trigger = CronTrigger(
|
|
@@ -3674,15 +3679,15 @@ class Event(IEvent):
|
|
|
3674
3679
|
|
|
3675
3680
|
# Validate that the hour is within the valid range [0, 23].
|
|
3676
3681
|
if not (0 <= hour < 24):
|
|
3677
|
-
raise CLIOrionisValueError(
|
|
3682
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_HOUR)
|
|
3678
3683
|
|
|
3679
3684
|
# Validate that the minute is within the valid range [0, 59].
|
|
3680
3685
|
if not (0 <= minute < 60):
|
|
3681
|
-
raise CLIOrionisValueError(
|
|
3686
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_MINUTE)
|
|
3682
3687
|
|
|
3683
3688
|
# Validate that the second is within the valid range [0, 59].
|
|
3684
3689
|
if not (0 <= second < 60):
|
|
3685
|
-
raise CLIOrionisValueError(
|
|
3690
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_SECOND)
|
|
3686
3691
|
|
|
3687
3692
|
# Configure the trigger to execute the event every Friday at the specified hour, minute, and second.
|
|
3688
3693
|
self.__trigger = CronTrigger(
|
|
@@ -3744,15 +3749,15 @@ class Event(IEvent):
|
|
|
3744
3749
|
|
|
3745
3750
|
# Validate that the hour is within the valid range [0, 23].
|
|
3746
3751
|
if not (0 <= hour < 24):
|
|
3747
|
-
raise CLIOrionisValueError(
|
|
3752
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_HOUR)
|
|
3748
3753
|
|
|
3749
3754
|
# Validate that the minute is within the valid range [0, 59].
|
|
3750
3755
|
if not (0 <= minute < 60):
|
|
3751
|
-
raise CLIOrionisValueError(
|
|
3756
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_MINUTE)
|
|
3752
3757
|
|
|
3753
3758
|
# Validate that the second is within the valid range [0, 59].
|
|
3754
3759
|
if not (0 <= second < 60):
|
|
3755
|
-
raise CLIOrionisValueError(
|
|
3760
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_SECOND)
|
|
3756
3761
|
|
|
3757
3762
|
# Configure the trigger to execute the event every Saturday at the specified hour, minute, and second.
|
|
3758
3763
|
self.__trigger = CronTrigger(
|
|
@@ -3814,15 +3819,15 @@ class Event(IEvent):
|
|
|
3814
3819
|
|
|
3815
3820
|
# Validate that the hour is within the valid range [0, 23].
|
|
3816
3821
|
if not (0 <= hour < 24):
|
|
3817
|
-
raise CLIOrionisValueError(
|
|
3822
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_HOUR)
|
|
3818
3823
|
|
|
3819
3824
|
# Validate that the minute is within the valid range [0, 59].
|
|
3820
3825
|
if not (0 <= minute < 60):
|
|
3821
|
-
raise CLIOrionisValueError(
|
|
3826
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_MINUTE)
|
|
3822
3827
|
|
|
3823
3828
|
# Validate that the second is within the valid range [0, 59].
|
|
3824
3829
|
if not (0 <= second < 60):
|
|
3825
|
-
raise CLIOrionisValueError(
|
|
3830
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_SECOND)
|
|
3826
3831
|
|
|
3827
3832
|
# Configure the trigger to execute the event every Sunday at the specified hour, minute, and second.
|
|
3828
3833
|
self.__trigger = CronTrigger(
|
|
@@ -3918,7 +3923,7 @@ class Event(IEvent):
|
|
|
3918
3923
|
|
|
3919
3924
|
# Validate that the `weeks` parameter is a positive integer.
|
|
3920
3925
|
if not isinstance(weeks, int) or weeks <= 0:
|
|
3921
|
-
raise CLIOrionisValueError(
|
|
3926
|
+
raise CLIOrionisValueError(self.ERROR_MSG_INVALID_INTERVAL)
|
|
3922
3927
|
|
|
3923
3928
|
# Configure the trigger to execute the event at the specified interval.
|
|
3924
3929
|
# The `start_date` and `end_date` define the optional scheduling window.
|
orionis/console/kernel.py
CHANGED
|
@@ -71,7 +71,6 @@ class KernelCLI(IKernelCLI):
|
|
|
71
71
|
f"Failed to handle command line arguments: expected list, got {type(args).__module__}.{type(args).__name__}."
|
|
72
72
|
)
|
|
73
73
|
|
|
74
|
-
# TODO: In the future, implement a middleware pipeline to process the arguments before executing the command.
|
|
75
74
|
# If no arguments or only the script name is provided, show the default help command
|
|
76
75
|
if not args or len(args) <= 1:
|
|
77
76
|
return self.__reactor.call('help')
|
|
@@ -90,7 +89,7 @@ class KernelCLI(IKernelCLI):
|
|
|
90
89
|
# If command and arguments are provided, call the command with its arguments
|
|
91
90
|
return self.__reactor.call(args[0], args[1:])
|
|
92
91
|
|
|
93
|
-
except
|
|
92
|
+
except Exception as e:
|
|
94
93
|
|
|
95
94
|
# Catch any exceptions that occur during command handling
|
|
96
95
|
self.__catch.exception(self, CLIRequest.fromList(args), e)
|
|
@@ -537,6 +537,7 @@ class Console(IConsole):
|
|
|
537
537
|
sys.exit(0)
|
|
538
538
|
except SystemExit:
|
|
539
539
|
os._exit(0)
|
|
540
|
+
raise
|
|
540
541
|
|
|
541
542
|
def exitError(self, message: str = None) -> None:
|
|
542
543
|
"""
|
|
@@ -553,8 +554,9 @@ class Console(IConsole):
|
|
|
553
554
|
sys.exit(0)
|
|
554
555
|
except SystemExit:
|
|
555
556
|
os._exit(0)
|
|
557
|
+
raise
|
|
556
558
|
|
|
557
|
-
def dump(
|
|
559
|
+
def dump( # NOSONAR
|
|
558
560
|
self,
|
|
559
561
|
*args,
|
|
560
562
|
show_types: bool = True,
|
|
@@ -5,7 +5,7 @@ from orionis.console.exceptions import CLIOrionisValueError
|
|
|
5
5
|
class CLIRequest(ICLIRequest):
|
|
6
6
|
|
|
7
7
|
@classmethod
|
|
8
|
-
def fromList(cls, args: List[str]) -> 'CLIRequest':
|
|
8
|
+
def fromList(cls, args: List[str]) -> 'CLIRequest': # NOSONAR
|
|
9
9
|
"""
|
|
10
10
|
Create a CLIRequest instance from a list of command line arguments.
|
|
11
11
|
|
|
@@ -40,6 +40,10 @@ from zoneinfo import ZoneInfo
|
|
|
40
40
|
|
|
41
41
|
class Schedule(ISchedule):
|
|
42
42
|
|
|
43
|
+
# Error message constants
|
|
44
|
+
SIGNATURE_REQUIRED_ERROR = "Signature must be a non-empty string."
|
|
45
|
+
NOT_APPLICABLE = "Not Applicable"
|
|
46
|
+
|
|
43
47
|
def __init__(
|
|
44
48
|
self,
|
|
45
49
|
reactor: IReactor,
|
|
@@ -640,14 +644,18 @@ class Schedule(ISchedule):
|
|
|
640
644
|
|
|
641
645
|
# If the listener is callable, invoke it with event data and the scheduler instance
|
|
642
646
|
if callable(listener):
|
|
647
|
+
|
|
643
648
|
try:
|
|
649
|
+
|
|
644
650
|
# Execute the listener, handling both coroutine and regular functions
|
|
645
651
|
self.__app.invoke(listener, event_data, self)
|
|
646
|
-
|
|
652
|
+
|
|
653
|
+
except Exception as e:
|
|
654
|
+
|
|
647
655
|
# Handle any exceptions raised by the listener using the application's error handler
|
|
648
656
|
self.__raiseException(e)
|
|
649
657
|
|
|
650
|
-
def __taskCallableListener(
|
|
658
|
+
def __taskCallableListener( # NOSONAR
|
|
651
659
|
self,
|
|
652
660
|
event_data: EventJob,
|
|
653
661
|
listening_vent: ListeningEvent
|
|
@@ -718,7 +726,8 @@ class Schedule(ISchedule):
|
|
|
718
726
|
# Call the event method on the listener, passing event data and the scheduler instance
|
|
719
727
|
self.__app.call(listener, scheduler_event, event_data, self)
|
|
720
728
|
|
|
721
|
-
except
|
|
729
|
+
except Exception as e:
|
|
730
|
+
|
|
722
731
|
# Handle any exceptions raised by the listener using the application's error handler
|
|
723
732
|
self.__raiseException(e)
|
|
724
733
|
|
|
@@ -1426,7 +1435,7 @@ class Schedule(ISchedule):
|
|
|
1426
1435
|
if self.__pausedByPauseEverything:
|
|
1427
1436
|
|
|
1428
1437
|
# Iterate through the set of paused job IDs and resume each one
|
|
1429
|
-
for job_id in
|
|
1438
|
+
for job_id in self.__pausedByPauseEverything:
|
|
1430
1439
|
|
|
1431
1440
|
try:
|
|
1432
1441
|
|
|
@@ -1640,7 +1649,7 @@ class Schedule(ISchedule):
|
|
|
1640
1649
|
|
|
1641
1650
|
# Validate that the signature is a non-empty string
|
|
1642
1651
|
if not isinstance(signature, str) or not signature.strip():
|
|
1643
|
-
self.__raiseException(CLIOrionisValueError(
|
|
1652
|
+
self.__raiseException(CLIOrionisValueError(self.SIGNATURE_REQUIRED_ERROR))
|
|
1644
1653
|
|
|
1645
1654
|
try:
|
|
1646
1655
|
# Attempt to pause the job with the given signature
|
|
@@ -1690,7 +1699,7 @@ class Schedule(ISchedule):
|
|
|
1690
1699
|
|
|
1691
1700
|
# Validate that the signature is a non-empty string
|
|
1692
1701
|
if not isinstance(signature, str) or not signature.strip():
|
|
1693
|
-
self.__raiseException(CLIOrionisValueError(
|
|
1702
|
+
self.__raiseException(CLIOrionisValueError(self.SIGNATURE_REQUIRED_ERROR))
|
|
1694
1703
|
|
|
1695
1704
|
try:
|
|
1696
1705
|
|
|
@@ -1742,7 +1751,7 @@ class Schedule(ISchedule):
|
|
|
1742
1751
|
|
|
1743
1752
|
# Validate that the signature is a non-empty string
|
|
1744
1753
|
if not isinstance(signature, str) or not signature.strip():
|
|
1745
|
-
self.__raiseException(CLIOrionisValueError(
|
|
1754
|
+
self.__raiseException(CLIOrionisValueError(self.SIGNATURE_REQUIRED_ERROR))
|
|
1746
1755
|
|
|
1747
1756
|
try:
|
|
1748
1757
|
|
|
@@ -1811,8 +1820,8 @@ class Schedule(ISchedule):
|
|
|
1811
1820
|
details: str = self.__getAttribute(job, 'details', 'Not Available')
|
|
1812
1821
|
|
|
1813
1822
|
# Format the start and end dates as strings, or mark as 'Not Applicable' if not set
|
|
1814
|
-
formatted_start = start_date.strftime('%Y-%m-%d %H:%M:%S') if start_date else
|
|
1815
|
-
formatted_end = end_date.strftime('%Y-%m-%d %H:%M:%S') if end_date else
|
|
1823
|
+
formatted_start = start_date.strftime('%Y-%m-%d %H:%M:%S') if start_date else self.NOT_APPLICABLE
|
|
1824
|
+
formatted_end = end_date.strftime('%Y-%m-%d %H:%M:%S') if end_date else self.NOT_APPLICABLE
|
|
1816
1825
|
|
|
1817
1826
|
# Append a dictionary with relevant job details to the events list
|
|
1818
1827
|
events.append({
|
|
@@ -1892,8 +1901,8 @@ class Schedule(ISchedule):
|
|
|
1892
1901
|
'args': args,
|
|
1893
1902
|
'purpose': purpose,
|
|
1894
1903
|
'random_delay': random_delay,
|
|
1895
|
-
'start_date': start_date.strftime('%Y-%m-%d %H:%M:%S') if start_date else
|
|
1896
|
-
'end_date': end_date.strftime('%Y-%m-%d %H:%M:%S') if end_date else
|
|
1904
|
+
'start_date': start_date.strftime('%Y-%m-%d %H:%M:%S') if start_date else self.NOT_APPLICABLE,
|
|
1905
|
+
'end_date': end_date.strftime('%Y-%m-%d %H:%M:%S') if end_date else self.NOT_APPLICABLE,
|
|
1897
1906
|
'details': details
|
|
1898
1907
|
}
|
|
1899
1908
|
|
orionis/container/container.py
CHANGED
|
@@ -3,7 +3,7 @@ import asyncio
|
|
|
3
3
|
import inspect
|
|
4
4
|
import threading
|
|
5
5
|
import typing
|
|
6
|
-
from typing import Any, Callable, Optional
|
|
6
|
+
from typing import Any, Callable, Optional
|
|
7
7
|
from orionis.container.context.manager import ScopeManager
|
|
8
8
|
from orionis.container.context.scope import ScopedContext
|
|
9
9
|
from orionis.container.contracts.container import IContainer
|
|
@@ -11,11 +11,6 @@ from orionis.container.entities.binding import Binding
|
|
|
11
11
|
from orionis.container.enums.lifetimes import Lifetime
|
|
12
12
|
from orionis.container.exceptions import OrionisContainerException
|
|
13
13
|
from orionis.container.exceptions.container import OrionisContainerTypeError
|
|
14
|
-
from orionis.container.validators import (
|
|
15
|
-
IsCallable,
|
|
16
|
-
IsValidAlias,
|
|
17
|
-
LifetimeValidator
|
|
18
|
-
)
|
|
19
14
|
from orionis.services.introspection.abstract.reflection import ReflectionAbstract
|
|
20
15
|
from orionis.services.introspection.callables.reflection import ReflectionCallable
|
|
21
16
|
from orionis.services.introspection.concretes.reflection import ReflectionConcrete
|
|
@@ -35,7 +30,9 @@ class Container(IContainer):
|
|
|
35
30
|
# This lock ensures that only one thread can create or access instances at a time
|
|
36
31
|
_lock = threading.RLock() # RLock allows reentrant locking
|
|
37
32
|
|
|
38
|
-
def __new__(
|
|
33
|
+
def __new__(
|
|
34
|
+
cls
|
|
35
|
+
) -> 'Container':
|
|
39
36
|
"""
|
|
40
37
|
Creates and returns a singleton instance for each specific class.
|
|
41
38
|
|
|
@@ -79,7 +76,9 @@ class Container(IContainer):
|
|
|
79
76
|
# Return the newly created instance
|
|
80
77
|
return instance
|
|
81
78
|
|
|
82
|
-
def __init__(
|
|
79
|
+
def __init__(
|
|
80
|
+
self
|
|
81
|
+
) -> None:
|
|
83
82
|
"""
|
|
84
83
|
Initializes the internal state of the container instance.
|
|
85
84
|
|
|
@@ -113,7 +112,7 @@ class Container(IContainer):
|
|
|
113
112
|
self.__singleton_cache = {} # Caches singleton instances
|
|
114
113
|
|
|
115
114
|
# Mark this instance as initialized to prevent re-initialization
|
|
116
|
-
self.__initialized = True
|
|
115
|
+
self.__initialized = True # NOSONAR
|
|
117
116
|
|
|
118
117
|
def __handleSyncAsyncResult(
|
|
119
118
|
self,
|
|
@@ -471,47 +470,6 @@ class Container(IContainer):
|
|
|
471
470
|
# If no alias is provided, generate a default alias using module and class name
|
|
472
471
|
return f"{abstract.__module__}.{abstract.__name__}"
|
|
473
472
|
|
|
474
|
-
def __validateLifetime(self, lifetime: Union[str, Lifetime, Any]) -> Lifetime:
|
|
475
|
-
"""
|
|
476
|
-
Validates and normalizes the provided lifetime value.
|
|
477
|
-
|
|
478
|
-
Parameters
|
|
479
|
-
----------
|
|
480
|
-
lifetime : Union[str, Lifetime, Any]
|
|
481
|
-
The lifetime value to validate. Can be a Lifetime enum or a string
|
|
482
|
-
representing a valid lifetime.
|
|
483
|
-
|
|
484
|
-
Returns
|
|
485
|
-
-------
|
|
486
|
-
Lifetime
|
|
487
|
-
The validated Lifetime enum value.
|
|
488
|
-
|
|
489
|
-
Raises
|
|
490
|
-
------
|
|
491
|
-
OrionisContainerTypeError
|
|
492
|
-
If the value is not a valid Lifetime enum or string representation,
|
|
493
|
-
or if the string doesn't match any valid Lifetime value.
|
|
494
|
-
"""
|
|
495
|
-
# Already a Lifetime enum
|
|
496
|
-
if isinstance(lifetime, Lifetime):
|
|
497
|
-
return lifetime
|
|
498
|
-
|
|
499
|
-
# String that might represent a Lifetime
|
|
500
|
-
if isinstance(lifetime, str):
|
|
501
|
-
lifetime_key = lifetime.strip().upper()
|
|
502
|
-
if lifetime_key in Lifetime.__members__:
|
|
503
|
-
return Lifetime[lifetime_key]
|
|
504
|
-
|
|
505
|
-
valid_options = ', '.join(Lifetime.__members__.keys())
|
|
506
|
-
raise OrionisContainerTypeError(
|
|
507
|
-
f"Invalid lifetime '{lifetime}'. Valid options are: {valid_options}."
|
|
508
|
-
)
|
|
509
|
-
|
|
510
|
-
# Invalid type
|
|
511
|
-
raise OrionisContainerTypeError(
|
|
512
|
-
f"Lifetime must be of type str or Lifetime enum, got {type(lifetime).__name__}."
|
|
513
|
-
)
|
|
514
|
-
|
|
515
473
|
def transient(
|
|
516
474
|
self,
|
|
517
475
|
abstract: Callable[..., Any],
|
|
@@ -1179,7 +1137,7 @@ class Container(IContainer):
|
|
|
1179
1137
|
# Return None if no binding is found for the requested abstract type or alias
|
|
1180
1138
|
return None
|
|
1181
1139
|
|
|
1182
|
-
def __validateBinding(
|
|
1140
|
+
def __validateBinding( # NOSONAR
|
|
1183
1141
|
self,
|
|
1184
1142
|
binding: Binding,
|
|
1185
1143
|
requested_key: Any
|
|
@@ -1255,7 +1213,7 @@ class Container(IContainer):
|
|
|
1255
1213
|
# Additional validations based on binding type
|
|
1256
1214
|
self.__validateBindingByType(binding, requested_key)
|
|
1257
1215
|
|
|
1258
|
-
def __validateBindingByType(
|
|
1216
|
+
def __validateBindingByType( # NOSONAR
|
|
1259
1217
|
self,
|
|
1260
1218
|
binding: Binding,
|
|
1261
1219
|
requested_key: Any
|
|
@@ -1322,7 +1280,7 @@ class Container(IContainer):
|
|
|
1322
1280
|
f"Invalid alias in binding for '{requested_key}': alias cannot be empty"
|
|
1323
1281
|
)
|
|
1324
1282
|
|
|
1325
|
-
def drop(
|
|
1283
|
+
def drop( # NOSONAR
|
|
1326
1284
|
self,
|
|
1327
1285
|
abstract: Callable[..., Any] = None,
|
|
1328
1286
|
alias: str = None
|
|
@@ -1938,7 +1896,8 @@ class Container(IContainer):
|
|
|
1938
1896
|
|
|
1939
1897
|
# If there are unresolved dependencies, raise an exception
|
|
1940
1898
|
if dependencies.unresolved:
|
|
1941
|
-
unresolved_args =
|
|
1899
|
+
unresolved_args = list(dependencies.unresolved.keys())
|
|
1900
|
+
|
|
1942
1901
|
raise OrionisContainerException(
|
|
1943
1902
|
f"Cannot invoke callable '{getattr(fn, '__name__', str(fn))}' because the following required arguments are missing: [{', '.join(unresolved_args)}]."
|
|
1944
1903
|
)
|
|
@@ -2096,7 +2055,8 @@ class Container(IContainer):
|
|
|
2096
2055
|
|
|
2097
2056
|
# Check for unresolved dependencies
|
|
2098
2057
|
if dependencies.unresolved:
|
|
2099
|
-
unresolved_args =
|
|
2058
|
+
unresolved_args = list(dependencies.unresolved.keys())
|
|
2059
|
+
|
|
2100
2060
|
raise OrionisContainerException(
|
|
2101
2061
|
f"Cannot resolve '{name}' because the following required arguments are missing: [{', '.join(unresolved_args)}]."
|
|
2102
2062
|
)
|
|
@@ -2120,7 +2080,7 @@ class Container(IContainer):
|
|
|
2120
2080
|
f"Error resolving dependencies for '{name}': {str(e)}"
|
|
2121
2081
|
) from e
|
|
2122
2082
|
|
|
2123
|
-
def __resolveSingleDependency(
|
|
2083
|
+
def __resolveSingleDependency( # NOSONAR
|
|
2124
2084
|
self,
|
|
2125
2085
|
name: str,
|
|
2126
2086
|
param_name: str,
|
|
@@ -2278,12 +2238,7 @@ class Container(IContainer):
|
|
|
2278
2238
|
try:
|
|
2279
2239
|
|
|
2280
2240
|
# If explicit arguments are provided, attempt direct instantiation or invocation
|
|
2281
|
-
if args or kwargs:
|
|
2282
|
-
if isinstance(type_, type):
|
|
2283
|
-
# Instantiate the class directly with provided arguments
|
|
2284
|
-
return type_(*args, **kwargs)
|
|
2285
|
-
elif callable(type_):
|
|
2286
|
-
# Invoke the callable directly with provided arguments
|
|
2241
|
+
if args or kwargs and callable(type_):
|
|
2287
2242
|
return type_(*args, **kwargs)
|
|
2288
2243
|
|
|
2289
2244
|
# Attempt auto-resolution for eligible types
|
orionis/metadata/framework.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
orionis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
orionis/console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
orionis/console/kernel.py,sha256=
|
|
3
|
+
orionis/console/kernel.py,sha256=rBIDB6nm_PJ8JnWGAdq8bon9qjmy9vB4RRFRLmz23gc,3748
|
|
4
4
|
orionis/console/args/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
orionis/console/args/argument.py,sha256=
|
|
5
|
+
orionis/console/args/argument.py,sha256=y3uoa_X84Lv7_WPQIygRPj5aNGS2d3agvj5IPaVEu3Y,20330
|
|
6
6
|
orionis/console/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
orionis/console/base/command.py,sha256=tAO_EVy1aNWneNSKYYMAf9yDTfbvHAqSJnZZ6pOR4tE,9318
|
|
8
8
|
orionis/console/base/scheduler.py,sha256=JoZdtyrVJiNzBoVEWUovHscqBxqw_fPPwaENIQc4Zp4,7644
|
|
@@ -12,14 +12,14 @@ orionis/console/commands/__publisher__.py,sha256=xVFMVU4xrhmLK_ztou5UWJ2ONpzPc1f
|
|
|
12
12
|
orionis/console/commands/__workflow__.py,sha256=16fpHjkMmdVI9cCemADLqNz3U50oaLoVTapGdbigrYU,3095
|
|
13
13
|
orionis/console/commands/cache_clear.py,sha256=iwdMdRLw8BAGkR-OcBB3JD9pOidC3jWT-W-DUrENywQ,3048
|
|
14
14
|
orionis/console/commands/help.py,sha256=VFIn3UqQm4pxwjfSQohVwKNpc7F-6XRcwSZQwDSLEaU,3739
|
|
15
|
-
orionis/console/commands/log_clear.py,sha256=
|
|
16
|
-
orionis/console/commands/make_command.py,sha256=
|
|
17
|
-
orionis/console/commands/scheduler_list.py,sha256=
|
|
18
|
-
orionis/console/commands/scheduler_work.py,sha256=
|
|
15
|
+
orionis/console/commands/log_clear.py,sha256=OI1j_myCYUOMI-SfnN-NH-6BYzzWKXOKIEb55vFTXq4,4045
|
|
16
|
+
orionis/console/commands/make_command.py,sha256=WHE2J78fuY9RHScCOn9R_2KjkiayYJHFlm-Mp-k8X-o,5956
|
|
17
|
+
orionis/console/commands/scheduler_list.py,sha256=7Ug0eoqusIOsmHaiakm3-JYAK8VNIypOtKMcSzn-AL0,4544
|
|
18
|
+
orionis/console/commands/scheduler_work.py,sha256=NV-WhJwY4Lv_x6UO2FcWikA1HFFK-PmJWm-oHQPs0fg,5573
|
|
19
19
|
orionis/console/commands/test.py,sha256=LXtl918TmYhg0sjBiCfbsvaXUmCLqwCXTazmy7AJhlE,2445
|
|
20
20
|
orionis/console/commands/version.py,sha256=u5_8CfnEVdS3VSME8rbP6o3Z0XFZ30nSz8uHdahBAoY,4766
|
|
21
21
|
orionis/console/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
|
-
orionis/console/contracts/base_command.py,sha256=
|
|
22
|
+
orionis/console/contracts/base_command.py,sha256=0N1XeV2AdAJaCZCAJNpwItx3YI4GDQmVGrfApx0r0B4,7513
|
|
23
23
|
orionis/console/contracts/base_scheduler.py,sha256=RSxEW57MoMU3pXfliIrQw9WuMk95p-xHXi1yACp1qsU,7728
|
|
24
24
|
orionis/console/contracts/cli_request.py,sha256=Q5eiOitdZve-33e5dqO_O-Fha5I1u4u7z7XFPz79dZU,3366
|
|
25
25
|
orionis/console/contracts/command.py,sha256=Wvm62hw2gDIPNmoEUFyhKUERjZ6wnAbI-UDY_5gJE24,3626
|
|
@@ -33,7 +33,7 @@ orionis/console/contracts/reactor.py,sha256=iT6ShoCutAWEeJzOf_PK7CGXi9TgrOD5tewH
|
|
|
33
33
|
orionis/console/contracts/schedule.py,sha256=xtXgp4BPhvhg3YSM4mrIdbyoBdr4OJBi1gBM_kJN5UQ,13694
|
|
34
34
|
orionis/console/contracts/schedule_event_listener.py,sha256=h06qsBxuEMD3KLSyu0JXdUDHlQW19BX9lA09Qrh2QXg,3818
|
|
35
35
|
orionis/console/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
|
-
orionis/console/core/reactor.py,sha256=
|
|
36
|
+
orionis/console/core/reactor.py,sha256=p9bA-hZ7TDp8qLVMKjFWjwhY-omQcvhUYZ25bOyWWsg,44063
|
|
37
37
|
orionis/console/debug/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
38
|
orionis/console/debug/dumper.py,sha256=vbmP_GlrzBj0KDjiQl4iDudPRe6V0W5r5UA8i3h9_c4,6555
|
|
39
39
|
orionis/console/dynamic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -42,12 +42,12 @@ orionis/console/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
42
42
|
orionis/console/entities/command.py,sha256=NPdyG4U3JtDMOS7Em2_AklNyyuoTnKxyGseMWrADlc4,1571
|
|
43
43
|
orionis/console/entities/event.py,sha256=44exJIBMB8v_Dixv2qgatl2ln-Tmv7g2b63oetsJFHc,3015
|
|
44
44
|
orionis/console/entities/event_job.py,sha256=b8fbloHnf7qYtQ0W4d7MWw0jj4l07B0RtS3UkMJwE0M,4292
|
|
45
|
-
orionis/console/entities/scheduler_error.py,sha256=
|
|
45
|
+
orionis/console/entities/scheduler_error.py,sha256=VzwSK8DloX-tFlBLWX93sEV4oO0Qo9rheNjiOEjdNyE,1413
|
|
46
46
|
orionis/console/entities/scheduler_event_data.py,sha256=s9zYvLYO4O91l_9Qncx688QjcsjrIjXI8xsXqK2ZlHI,785
|
|
47
|
-
orionis/console/entities/scheduler_paused.py,sha256=
|
|
48
|
-
orionis/console/entities/scheduler_resumed.py,sha256=
|
|
49
|
-
orionis/console/entities/scheduler_shutdown.py,sha256=
|
|
50
|
-
orionis/console/entities/scheduler_started.py,sha256=
|
|
47
|
+
orionis/console/entities/scheduler_paused.py,sha256=b2FDkX-eZcVo6iNPFN_-fd4GARrLtsNYGkffIzPdREA,1196
|
|
48
|
+
orionis/console/entities/scheduler_resumed.py,sha256=CeQmSL4o5B3fcrmNEKB_xLoX2QHWMen5QiG11omGn-w,914
|
|
49
|
+
orionis/console/entities/scheduler_shutdown.py,sha256=NSfbZFryUzu4Z5hBJor3Cpg0CQ-UOAL0k2xEqRU9ubQ,1031
|
|
50
|
+
orionis/console/entities/scheduler_started.py,sha256=EaN9ypezjeyjnw3thqKZ7sF42EkNUqO-mCGEdpEVPnI,1063
|
|
51
51
|
orionis/console/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
52
52
|
orionis/console/enums/actions.py,sha256=1peNzH9R9RBf_uEXB1Q2__J5r-Rb7qm3pcRjbBkDc7g,1935
|
|
53
53
|
orionis/console/enums/listener.py,sha256=eIBWeWtg-FdTFbbPU43ChymAV3mXYZPj2H2FCyE10w8,2711
|
|
@@ -56,18 +56,18 @@ orionis/console/exceptions/__init__.py,sha256=rY9PE85TO_HpI5cfGWbZSDzk5aOUjErqBZ
|
|
|
56
56
|
orionis/console/exceptions/cli_exceptions.py,sha256=nk3EGkRheDbw8vrxKgUxkAAPA6gPpO2dE5nDeVHJHA0,3580
|
|
57
57
|
orionis/console/fluent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
58
58
|
orionis/console/fluent/command.py,sha256=0jyhB45LIjDS7nkjNhkkvEXEzdOBmT49qKIooYY_DbI,8261
|
|
59
|
-
orionis/console/fluent/event.py,sha256=
|
|
59
|
+
orionis/console/fluent/event.py,sha256=N1MqKdXwmsHx3KES07DVCLVrdwaIMWYAtzUzQmsfsAI,166739
|
|
60
60
|
orionis/console/output/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
61
|
-
orionis/console/output/console.py,sha256=
|
|
61
|
+
orionis/console/output/console.py,sha256=DjVvqIyvRniP_aAmIqkm7J_XSGez2AWW-m-NM_dYxZY,24263
|
|
62
62
|
orionis/console/output/executor.py,sha256=uQjFPOlyZLFj9pcyYPugCqxwJog0AJgK1OcmQH2ELbw,7314
|
|
63
63
|
orionis/console/request/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
64
|
-
orionis/console/request/cli_request.py,sha256=
|
|
64
|
+
orionis/console/request/cli_request.py,sha256=sH7Q2MpMIasiPiEPBeGhExnbfpSic98vQdAKvG9cgew,9071
|
|
65
65
|
orionis/console/stubs/command.stub,sha256=ABQ2eFxJ0u0DvTfmoO_DdECkBy-rie-woG62G2Gxw8Y,805
|
|
66
66
|
orionis/console/stubs/listener.stub,sha256=DbX-ghx2-vb73kzQ6L20lyg5vSKn58jSLTwFuwNQU9k,4331
|
|
67
67
|
orionis/console/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
68
|
-
orionis/console/tasks/schedule.py,sha256=
|
|
68
|
+
orionis/console/tasks/schedule.py,sha256=yhNkOt7uDPSqc7lEWozChBx2ua6hzyx0WV7OpHp_QoU,88121
|
|
69
69
|
orionis/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
70
|
-
orionis/container/container.py,sha256=
|
|
70
|
+
orionis/container/container.py,sha256=FpJCac-RmeC8WVadc7cP2IyaVCHREQBmYcIcxpiNajs,114170
|
|
71
71
|
orionis/container/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
72
72
|
orionis/container/context/manager.py,sha256=I08K_jKXSKmrq18Pv33qYyMKIlAovVOwIgmfiVm-J7c,2971
|
|
73
73
|
orionis/container/context/scope.py,sha256=p_oCzR7dDz-5ZAd16ab4vfLc3gBf34CaN0f4iR9D0bQ,1155
|
|
@@ -217,7 +217,7 @@ orionis/foundation/providers/scheduler_provider.py,sha256=IrPQJwvQVLRm5Qnz0Cxon4
|
|
|
217
217
|
orionis/foundation/providers/testing_provider.py,sha256=eI1p2lUlxl25b5Z487O4nmqLE31CTDb4c3Q21xFadkE,1615
|
|
218
218
|
orionis/foundation/providers/workers_provider.py,sha256=GdHENYV_yGyqmHJHn0DCyWmWId5xWjD48e6Zq2PGCWY,1674
|
|
219
219
|
orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
220
|
-
orionis/metadata/framework.py,sha256=
|
|
220
|
+
orionis/metadata/framework.py,sha256=YYcr6yjJDmEsRxMEV07IXXZA-D6oSxuk_NPIGNkII9Q,4089
|
|
221
221
|
orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
|
|
222
222
|
orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
223
223
|
orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -404,8 +404,8 @@ orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnI
|
|
|
404
404
|
orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
405
405
|
orionis/test/view/render.py,sha256=R55ykeRs0wDKcdTf4O1YZ8GDHTFmJ0IK6VQkbJkYUvo,5571
|
|
406
406
|
orionis/test/view/report.stub,sha256=QLqqCdRoENr3ECiritRB3DO_MOjRQvgBh5jxZ3Hs1r0,28189
|
|
407
|
-
orionis-0.
|
|
408
|
-
orionis-0.
|
|
409
|
-
orionis-0.
|
|
410
|
-
orionis-0.
|
|
411
|
-
orionis-0.
|
|
407
|
+
orionis-0.660.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
|
|
408
|
+
orionis-0.660.0.dist-info/METADATA,sha256=vWbYYanYYqcSKwOb9oA4Dw23CNuCqKdqV4mM-VoMM_U,4772
|
|
409
|
+
orionis-0.660.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
410
|
+
orionis-0.660.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
|
|
411
|
+
orionis-0.660.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|