orionis 0.488.0__py3-none-any.whl → 0.489.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/base/contracts/scheduler.py +38 -0
- orionis/console/base/scheduler.py +80 -10
- orionis/console/commands/help.py +2 -1
- orionis/console/commands/scheduler_list.py +2 -4
- orionis/console/commands/scheduler_work.py +1 -0
- orionis/console/contracts/listener.py +132 -0
- orionis/console/core/reactor.py +9 -4
- orionis/console/entities/request.py +35 -0
- orionis/console/kernel.py +23 -22
- orionis/console/output/console.py +5 -25
- orionis/console/tasks/event.py +1 -1
- orionis/failure/__init__.py +0 -0
- orionis/failure/catch.py +148 -0
- orionis/failure/contracts/__init__.py +0 -0
- orionis/failure/contracts/catch.py +91 -0
- orionis/failure/entities/__init__.py +0 -0
- orionis/failure/entities/throwable.py +33 -0
- orionis/foundation/application.py +3 -1
- orionis/foundation/providers/catch_provider.py +49 -0
- orionis/metadata/framework.py +1 -1
- {orionis-0.488.0.dist-info → orionis-0.489.0.dist-info}/METADATA +1 -1
- {orionis-0.488.0.dist-info → orionis-0.489.0.dist-info}/RECORD +26 -18
- orionis/console/contracts/event_listener.py +0 -27
- orionis/services/file/storage.py +0 -7
- {orionis-0.488.0.dist-info → orionis-0.489.0.dist-info}/WHEEL +0 -0
- {orionis-0.488.0.dist-info → orionis-0.489.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.488.0.dist-info → orionis-0.489.0.dist-info}/top_level.txt +0 -0
- {orionis-0.488.0.dist-info → orionis-0.489.0.dist-info}/zip-safe +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from datetime import datetime
|
|
3
|
+
from orionis.console.contracts.schedule import ISchedule
|
|
4
|
+
|
|
5
|
+
class IBaseScheduler(ABC):
|
|
6
|
+
|
|
7
|
+
# Pause Global Scheduler at a specific time
|
|
8
|
+
PAUSE_AT: datetime = None
|
|
9
|
+
|
|
10
|
+
# Resume Global Scheduler at a specific time
|
|
11
|
+
RESUME_AT: datetime = None
|
|
12
|
+
|
|
13
|
+
# Finalize Global Scheduler at a specific time
|
|
14
|
+
FINALIZE_AT: datetime = None
|
|
15
|
+
|
|
16
|
+
@abstractmethod
|
|
17
|
+
def tasks(self, schedule: ISchedule):
|
|
18
|
+
"""
|
|
19
|
+
Defines and registers scheduled tasks for the application.
|
|
20
|
+
|
|
21
|
+
Parameters
|
|
22
|
+
----------
|
|
23
|
+
schedule : ISchedule
|
|
24
|
+
The schedule object used to define and register scheduled commands.
|
|
25
|
+
|
|
26
|
+
Returns
|
|
27
|
+
-------
|
|
28
|
+
None
|
|
29
|
+
This method does not return any value. It is intended to be overridden
|
|
30
|
+
by subclasses to specify scheduled tasks.
|
|
31
|
+
|
|
32
|
+
Notes
|
|
33
|
+
-----
|
|
34
|
+
This method should be implemented in subclasses to add specific tasks
|
|
35
|
+
to the scheduler using the provided `schedule` object.
|
|
36
|
+
"""
|
|
37
|
+
# This method should be overridden in subclasses to define scheduled tasks.
|
|
38
|
+
pass
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
+
from orionis.console.base.contracts.scheduler import IBaseScheduler
|
|
2
3
|
from orionis.console.contracts.schedule import ISchedule
|
|
3
4
|
|
|
4
|
-
class BaseScheduler:
|
|
5
|
+
class BaseScheduler(IBaseScheduler):
|
|
5
6
|
|
|
6
7
|
# Pause Global Scheduler at a specific time
|
|
7
8
|
PAUSE_AT: datetime = None
|
|
@@ -29,28 +30,97 @@ class BaseScheduler:
|
|
|
29
30
|
|
|
30
31
|
Notes
|
|
31
32
|
-----
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
Subclasses should implement this method to add specific tasks to the scheduler
|
|
34
|
+
using the provided `schedule` object. This method enforces that each subclass
|
|
35
|
+
defines its own scheduled tasks.
|
|
34
36
|
"""
|
|
35
|
-
#
|
|
36
|
-
|
|
37
|
+
# Raise an error to enforce implementation in subclasses
|
|
38
|
+
raise NotImplementedError("The 'tasks' method must be implemented in the subclass.")
|
|
37
39
|
|
|
38
40
|
def onStarted(self):
|
|
39
|
-
|
|
41
|
+
"""
|
|
42
|
+
Called when the scheduler is started.
|
|
43
|
+
|
|
44
|
+
Returns
|
|
45
|
+
-------
|
|
46
|
+
None
|
|
47
|
+
This method does not return any value.
|
|
48
|
+
|
|
49
|
+
Notes
|
|
50
|
+
-----
|
|
51
|
+
Intended to be overridden by subclasses to implement custom behavior that should
|
|
52
|
+
occur when the scheduler starts running.
|
|
53
|
+
"""
|
|
54
|
+
# Placeholder for logic to execute when the scheduler starts
|
|
40
55
|
pass
|
|
41
56
|
|
|
42
57
|
def onPaused(self):
|
|
43
|
-
|
|
58
|
+
"""
|
|
59
|
+
Called when the scheduler is paused.
|
|
60
|
+
|
|
61
|
+
Returns
|
|
62
|
+
-------
|
|
63
|
+
None
|
|
64
|
+
This method does not return any value.
|
|
65
|
+
|
|
66
|
+
Notes
|
|
67
|
+
-----
|
|
68
|
+
Should be overridden to define custom behavior that occurs when the scheduler
|
|
69
|
+
enters a paused state.
|
|
70
|
+
"""
|
|
71
|
+
# Placeholder for logic to execute when the scheduler is paused
|
|
44
72
|
pass
|
|
45
73
|
|
|
46
74
|
def onResumed(self):
|
|
47
|
-
|
|
75
|
+
"""
|
|
76
|
+
Called when the scheduler is resumed from a paused state.
|
|
77
|
+
|
|
78
|
+
Returns
|
|
79
|
+
-------
|
|
80
|
+
None
|
|
81
|
+
This method does not return any value.
|
|
82
|
+
|
|
83
|
+
Notes
|
|
84
|
+
-----
|
|
85
|
+
Should be overridden to implement any actions that need to occur when the
|
|
86
|
+
scheduler resumes operation.
|
|
87
|
+
"""
|
|
88
|
+
# Placeholder for logic to execute when the scheduler is resumed
|
|
48
89
|
pass
|
|
49
90
|
|
|
50
91
|
def onFinalized(self):
|
|
51
|
-
|
|
92
|
+
"""
|
|
93
|
+
Called when the scheduler has completed its execution and is being finalized.
|
|
94
|
+
|
|
95
|
+
Returns
|
|
96
|
+
-------
|
|
97
|
+
None
|
|
98
|
+
This method does not return any value.
|
|
99
|
+
|
|
100
|
+
Notes
|
|
101
|
+
-----
|
|
102
|
+
Can be overridden to perform any necessary cleanup or finalization tasks.
|
|
103
|
+
"""
|
|
104
|
+
# Placeholder for logic to execute when the scheduler is finalized
|
|
52
105
|
pass
|
|
53
106
|
|
|
54
107
|
def onError(self, error: Exception):
|
|
55
|
-
|
|
108
|
+
"""
|
|
109
|
+
Handles errors that occur within the scheduler.
|
|
110
|
+
|
|
111
|
+
Parameters
|
|
112
|
+
----------
|
|
113
|
+
error : Exception
|
|
114
|
+
The exception instance representing the error that occurred.
|
|
115
|
+
|
|
116
|
+
Returns
|
|
117
|
+
-------
|
|
118
|
+
None
|
|
119
|
+
This method does not return any value.
|
|
120
|
+
|
|
121
|
+
Notes
|
|
122
|
+
-----
|
|
123
|
+
Can be overridden to implement custom error handling logic for the scheduler.
|
|
124
|
+
"""
|
|
125
|
+
# Placeholder for logic to handle errors in the scheduler
|
|
56
126
|
pass
|
orionis/console/commands/help.py
CHANGED
|
@@ -40,7 +40,8 @@ class HelpCommand(BaseCommand):
|
|
|
40
40
|
try:
|
|
41
41
|
|
|
42
42
|
# Retrieve the list of available commands from the reactor
|
|
43
|
-
|
|
43
|
+
# List of dicts with 'signature' and 'description'
|
|
44
|
+
commands = reactor.info()
|
|
44
45
|
|
|
45
46
|
# Initialize the rich console for formatted output
|
|
46
47
|
console = Console()
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import importlib
|
|
2
|
-
import os
|
|
3
|
-
from pathlib import Path
|
|
4
1
|
from rich.console import Console
|
|
5
2
|
from rich.panel import Panel
|
|
6
3
|
from rich.table import Table
|
|
@@ -88,7 +85,7 @@ class ScheduleListCommand(BaseCommand):
|
|
|
88
85
|
table.add_column("Signature", style="cyan", no_wrap=True)
|
|
89
86
|
table.add_column("Arguments", style="magenta")
|
|
90
87
|
table.add_column("Purpose", style="green")
|
|
91
|
-
table.add_column("Random Delay", style="yellow")
|
|
88
|
+
table.add_column("Random Delay (calculated result)", style="yellow")
|
|
92
89
|
table.add_column("Start Date", style="white")
|
|
93
90
|
table.add_column("End Date", style="white")
|
|
94
91
|
table.add_column("Details", style="dim")
|
|
@@ -112,6 +109,7 @@ class ScheduleListCommand(BaseCommand):
|
|
|
112
109
|
return True
|
|
113
110
|
|
|
114
111
|
except Exception as exc:
|
|
112
|
+
|
|
115
113
|
# Catch any unexpected exceptions and raise as a CLIOrionisRuntimeError
|
|
116
114
|
raise CLIOrionisRuntimeError(
|
|
117
115
|
f"An unexpected error occurred while listing the scheduled jobs: {exc}"
|
|
@@ -102,6 +102,7 @@ class ScheduleWorkCommand(BaseCommand):
|
|
|
102
102
|
return True
|
|
103
103
|
|
|
104
104
|
except Exception as exc:
|
|
105
|
+
|
|
105
106
|
# Raise any unexpected exceptions as CLIOrionisRuntimeError
|
|
106
107
|
raise CLIOrionisRuntimeError(
|
|
107
108
|
f"An unexpected error occurred while starting the scheduler worker: {exc}"
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
|
|
3
|
+
class IEventListener(ABC):
|
|
4
|
+
"""
|
|
5
|
+
Interface for event listeners that handle various stages of event processing.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
@abstractmethod
|
|
9
|
+
def before(self, event):
|
|
10
|
+
"""
|
|
11
|
+
Hook method called before the main event handling logic.
|
|
12
|
+
|
|
13
|
+
Parameters
|
|
14
|
+
----------
|
|
15
|
+
event : object
|
|
16
|
+
The event object that is about to be processed.
|
|
17
|
+
|
|
18
|
+
Returns
|
|
19
|
+
-------
|
|
20
|
+
None
|
|
21
|
+
This method does not return anything.
|
|
22
|
+
|
|
23
|
+
Notes
|
|
24
|
+
-----
|
|
25
|
+
Override this method to implement logic that should run before the event is handled.
|
|
26
|
+
"""
|
|
27
|
+
pass
|
|
28
|
+
|
|
29
|
+
@abstractmethod
|
|
30
|
+
def after(self, event):
|
|
31
|
+
"""
|
|
32
|
+
Hook method called after an event is processed.
|
|
33
|
+
|
|
34
|
+
Parameters
|
|
35
|
+
----------
|
|
36
|
+
event : object
|
|
37
|
+
The event object that was processed.
|
|
38
|
+
|
|
39
|
+
Returns
|
|
40
|
+
-------
|
|
41
|
+
None
|
|
42
|
+
This method does not return anything.
|
|
43
|
+
|
|
44
|
+
Notes
|
|
45
|
+
-----
|
|
46
|
+
Override this method to implement logic that should run after the event is handled.
|
|
47
|
+
"""
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
@abstractmethod
|
|
51
|
+
def onSuccess(self, event):
|
|
52
|
+
"""
|
|
53
|
+
Handle actions to be performed when an event is successfully processed.
|
|
54
|
+
|
|
55
|
+
Parameters
|
|
56
|
+
----------
|
|
57
|
+
event : object
|
|
58
|
+
The event object that triggered the success callback.
|
|
59
|
+
|
|
60
|
+
Returns
|
|
61
|
+
-------
|
|
62
|
+
None
|
|
63
|
+
This method does not return anything.
|
|
64
|
+
|
|
65
|
+
Notes
|
|
66
|
+
-----
|
|
67
|
+
Override this method to define actions on successful event processing.
|
|
68
|
+
"""
|
|
69
|
+
pass
|
|
70
|
+
|
|
71
|
+
@abstractmethod
|
|
72
|
+
def onFailure(self, event):
|
|
73
|
+
"""
|
|
74
|
+
Handle the event when a failure occurs during event processing.
|
|
75
|
+
|
|
76
|
+
Parameters
|
|
77
|
+
----------
|
|
78
|
+
event : object
|
|
79
|
+
The event object containing information about the failure.
|
|
80
|
+
|
|
81
|
+
Returns
|
|
82
|
+
-------
|
|
83
|
+
None
|
|
84
|
+
This method does not return anything.
|
|
85
|
+
|
|
86
|
+
Notes
|
|
87
|
+
-----
|
|
88
|
+
Override this method to define actions when event processing fails.
|
|
89
|
+
"""
|
|
90
|
+
pass
|
|
91
|
+
|
|
92
|
+
@abstractmethod
|
|
93
|
+
def onMissed(self, event):
|
|
94
|
+
"""
|
|
95
|
+
Handle the event when an expected event is missed.
|
|
96
|
+
|
|
97
|
+
Parameters
|
|
98
|
+
----------
|
|
99
|
+
event : object
|
|
100
|
+
The event object that was missed.
|
|
101
|
+
|
|
102
|
+
Returns
|
|
103
|
+
-------
|
|
104
|
+
None
|
|
105
|
+
This method does not return anything.
|
|
106
|
+
|
|
107
|
+
Notes
|
|
108
|
+
-----
|
|
109
|
+
Override this method to define actions when an event is missed.
|
|
110
|
+
"""
|
|
111
|
+
pass
|
|
112
|
+
|
|
113
|
+
@abstractmethod
|
|
114
|
+
def onMaxInstances(self, event):
|
|
115
|
+
"""
|
|
116
|
+
Handles the event triggered when the maximum number of instances is reached.
|
|
117
|
+
|
|
118
|
+
Parameters
|
|
119
|
+
----------
|
|
120
|
+
event : object
|
|
121
|
+
The event object containing information about the max instances event.
|
|
122
|
+
|
|
123
|
+
Returns
|
|
124
|
+
-------
|
|
125
|
+
None
|
|
126
|
+
This method does not return anything.
|
|
127
|
+
|
|
128
|
+
Notes
|
|
129
|
+
-----
|
|
130
|
+
Override this method to define actions when the maximum number of instances is reached.
|
|
131
|
+
"""
|
|
132
|
+
pass
|
orionis/console/core/reactor.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import argparse
|
|
2
2
|
import os
|
|
3
3
|
import re
|
|
4
|
-
from pathlib import Path
|
|
5
4
|
from typing import Any, List, Optional
|
|
6
5
|
from orionis.console.args.argument import CLIArgument
|
|
7
6
|
from orionis.console.base.command import BaseCommand
|
|
@@ -9,8 +8,10 @@ from orionis.console.base.contracts.command import IBaseCommand
|
|
|
9
8
|
from orionis.console.contracts.reactor import IReactor
|
|
10
9
|
from orionis.console.enums.command import Command
|
|
11
10
|
from orionis.console.exceptions import CLIOrionisValueError
|
|
11
|
+
from orionis.console.exceptions.cli_runtime_error import CLIOrionisRuntimeError
|
|
12
12
|
from orionis.console.output.contracts.console import IConsole
|
|
13
13
|
from orionis.console.output.contracts.executor import IExecutor
|
|
14
|
+
from orionis.container.exceptions.exception import OrionisContainerException
|
|
14
15
|
from orionis.foundation.contracts.application import IApplication
|
|
15
16
|
from orionis.services.introspection.modules.reflection import ReflectionModule
|
|
16
17
|
from orionis.services.log.contracts.log_service import ILogger
|
|
@@ -58,13 +59,13 @@ class Reactor(IReactor):
|
|
|
58
59
|
self.__app = app
|
|
59
60
|
|
|
60
61
|
# Set the project root directory to current working directory for module path resolution
|
|
61
|
-
self.__root = self.__app.path('root')
|
|
62
|
+
self.__root = self.__app.path('root')
|
|
62
63
|
|
|
63
64
|
# Initialize the internal command registry as an empty dictionary
|
|
64
65
|
self.__commands: dict[str, Command] = {}
|
|
65
66
|
|
|
66
67
|
# Automatically discover and load command classes from the console commands directory
|
|
67
|
-
self.__loadCommands(
|
|
68
|
+
self.__loadCommands(self.__app.path('commands'), self.__root)
|
|
68
69
|
|
|
69
70
|
# Load core command classes provided by the Orionis framework
|
|
70
71
|
self.__loadCoreCommands()
|
|
@@ -581,8 +582,12 @@ class Reactor(IReactor):
|
|
|
581
582
|
return output
|
|
582
583
|
|
|
583
584
|
except Exception as e:
|
|
585
|
+
|
|
584
586
|
# Display the error message in the console (without timestamp)
|
|
585
|
-
|
|
587
|
+
if isinstance(e, OrionisContainerException):
|
|
588
|
+
pass
|
|
589
|
+
elif isinstance(e, CLIOrionisRuntimeError):
|
|
590
|
+
self.__console.error(f"An error occurred while executing command '{signature}': {e}", timestamp=False)
|
|
586
591
|
|
|
587
592
|
# Log the error in the logger service
|
|
588
593
|
self.__logger.error(f"Command '{signature}' execution failed: {e}")
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from dataclasses import dataclass, field
|
|
2
|
+
from orionis.support.entities.base import BaseEntity
|
|
3
|
+
|
|
4
|
+
@dataclass(kw_only=True)
|
|
5
|
+
class CLIRequest(BaseEntity):
|
|
6
|
+
"""
|
|
7
|
+
Represents a command-line interface (CLI) request.
|
|
8
|
+
|
|
9
|
+
Parameters
|
|
10
|
+
----------
|
|
11
|
+
command : str
|
|
12
|
+
The command to be executed by the CLI.
|
|
13
|
+
args : list of str, optional
|
|
14
|
+
A list of arguments passed to the command. Defaults to an empty list.
|
|
15
|
+
|
|
16
|
+
Returns
|
|
17
|
+
-------
|
|
18
|
+
CLIRequest
|
|
19
|
+
An instance of the CLIRequest class encapsulating the command and its arguments.
|
|
20
|
+
|
|
21
|
+
Attributes
|
|
22
|
+
----------
|
|
23
|
+
command : str
|
|
24
|
+
The command to be executed.
|
|
25
|
+
args : list of str
|
|
26
|
+
The arguments associated with the command.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
# The command to execute
|
|
30
|
+
command: str
|
|
31
|
+
|
|
32
|
+
# Arguments for the command; defaults to an empty list if not provided
|
|
33
|
+
args: list[str] = field(
|
|
34
|
+
default_factory=list
|
|
35
|
+
)
|
orionis/console/kernel.py
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
from typing import List
|
|
1
3
|
from orionis.console.contracts.kernel import IKernelCLI
|
|
2
4
|
from orionis.console.contracts.reactor import IReactor
|
|
3
|
-
from orionis.console.
|
|
5
|
+
from orionis.console.entities.request import CLIRequest
|
|
6
|
+
from orionis.failure.contracts.catch import ICatch
|
|
4
7
|
from orionis.foundation.contracts.application import IApplication
|
|
5
8
|
from orionis.console.exceptions import CLIOrionisValueError
|
|
6
|
-
from orionis.services.log.contracts.log_service import ILogger
|
|
7
9
|
|
|
8
10
|
class KernelCLI(IKernelCLI):
|
|
9
11
|
|
|
@@ -40,13 +42,10 @@ class KernelCLI(IKernelCLI):
|
|
|
40
42
|
# The reactor is responsible for dispatching CLI commands.
|
|
41
43
|
self.__reactor: IReactor = app.make('x-orionis.console.core.reactor')
|
|
42
44
|
|
|
43
|
-
# Retrieve and initialize the
|
|
44
|
-
self.
|
|
45
|
+
# Retrieve and initialize the catch instance from the application container.
|
|
46
|
+
self.__catch: ICatch = app.make('x-orionis.failure.catch')
|
|
45
47
|
|
|
46
|
-
|
|
47
|
-
self.__logger: ILogger = app.make('x-orionis.services.log.log_service')
|
|
48
|
-
|
|
49
|
-
def handle(self, args: list) -> None:
|
|
48
|
+
def handle(self, args: List[str] = []) -> None:
|
|
50
49
|
"""
|
|
51
50
|
Processes and dispatches command line arguments to the appropriate command handler.
|
|
52
51
|
|
|
@@ -89,21 +88,23 @@ class KernelCLI(IKernelCLI):
|
|
|
89
88
|
if len(args) == 1:
|
|
90
89
|
return self.__reactor.call(args[0])
|
|
91
90
|
|
|
92
|
-
#
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
# Log the SystemExit exception for debugging purposes
|
|
98
|
-
self.__logger.error(f"SystemExit encountered: {str(e)}")
|
|
91
|
+
# Create a CLIRequest instance with the command and its arguments
|
|
92
|
+
command = CLIRequest(
|
|
93
|
+
command=args[0],
|
|
94
|
+
args=args[1:]
|
|
95
|
+
)
|
|
99
96
|
|
|
100
|
-
#
|
|
101
|
-
self.
|
|
97
|
+
# If command and arguments are provided, call the command with its arguments
|
|
98
|
+
return self.__reactor.call(
|
|
99
|
+
command.command,
|
|
100
|
+
command.args
|
|
101
|
+
)
|
|
102
102
|
|
|
103
|
-
except
|
|
103
|
+
except BaseException as e:
|
|
104
104
|
|
|
105
|
-
#
|
|
106
|
-
self.
|
|
105
|
+
# Catch any exceptions that occur during command handling
|
|
106
|
+
self.__catch.report(e)
|
|
107
|
+
self.__catch.renderCLI(args, e)
|
|
107
108
|
|
|
108
|
-
#
|
|
109
|
-
|
|
109
|
+
# Exit the process with a non-zero status code to indicate an error
|
|
110
|
+
sys.exit(1)
|
|
@@ -4,7 +4,6 @@ import os
|
|
|
4
4
|
import sys
|
|
5
5
|
from orionis.console.output.enums import ANSIColors
|
|
6
6
|
from orionis.console.output.contracts.console import IConsole
|
|
7
|
-
from orionis.support.formatter.serializer import Parser
|
|
8
7
|
|
|
9
8
|
class Console(IConsole):
|
|
10
9
|
"""
|
|
@@ -512,31 +511,12 @@ class Console(IConsole):
|
|
|
512
511
|
-----
|
|
513
512
|
This method prints the exception type, message, and a detailed stack trace.
|
|
514
513
|
"""
|
|
514
|
+
from rich.console import Console as RichConsole
|
|
515
|
+
from rich.traceback import Traceback
|
|
515
516
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
stack_trace = errors.get("stack_trace")
|
|
520
|
-
|
|
521
|
-
# Format the output with a more eye-catching appearance
|
|
522
|
-
message = f"{ANSIColors.BG_ERROR.value}{ANSIColors.TEXT_WHITE.value}[{error_type}]{ANSIColors.TEXT_RESET.value}: {ANSIColors.TEXT_WARNING.value}{error_message}{ANSIColors.TEXT_RESET.value}"
|
|
523
|
-
print("▬" * len(f" [{error_type}] : {error_message}"))
|
|
524
|
-
print(message)
|
|
525
|
-
|
|
526
|
-
real_count = len(stack_trace)
|
|
527
|
-
count_error = real_count
|
|
528
|
-
for frame in stack_trace:
|
|
529
|
-
filename = frame["filename"]
|
|
530
|
-
lineno = frame["lineno"]
|
|
531
|
-
name = frame["name"]
|
|
532
|
-
line = frame["line"]
|
|
533
|
-
|
|
534
|
-
# Print the stack trace with enhanced styling
|
|
535
|
-
print(f"{ANSIColors.TEXT_MUTED.value}Trace Call ({count_error}/{real_count}){ANSIColors.TEXT_RESET.value} - {ANSIColors.TEXT_WHITE.value}{filename}:{lineno}{ANSIColors.TEXT_RESET.value}")
|
|
536
|
-
print(f" {ANSIColors.DIM.value}{ANSIColors.ITALIC.value}{ANSIColors.TEXT_WARNING.value}{name}{ANSIColors.TEXT_RESET.value} : {ANSIColors.CYAN.value}{line}{ANSIColors.TEXT_RESET.value}")
|
|
537
|
-
count_error -= 1
|
|
538
|
-
|
|
539
|
-
print("▬" * len(f" [{error_type}] : {error_message}"))
|
|
517
|
+
rc = RichConsole()
|
|
518
|
+
rc.print("[bold red]❌ Exception caught in method[/]")
|
|
519
|
+
rc.print(Traceback.from_exception(type(e), e, e.__traceback__))
|
|
540
520
|
|
|
541
521
|
def exitSuccess(self, message: str = None) -> None:
|
|
542
522
|
"""
|
orionis/console/tasks/event.py
CHANGED
|
@@ -5,7 +5,7 @@ from apscheduler.triggers.cron import CronTrigger
|
|
|
5
5
|
from apscheduler.triggers.date import DateTrigger
|
|
6
6
|
from apscheduler.triggers.interval import IntervalTrigger
|
|
7
7
|
from orionis.console.contracts.event import IEvent
|
|
8
|
-
from orionis.console.contracts.
|
|
8
|
+
from orionis.console.contracts.listener import IEventListener
|
|
9
9
|
from orionis.console.enums.event import Event as EventEntity
|
|
10
10
|
from orionis.console.exceptions import CLIOrionisValueError
|
|
11
11
|
|
|
File without changes
|
orionis/failure/catch.py
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
from typing import Any, List
|
|
2
|
+
from orionis.console.output.contracts.console import IConsole
|
|
3
|
+
from orionis.failure.contracts.catch import ICatch
|
|
4
|
+
from orionis.failure.entities.throwable import Throwable
|
|
5
|
+
from orionis.foundation.contracts.application import IApplication
|
|
6
|
+
from orionis.services.log.contracts.log_service import ILogger
|
|
7
|
+
|
|
8
|
+
class Catch(ICatch):
|
|
9
|
+
|
|
10
|
+
def __init__(self, app: IApplication) -> None:
|
|
11
|
+
"""
|
|
12
|
+
Initializes the Catch handler with application services for console output and logging.
|
|
13
|
+
|
|
14
|
+
Parameters
|
|
15
|
+
----------
|
|
16
|
+
app : IApplication
|
|
17
|
+
The application instance used to resolve required services.
|
|
18
|
+
|
|
19
|
+
Attributes
|
|
20
|
+
----------
|
|
21
|
+
console : IConsole
|
|
22
|
+
Console output service obtained from the application for displaying messages and exceptions.
|
|
23
|
+
logger : ILogger
|
|
24
|
+
Logger service obtained from the application for logging errors and exceptions.
|
|
25
|
+
|
|
26
|
+
Returns
|
|
27
|
+
-------
|
|
28
|
+
None
|
|
29
|
+
This constructor does not return any value.
|
|
30
|
+
|
|
31
|
+
Notes
|
|
32
|
+
-----
|
|
33
|
+
The constructor retrieves the console and logger services from the application container
|
|
34
|
+
using their respective service keys. These services are used throughout the class for
|
|
35
|
+
error reporting and output.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
# Retrieve the console output service from the application container
|
|
39
|
+
self.console: IConsole = app.make('x-orionis.console.output.console')
|
|
40
|
+
|
|
41
|
+
# Retrieve the logger service from the application container
|
|
42
|
+
self.logger: ILogger = app.make('x-orionis.services.log.log_service')
|
|
43
|
+
|
|
44
|
+
def destructureException(self, e: BaseException) -> Throwable:
|
|
45
|
+
"""
|
|
46
|
+
Converts an exception into a structured `Throwable` object containing detailed information.
|
|
47
|
+
|
|
48
|
+
Parameters
|
|
49
|
+
----------
|
|
50
|
+
e : BaseException
|
|
51
|
+
The exception instance to be destructured.
|
|
52
|
+
|
|
53
|
+
Returns
|
|
54
|
+
-------
|
|
55
|
+
Throwable
|
|
56
|
+
A `Throwable` object encapsulating the exception's class type, message, arguments, and traceback.
|
|
57
|
+
|
|
58
|
+
Notes
|
|
59
|
+
-----
|
|
60
|
+
This method extracts the type, message, arguments, and traceback from the provided exception
|
|
61
|
+
and wraps them in a `Throwable` object for consistent error handling and reporting.
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
# Create and return a Throwable object with detailed exception information
|
|
65
|
+
return Throwable(
|
|
66
|
+
classtype=type(e), # The class/type of the exception
|
|
67
|
+
message=str(e), # The exception message as a string
|
|
68
|
+
args=e.args, # The arguments passed to the exception
|
|
69
|
+
traceback=getattr(e, '__traceback__', None) # The traceback object, if available
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
def report(self, exception: BaseException) -> Any:
|
|
73
|
+
"""
|
|
74
|
+
Logs and returns a destructured representation of an exception.
|
|
75
|
+
|
|
76
|
+
Parameters
|
|
77
|
+
----------
|
|
78
|
+
exception : BaseException
|
|
79
|
+
The exception instance to be reported.
|
|
80
|
+
|
|
81
|
+
Returns
|
|
82
|
+
-------
|
|
83
|
+
Throwable
|
|
84
|
+
A destructured representation of the exception, containing its type, message, arguments, and traceback.
|
|
85
|
+
|
|
86
|
+
Raises
|
|
87
|
+
------
|
|
88
|
+
TypeError
|
|
89
|
+
If the provided exception is not an instance of BaseException.
|
|
90
|
+
|
|
91
|
+
Notes
|
|
92
|
+
-----
|
|
93
|
+
This method logs the exception details using the configured logger and returns a structured
|
|
94
|
+
representation of the exception for further processing.
|
|
95
|
+
"""
|
|
96
|
+
|
|
97
|
+
# Ensure the provided object is an exception
|
|
98
|
+
if not isinstance(exception, BaseException):
|
|
99
|
+
raise TypeError(f"Expected BaseException, got {type(exception).__name__}")
|
|
100
|
+
|
|
101
|
+
# Convert the exception into a structured Throwable object
|
|
102
|
+
throwable = self.destructureException(exception)
|
|
103
|
+
|
|
104
|
+
# Log the exception details
|
|
105
|
+
self.logger.error(f"[{throwable.classtype.__name__}] {throwable.message}")
|
|
106
|
+
|
|
107
|
+
# Return the structured exception
|
|
108
|
+
return throwable
|
|
109
|
+
|
|
110
|
+
def renderCLI(self, args: List[str], exception: BaseException) -> Any:
|
|
111
|
+
"""
|
|
112
|
+
Renders a CLI-friendly error message for a given exception.
|
|
113
|
+
|
|
114
|
+
Parameters
|
|
115
|
+
----------
|
|
116
|
+
args : list
|
|
117
|
+
The list of command-line arguments that were passed to the CLI.
|
|
118
|
+
exception : BaseException
|
|
119
|
+
The exception instance to be rendered.
|
|
120
|
+
|
|
121
|
+
Returns
|
|
122
|
+
-------
|
|
123
|
+
None
|
|
124
|
+
This method does not return any value.
|
|
125
|
+
|
|
126
|
+
Raises
|
|
127
|
+
------
|
|
128
|
+
TypeError
|
|
129
|
+
If the provided exception is not an instance of BaseException.
|
|
130
|
+
|
|
131
|
+
Notes
|
|
132
|
+
-----
|
|
133
|
+
This method logs the error message using the configured logger and outputs
|
|
134
|
+
the exception traceback to the console for user visibility.
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
# Ensure the provided object is an exception
|
|
138
|
+
if not isinstance(exception, BaseException):
|
|
139
|
+
raise TypeError(f"Expected BaseException, got {type(exception).__name__}")
|
|
140
|
+
|
|
141
|
+
# Convert the exception into a structured Throwable object
|
|
142
|
+
throwable = self.destructureException(exception)
|
|
143
|
+
|
|
144
|
+
# Log the CLI error message with arguments
|
|
145
|
+
self.logger.error(f"CLI Error: {throwable.message} (Args: {args})")
|
|
146
|
+
|
|
147
|
+
# Output the exception traceback to the console
|
|
148
|
+
self.console.exception(exception)
|
|
File without changes
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from typing import Any, List
|
|
3
|
+
from orionis.foundation.contracts.application import IApplication
|
|
4
|
+
|
|
5
|
+
class ICatch(ABC):
|
|
6
|
+
|
|
7
|
+
@abstractmethod
|
|
8
|
+
def __init__(self, app: IApplication) -> None:
|
|
9
|
+
"""
|
|
10
|
+
Initializes the Catch handler with application services for console output and logging.
|
|
11
|
+
|
|
12
|
+
Parameters
|
|
13
|
+
----------
|
|
14
|
+
app : IApplication
|
|
15
|
+
The application instance used to resolve required services.
|
|
16
|
+
|
|
17
|
+
Attributes
|
|
18
|
+
----------
|
|
19
|
+
console : IConsole
|
|
20
|
+
Console output service obtained from the application for displaying messages and exceptions.
|
|
21
|
+
logger : ILogger
|
|
22
|
+
Logger service obtained from the application for logging errors and exceptions.
|
|
23
|
+
|
|
24
|
+
Returns
|
|
25
|
+
-------
|
|
26
|
+
None
|
|
27
|
+
This constructor does not return any value.
|
|
28
|
+
|
|
29
|
+
Notes
|
|
30
|
+
-----
|
|
31
|
+
The constructor retrieves the console and logger services from the application container
|
|
32
|
+
using their respective service keys. These services are used throughout the class for
|
|
33
|
+
error reporting and output.
|
|
34
|
+
"""
|
|
35
|
+
pass
|
|
36
|
+
|
|
37
|
+
@abstractmethod
|
|
38
|
+
def report(self, exception: BaseException) -> Any:
|
|
39
|
+
"""
|
|
40
|
+
Logs and returns a destructured representation of an exception.
|
|
41
|
+
|
|
42
|
+
Parameters
|
|
43
|
+
----------
|
|
44
|
+
exception : BaseException
|
|
45
|
+
The exception instance to be reported.
|
|
46
|
+
|
|
47
|
+
Returns
|
|
48
|
+
-------
|
|
49
|
+
Throwable
|
|
50
|
+
A destructured representation of the exception, containing its type, message, arguments, and traceback.
|
|
51
|
+
|
|
52
|
+
Raises
|
|
53
|
+
------
|
|
54
|
+
TypeError
|
|
55
|
+
If the provided exception is not an instance of BaseException.
|
|
56
|
+
|
|
57
|
+
Notes
|
|
58
|
+
-----
|
|
59
|
+
This method logs the exception details using the configured logger and returns a structured
|
|
60
|
+
representation of the exception for further processing.
|
|
61
|
+
"""
|
|
62
|
+
pass
|
|
63
|
+
|
|
64
|
+
@abstractmethod
|
|
65
|
+
def renderCLI(self, args: List[str], exception: BaseException) -> Any:
|
|
66
|
+
"""
|
|
67
|
+
Renders a CLI-friendly error message for a given exception.
|
|
68
|
+
|
|
69
|
+
Parameters
|
|
70
|
+
----------
|
|
71
|
+
args : list
|
|
72
|
+
The list of command-line arguments that were passed to the CLI.
|
|
73
|
+
exception : BaseException
|
|
74
|
+
The exception instance to be rendered.
|
|
75
|
+
|
|
76
|
+
Returns
|
|
77
|
+
-------
|
|
78
|
+
None
|
|
79
|
+
This method does not return any value.
|
|
80
|
+
|
|
81
|
+
Raises
|
|
82
|
+
------
|
|
83
|
+
TypeError
|
|
84
|
+
If the provided exception is not an instance of BaseException.
|
|
85
|
+
|
|
86
|
+
Notes
|
|
87
|
+
-----
|
|
88
|
+
This method logs the error message using the configured logger and outputs
|
|
89
|
+
the exception traceback to the console for user visibility.
|
|
90
|
+
"""
|
|
91
|
+
pass
|
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
@dataclass(kw_only=True)
|
|
4
|
+
class Throwable:
|
|
5
|
+
"""
|
|
6
|
+
Represents a throwable entity (such as an exception or error) within the framework.
|
|
7
|
+
|
|
8
|
+
Parameters
|
|
9
|
+
----------
|
|
10
|
+
classtype : type
|
|
11
|
+
The class type of the throwable, typically an exception class.
|
|
12
|
+
message : str
|
|
13
|
+
The error message describing the throwable.
|
|
14
|
+
args : tuple
|
|
15
|
+
Arguments passed to the throwable, usually corresponding to the exception arguments.
|
|
16
|
+
traceback : str, optional
|
|
17
|
+
The traceback information as a string, if available. Defaults to None.
|
|
18
|
+
|
|
19
|
+
Returns
|
|
20
|
+
-------
|
|
21
|
+
Throwable
|
|
22
|
+
An instance of the Throwable dataclass encapsulating exception details.
|
|
23
|
+
|
|
24
|
+
Notes
|
|
25
|
+
-----
|
|
26
|
+
This class is used to standardize the representation of exceptions and errors
|
|
27
|
+
throughout the framework, making error handling and logging more consistent.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
classtype: type # The type of the throwable (e.g., Exception class)
|
|
31
|
+
message: str # The error message associated with the throwable
|
|
32
|
+
args: tuple # Arguments passed to the throwable
|
|
33
|
+
traceback: str = None # Optional traceback information as a string
|
|
@@ -186,6 +186,7 @@ class Application(Container, IApplication):
|
|
|
186
186
|
from orionis.foundation.providers.reactor_provider import ReactorProvider
|
|
187
187
|
from orionis.foundation.providers.performance_counter_provider import PerformanceCounterProvider
|
|
188
188
|
from orionis.foundation.providers.scheduler_provider import ScheduleProvider
|
|
189
|
+
from orionis.foundation.providers.catch_provider import CathcProvider
|
|
189
190
|
|
|
190
191
|
# Core framework providers
|
|
191
192
|
core_providers = [
|
|
@@ -199,7 +200,8 @@ class Application(Container, IApplication):
|
|
|
199
200
|
ConsoleExecuteProvider,
|
|
200
201
|
ReactorProvider,
|
|
201
202
|
PerformanceCounterProvider,
|
|
202
|
-
ScheduleProvider
|
|
203
|
+
ScheduleProvider,
|
|
204
|
+
CathcProvider
|
|
203
205
|
]
|
|
204
206
|
|
|
205
207
|
# Register each core provider
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from orionis.container.providers.service_provider import ServiceProvider
|
|
2
|
+
from orionis.failure.catch import Catch
|
|
3
|
+
from orionis.failure.contracts.catch import ICatch
|
|
4
|
+
|
|
5
|
+
class CathcProvider(ServiceProvider):
|
|
6
|
+
"""
|
|
7
|
+
Provides and registers the Catch service within the application container.
|
|
8
|
+
|
|
9
|
+
This service provider is responsible for binding the ICatch interface to its concrete
|
|
10
|
+
implementation, Catch, as a singleton. By doing so, it ensures that a single shared
|
|
11
|
+
instance of Catch is available for dependency injection throughout the application.
|
|
12
|
+
|
|
13
|
+
Returns
|
|
14
|
+
-------
|
|
15
|
+
None
|
|
16
|
+
This class does not return a value; it is used for service registration.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
def register(self) -> None:
|
|
20
|
+
"""
|
|
21
|
+
Register the Catch service as a singleton in the application container.
|
|
22
|
+
|
|
23
|
+
This method binds the ICatch interface to the Catch implementation with an alias,
|
|
24
|
+
ensuring that only one instance of Catch is created and shared.
|
|
25
|
+
|
|
26
|
+
Returns
|
|
27
|
+
-------
|
|
28
|
+
None
|
|
29
|
+
This method does not return any value.
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
# Bind ICatch to Catch as a singleton with a specific alias
|
|
33
|
+
self.app.singleton(ICatch, Catch, alias="x-orionis.failure.catch")
|
|
34
|
+
|
|
35
|
+
def boot(self) -> None:
|
|
36
|
+
"""
|
|
37
|
+
Perform any actions required after all providers have been registered.
|
|
38
|
+
|
|
39
|
+
This method is called after the register phase and can be used to perform
|
|
40
|
+
additional initialization if needed.
|
|
41
|
+
|
|
42
|
+
Returns
|
|
43
|
+
-------
|
|
44
|
+
None
|
|
45
|
+
This method does not return any value.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
# No additional boot logic required for this provider
|
|
49
|
+
pass
|
orionis/metadata/framework.py
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
orionis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
orionis/app.py,sha256=b69fOzj2J8Aw5g0IldWZXixUDeeTO9vcHc_Njses9HU,603
|
|
3
3
|
orionis/console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
orionis/console/kernel.py,sha256=
|
|
4
|
+
orionis/console/kernel.py,sha256=xye5-uiz1Se_XOxleOv9gE-iQ0aqfEMoVKaoBiiStx0,4180
|
|
5
5
|
orionis/console/args/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
orionis/console/args/argument.py,sha256=Is8Z8_kW4DvcK1nK1UU-sa6Pk0BeOdcRczCayW0ZVHc,20360
|
|
7
7
|
orionis/console/args/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
orionis/console/args/enums/actions.py,sha256=S3T-vWS6DJSGtANrq3od3-90iYAjPvJwaOZ2V02y34c,1222
|
|
9
9
|
orionis/console/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
orionis/console/base/command.py,sha256=nasVPyKEvuv8sDFEWXhHyBCWAmSLfPPm2XlKaYYt_pM,6642
|
|
11
|
-
orionis/console/base/scheduler.py,sha256=
|
|
11
|
+
orionis/console/base/scheduler.py,sha256=dy8qQrUbKB6Uko1gtr3JzZaSd1iaOm-A8hUhbmFHvD4,3724
|
|
12
12
|
orionis/console/base/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
orionis/console/base/contracts/command.py,sha256=vmAJD0yMQ5-AD_s9_xCFEAl64sKk65z7U2E196dALQM,5760
|
|
14
|
+
orionis/console/base/contracts/scheduler.py,sha256=y8q4qv6oxjnWSt9G0HP2IjogtWIASfJaMO5vkG22U1Q,1184
|
|
14
15
|
orionis/console/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
16
|
orionis/console/commands/cache.py,sha256=8DsYoRzSBLn0P9qkGVItRbo0R6snWBDBg0_Xa7tmVhs,2322
|
|
16
|
-
orionis/console/commands/help.py,sha256=
|
|
17
|
+
orionis/console/commands/help.py,sha256=zfSw0pYaOnFN-_Ozdn4veBQDYMgSSDY10nPDCi-7tTY,3199
|
|
17
18
|
orionis/console/commands/publisher.py,sha256=FUg-EUzK7LLXsla10ZUZro8V0Z5S-KjmsaSdRHSSGbA,21381
|
|
18
|
-
orionis/console/commands/scheduler_list.py,sha256
|
|
19
|
-
orionis/console/commands/scheduler_work.py,sha256=
|
|
19
|
+
orionis/console/commands/scheduler_list.py,sha256=p6bCqsrftDrHaYwDxtWDLpsf8LJ4kCVFMnCVkyP7hW0,4818
|
|
20
|
+
orionis/console/commands/scheduler_work.py,sha256=LsFiZXIzAjJpBKAHuD2uC-FzT7Rmi_nkw7pC6p35478,4317
|
|
20
21
|
orionis/console/commands/test.py,sha256=-EmQwFwMBuby3OI9HwqMIwuJzd2CGbWbOqmwrR25sOE,2402
|
|
21
22
|
orionis/console/commands/version.py,sha256=SUuNDJ40f2uq69OQUmPQXJKaa9Bm_iVRDPmBd7zc1Yc,3658
|
|
22
23
|
orionis/console/commands/workflow.py,sha256=NYOmjTSvm2o6AE4h9LSTZMFSYPQreNmEJtronyOxaYk,2451
|
|
23
24
|
orionis/console/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
25
|
orionis/console/contracts/event.py,sha256=pxoxNjk31bt6yGvUFRTo_TI_SaZZar6iSIJARWR6KbM,5170
|
|
25
|
-
orionis/console/contracts/event_listener.py,sha256=88UKH20bcwHlJh61O_qXKqUD9qe0jMQVXXZdlwMkc2s,482
|
|
26
26
|
orionis/console/contracts/kernel.py,sha256=mh4LlhEYHh3FuGZZQ0GBhD6ZLa5YQvaNj2r01IIHI5Y,826
|
|
27
|
+
orionis/console/contracts/listener.py,sha256=tXp2kTVEaqLRWZC6BY8xqj3JP0xpDDx4btPy3wnr8cM,3251
|
|
27
28
|
orionis/console/contracts/reactor.py,sha256=Xeq7Zrw6WE5MV_XOQfiQEchAFbb6-0TjLpjWOxYW--g,4554
|
|
28
29
|
orionis/console/contracts/schedule.py,sha256=eGjcOH7kgdf0fWDZRfOFUQsIx4E8G38ayX5JwpkpN8E,4977
|
|
29
30
|
orionis/console/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
|
-
orionis/console/core/reactor.py,sha256=
|
|
31
|
+
orionis/console/core/reactor.py,sha256=Lwk6u0lO1n-E74Kyiw0xYwFMbQoJn7uszGoN9RNHS-c,30597
|
|
31
32
|
orionis/console/dumper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
32
33
|
orionis/console/dumper/dump.py,sha256=CATERiQ6XuIrKQsDaWcVxzTtlAJI9qLJX44fQxEX8ws,22443
|
|
33
34
|
orionis/console/dumper/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -38,6 +39,7 @@ orionis/console/dynamic/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
|
|
|
38
39
|
orionis/console/dynamic/contracts/progress_bar.py,sha256=NYebL2h-vg2t2H6IhJjuC37gglRkpT-MW71wbJtpLNg,1784
|
|
39
40
|
orionis/console/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
41
|
orionis/console/entities/listeners.py,sha256=I5JbbnwKz-ZQhQgS2r1wqfUTwagg8Os6qzfEY8FzVzg,5345
|
|
42
|
+
orionis/console/entities/request.py,sha256=5FikL80Ks99Ut4AlfKpyXIKVMZQUtYqvfCFn80lPZdc,936
|
|
41
43
|
orionis/console/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
42
44
|
orionis/console/enums/command.py,sha256=lCfVp2vnDojJN2gjdVxE_XU3mRjZZgOIxPfBVQYo9w4,1278
|
|
43
45
|
orionis/console/enums/event.py,sha256=XRV7N14N5HHt-c0HqYhrbKv4n2P7ZOCcBT_3OAQzenU,1929
|
|
@@ -47,7 +49,7 @@ orionis/console/exceptions/cli_orionis_value_error.py,sha256=RQP0HRwxDG8hxFOT1kU
|
|
|
47
49
|
orionis/console/exceptions/cli_runtime_error.py,sha256=DaCDGu6mXBk1LIzc7cwRROw1mePAigPNASjNZHhUSBE,1154
|
|
48
50
|
orionis/console/exceptions/cli_schedule_exception.py,sha256=IBbXb_5zi02pyo1laHdjGn6FYZK7WWRp4j2fkZOCT6I,1161
|
|
49
51
|
orionis/console/output/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
|
-
orionis/console/output/console.py,sha256=
|
|
52
|
+
orionis/console/output/console.py,sha256=AoVmoRDkfnE3_zyQi6TP43Q-Lfn_r1aNzr_llkCpfBs,17929
|
|
51
53
|
orionis/console/output/executor.py,sha256=9A8lCSU9DEVKhMsQLwBhFKW44Mz7KP-ig-o-4Vm-EcU,7328
|
|
52
54
|
orionis/console/output/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
55
|
orionis/console/output/contracts/console.py,sha256=phaQhCLWa81MLzB5ydOSaUfEIdDq7fOjvym8Rmi-arc,11908
|
|
@@ -55,7 +57,7 @@ orionis/console/output/contracts/executor.py,sha256=7l3kwnvv6GlH9EYk0v94YE1olex_
|
|
|
55
57
|
orionis/console/output/enums/__init__.py,sha256=LAaAxg-DpArCjf_jqZ0_9s3p8899gntDYkSU_ppTdC8,66
|
|
56
58
|
orionis/console/output/enums/styles.py,sha256=6a4oQCOBOKMh2ARdeq5GlIskJ3wjiylYmh66tUKKmpQ,4053
|
|
57
59
|
orionis/console/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
58
|
-
orionis/console/tasks/event.py,sha256=
|
|
60
|
+
orionis/console/tasks/event.py,sha256=NcSmq3y4JWviXaSvRifmJs0nWqQQgHIDmzlWELrLeNU,12204
|
|
59
61
|
orionis/console/tasks/exception_report.py,sha256=IN1PCQ08ZHs1sivUpzi2f9U9eW8ydZyb8GO6KiT56LY,3643
|
|
60
62
|
orionis/console/tasks/listener.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
61
63
|
orionis/console/tasks/schedule.py,sha256=YsS4mdPToAsjQ90iGB1nCku0Et3AN_-eT1zXA482sBo,20356
|
|
@@ -90,8 +92,14 @@ orionis/container/validators/is_not_subclass.py,sha256=xq2NI-ZJjSAnq2C_tEOyncadY
|
|
|
90
92
|
orionis/container/validators/is_subclass.py,sha256=4sBaGLoRs8nUhuWjlP0VJqyTwVHYqIVB8zXVN-bYnBI,1117
|
|
91
93
|
orionis/container/validators/is_valid_alias.py,sha256=4uAYcq8xov7jZbXnpKpjNkxcZtlTNnL5RRctVPMwJes,1424
|
|
92
94
|
orionis/container/validators/lifetime.py,sha256=IQ43fDNrxYHMlZH2zlYDJnlkLO_eS4U7Fs3UJgQBidI,1844
|
|
95
|
+
orionis/failure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
96
|
+
orionis/failure/catch.py,sha256=ds6JVK4o1U_sqlCEEIyGX8-UG06_Wr7dqdDCdNavTTY,5560
|
|
97
|
+
orionis/failure/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
98
|
+
orionis/failure/contracts/catch.py,sha256=sdtjhq6ToXrtdKR0Bw9YYUqofvm-FGULPnz4dZVddWQ,2844
|
|
99
|
+
orionis/failure/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
100
|
+
orionis/failure/entities/throwable.py,sha256=ogys062uhim5QMYU62ezlnumRAnYQlUf_vZvQY47S3U,1227
|
|
93
101
|
orionis/foundation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
94
|
-
orionis/foundation/application.py,sha256=
|
|
102
|
+
orionis/foundation/application.py,sha256=kQxq9oadgqR1Fw5gTTfQIaclzsYT7a_cfv759z7Q8J8,78587
|
|
95
103
|
orionis/foundation/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
96
104
|
orionis/foundation/config/startup.py,sha256=vbzduprRCNyYeR2nnMaqc1uKXw6PTzAY2jVfXNQKN8I,9691
|
|
97
105
|
orionis/foundation/config/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -193,6 +201,7 @@ orionis/foundation/exceptions/runtime.py,sha256=QS9Wjy79UFoM_lA-JR907p4l4Z8ae5E8
|
|
|
193
201
|
orionis/foundation/exceptions/type.py,sha256=Ug51YdaUKUlbngR0KeWnJNqIwS9StP4ScVobFY1eI18,463
|
|
194
202
|
orionis/foundation/exceptions/value.py,sha256=hQhXybXEnaa59ba7JxG65jceHt3mnql9MyekF-TChpM,465
|
|
195
203
|
orionis/foundation/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
204
|
+
orionis/foundation/providers/catch_provider.py,sha256=jLEFyHeyqCWgIJfqSfXrbRm9h6M6M5IkW8M_9o_NvCQ,1701
|
|
196
205
|
orionis/foundation/providers/console_provider.py,sha256=9oDHOGm79O8OtwTFPCYl4hNQgxAskqGdG1mIYyEg6qQ,2970
|
|
197
206
|
orionis/foundation/providers/dumper_provider.py,sha256=nKHjLDClCo-KnPloh6EYVySjgzf6SYSvoxVD6IwJt8M,3355
|
|
198
207
|
orionis/foundation/providers/executor_provider.py,sha256=kwkH8YWEXoEoP51akJXQJ0U25rhlOLxnfE0s9fALr0I,3478
|
|
@@ -205,7 +214,7 @@ orionis/foundation/providers/scheduler_provider.py,sha256=72SoixFog9IOE9Ve9Xcfw6
|
|
|
205
214
|
orionis/foundation/providers/testing_provider.py,sha256=SrJRpdvcblx9WvX7x9Y3zc7OQfiTf7la0HAJrm2ESlE,3725
|
|
206
215
|
orionis/foundation/providers/workers_provider.py,sha256=oa_2NIDH6UxZrtuGkkoo_zEoNIMGgJ46vg5CCgAm7wI,3926
|
|
207
216
|
orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
208
|
-
orionis/metadata/framework.py,sha256=
|
|
217
|
+
orionis/metadata/framework.py,sha256=PrRmtiQvoZA9WEDK1NMqb9rgSrh29IXDBZnQ0nT-Q74,4109
|
|
209
218
|
orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
|
|
210
219
|
orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
211
220
|
orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -237,7 +246,6 @@ orionis/services/environment/validators/key_name.py,sha256=TSwVhQCbBYPZ_4zZ-o16y
|
|
|
237
246
|
orionis/services/environment/validators/types.py,sha256=hiTszo7hS_1zQLclUIDOFUTGy2Kg2n3dZe7jU8Pmf1I,2839
|
|
238
247
|
orionis/services/file/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
239
248
|
orionis/services/file/directory.py,sha256=MdIc3hQXAcUaMFYujexScJ6-UIFgHCRN-TbGNr651Hg,7326
|
|
240
|
-
orionis/services/file/storage.py,sha256=d3wdG3991fNbyGw9S9xAQ6PI28bA1wXHjzCtnLAK5Ls,202
|
|
241
249
|
orionis/services/inspirational/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
242
250
|
orionis/services/inspirational/inspire.py,sha256=dUxwkNLjKC4jdi06cVB1gfyB2zHjfgdhYhwKtsOTf0Q,4090
|
|
243
251
|
orionis/services/inspirational/quotes.py,sha256=9hCIEFE0DdfXLaGq_SzFpXlC2AbGSnuFLzyec4Rd1H0,53455
|
|
@@ -380,7 +388,7 @@ orionis/test/validators/web_report.py,sha256=n9BfzOZz6aEiNTypXcwuWbFRG0OdHNSmCNu
|
|
|
380
388
|
orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnIfJYgc,1206
|
|
381
389
|
orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
382
390
|
orionis/test/view/render.py,sha256=f-zNhtKSg9R5Njqujbg2l2amAs2-mRVESneLIkWOZjU,4082
|
|
383
|
-
orionis-0.
|
|
391
|
+
orionis-0.489.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
|
|
384
392
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
385
393
|
tests/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
386
394
|
tests/container/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -527,8 +535,8 @@ tests/testing/validators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
527
535
|
tests/testing/validators/test_testing_validators.py,sha256=WPo5GxTP6xE-Dw3X1vZoqOMpb6HhokjNSbgDsDRDvy4,16588
|
|
528
536
|
tests/testing/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
529
537
|
tests/testing/view/test_render.py,sha256=tnnMBwS0iKUIbogLvu-7Rii50G6Koddp3XT4wgdFEYM,1050
|
|
530
|
-
orionis-0.
|
|
531
|
-
orionis-0.
|
|
532
|
-
orionis-0.
|
|
533
|
-
orionis-0.
|
|
534
|
-
orionis-0.
|
|
538
|
+
orionis-0.489.0.dist-info/METADATA,sha256=An6hNJtORqXJnVHt_FXi66a9OHrQRb4Ayjvn0n4bbJk,4801
|
|
539
|
+
orionis-0.489.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
540
|
+
orionis-0.489.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
|
|
541
|
+
orionis-0.489.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
542
|
+
orionis-0.489.0.dist-info/RECORD,,
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
|
|
3
|
-
class IEventListener(ABC):
|
|
4
|
-
|
|
5
|
-
@abstractmethod
|
|
6
|
-
def before(self, event):
|
|
7
|
-
pass
|
|
8
|
-
|
|
9
|
-
@abstractmethod
|
|
10
|
-
def after(self, event):
|
|
11
|
-
pass
|
|
12
|
-
|
|
13
|
-
@abstractmethod
|
|
14
|
-
def onSuccess(self, event):
|
|
15
|
-
pass
|
|
16
|
-
|
|
17
|
-
@abstractmethod
|
|
18
|
-
def onFailure(self, event):
|
|
19
|
-
pass
|
|
20
|
-
|
|
21
|
-
@abstractmethod
|
|
22
|
-
def onMissed(self, event):
|
|
23
|
-
pass
|
|
24
|
-
|
|
25
|
-
@abstractmethod
|
|
26
|
-
def onMaxInstances(self, event):
|
|
27
|
-
pass
|
orionis/services/file/storage.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|