orionis 0.1.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/__init__.py +0 -0
- orionis/cli_manager.py +48 -0
- orionis/framework.py +45 -0
- orionis/luminate/__init__.py +0 -0
- orionis/luminate/app.py +0 -0
- orionis/luminate/bootstrap/__init__.py +0 -0
- orionis/luminate/bootstrap/parser.py +49 -0
- orionis/luminate/bootstrap/register.py +95 -0
- orionis/luminate/cache/__init__.py +0 -0
- orionis/luminate/cache/app/__init__.py +0 -0
- orionis/luminate/cache/app/config.py +96 -0
- orionis/luminate/cache/console/__init__.py +0 -0
- orionis/luminate/cache/console/commands.py +98 -0
- orionis/luminate/config/__init__.py +0 -0
- orionis/luminate/config/dataclass/__init__.py +0 -0
- orionis/luminate/config/dataclass/app.py +50 -0
- orionis/luminate/config/dataclass/auth.py +17 -0
- orionis/luminate/config/dataclass/cache.py +51 -0
- orionis/luminate/config/dataclass/cors.py +58 -0
- orionis/luminate/config/dataclass/database.py +203 -0
- orionis/luminate/config/dataclass/filesystems.py +102 -0
- orionis/luminate/config/dataclass/logging.py +107 -0
- orionis/luminate/config/dataclass/mail.py +81 -0
- orionis/luminate/config/dataclass/queue.py +63 -0
- orionis/luminate/config/dataclass/session.py +59 -0
- orionis/luminate/config/environment.py +110 -0
- orionis/luminate/config/sections.py +37 -0
- orionis/luminate/console/__init__.py +0 -0
- orionis/luminate/console/base/__init__.py +0 -0
- orionis/luminate/console/base/command.py +427 -0
- orionis/luminate/console/cache.py +132 -0
- orionis/luminate/console/command.py +40 -0
- orionis/luminate/console/command_filter.py +40 -0
- orionis/luminate/console/commands/__init__.py +0 -0
- orionis/luminate/console/commands/cache_clear.py +56 -0
- orionis/luminate/console/commands/help.py +59 -0
- orionis/luminate/console/commands/schedule_work.py +50 -0
- orionis/luminate/console/commands/tests.py +40 -0
- orionis/luminate/console/commands/version.py +39 -0
- orionis/luminate/console/exceptions/__init__.py +0 -0
- orionis/luminate/console/exceptions/cli_exception.py +125 -0
- orionis/luminate/console/kernel.py +32 -0
- orionis/luminate/console/output/__init__.py +0 -0
- orionis/luminate/console/output/console.py +426 -0
- orionis/luminate/console/output/executor.py +90 -0
- orionis/luminate/console/output/progress_bar.py +100 -0
- orionis/luminate/console/output/styles.py +95 -0
- orionis/luminate/console/parser.py +159 -0
- orionis/luminate/console/register.py +98 -0
- orionis/luminate/console/runner.py +126 -0
- orionis/luminate/console/scripts/__init__.py +0 -0
- orionis/luminate/console/scripts/management.py +94 -0
- orionis/luminate/console/tasks/__init__.py +0 -0
- orionis/luminate/console/tasks/scheduler.py +616 -0
- orionis/luminate/contracts/__init__.py +0 -0
- orionis/luminate/contracts/bootstrap/parser_interface.py +46 -0
- orionis/luminate/contracts/cache/__init__.py +0 -0
- orionis/luminate/contracts/cache/cache_commands_interface.py +69 -0
- orionis/luminate/contracts/config/__init__.py +0 -0
- orionis/luminate/contracts/config/config_interface.py +27 -0
- orionis/luminate/contracts/config/environment_interface.py +64 -0
- orionis/luminate/contracts/console/__init__.py +0 -0
- orionis/luminate/contracts/console/base_command_interface.py +448 -0
- orionis/luminate/contracts/console/cli_cache_interface.py +34 -0
- orionis/luminate/contracts/console/command_filter_interface.py +32 -0
- orionis/luminate/contracts/console/command_interface.py +36 -0
- orionis/luminate/contracts/console/console_interface.py +305 -0
- orionis/luminate/contracts/console/executor_interface.py +51 -0
- orionis/luminate/contracts/console/kernel_interface.py +32 -0
- orionis/luminate/contracts/console/management_interface.py +63 -0
- orionis/luminate/contracts/console/parser_interface.py +76 -0
- orionis/luminate/contracts/console/progress_bar_interface.py +66 -0
- orionis/luminate/contracts/console/register_interface.py +32 -0
- orionis/luminate/contracts/console/runner_interface.py +50 -0
- orionis/luminate/contracts/console/schedule_interface.py +317 -0
- orionis/luminate/contracts/console/task_manager_interface.py +37 -0
- orionis/luminate/contracts/facades/__init__.py +0 -0
- orionis/luminate/contracts/facades/env_interface.py +64 -0
- orionis/luminate/contracts/facades/log_interface.py +48 -0
- orionis/luminate/contracts/facades/paths_interface.py +141 -0
- orionis/luminate/contracts/facades/tests_interface.py +33 -0
- orionis/luminate/contracts/files/__init__.py +0 -0
- orionis/luminate/contracts/files/paths_interface.py +29 -0
- orionis/luminate/contracts/installer/__init__.py +0 -0
- orionis/luminate/contracts/installer/output_interface.py +125 -0
- orionis/luminate/contracts/installer/setup_interface.py +29 -0
- orionis/luminate/contracts/installer/upgrade_interface.py +24 -0
- orionis/luminate/contracts/log/__init__.py +0 -0
- orionis/luminate/contracts/log/logger_interface.py +33 -0
- orionis/luminate/contracts/pipelines/cli_pipeline_interface.py +84 -0
- orionis/luminate/contracts/publisher/__init__.py +0 -0
- orionis/luminate/contracts/publisher/pypi_publisher_interface.py +36 -0
- orionis/luminate/contracts/test/__init__.py +0 -0
- orionis/luminate/contracts/test/unit_test_interface.py +51 -0
- orionis/luminate/contracts/tools/__init__.py +0 -0
- orionis/luminate/contracts/tools/reflection_interface.py +343 -0
- orionis/luminate/contracts/tools/std_interface.py +56 -0
- orionis/luminate/facades/__init__.py +0 -0
- orionis/luminate/facades/environment.py +81 -0
- orionis/luminate/facades/log.py +56 -0
- orionis/luminate/facades/paths.py +268 -0
- orionis/luminate/facades/tests.py +48 -0
- orionis/luminate/files/__init__.py +0 -0
- orionis/luminate/files/paths.py +56 -0
- orionis/luminate/installer/__init__.py +0 -0
- orionis/luminate/installer/icon.ascii +11 -0
- orionis/luminate/installer/info.ascii +13 -0
- orionis/luminate/installer/output.py +188 -0
- orionis/luminate/installer/setup.py +191 -0
- orionis/luminate/installer/upgrade.py +42 -0
- orionis/luminate/log/__init__.py +0 -0
- orionis/luminate/log/logger.py +116 -0
- orionis/luminate/pipelines/__init__.py +0 -0
- orionis/luminate/pipelines/cli_pipeline.py +116 -0
- orionis/luminate/publisher/__init__.py +0 -0
- orionis/luminate/publisher/pypi.py +206 -0
- orionis/luminate/static/logos/flaskavel.png +0 -0
- orionis/luminate/test/__init__.py +0 -0
- orionis/luminate/test/exception.py +48 -0
- orionis/luminate/test/unit_test.py +108 -0
- orionis/luminate/tools/__init__.py +0 -0
- orionis/luminate/tools/reflection.py +390 -0
- orionis/luminate/tools/std.py +53 -0
- orionis-0.1.0.dist-info/LICENCE +21 -0
- orionis-0.1.0.dist-info/METADATA +27 -0
- orionis-0.1.0.dist-info/RECORD +133 -0
- orionis-0.1.0.dist-info/WHEEL +5 -0
- orionis-0.1.0.dist-info/entry_points.txt +2 -0
- orionis-0.1.0.dist-info/top_level.txt +2 -0
- tests/__init__.py +0 -0
- tests/tools/__init__.py +0 -0
- tests/tools/class_example.py +50 -0
- tests/tools/test_reflection.py +128 -0
@@ -0,0 +1,50 @@
|
|
1
|
+
from abc import ABC, abstractmethod
|
2
|
+
from typing import Any
|
3
|
+
|
4
|
+
class ICLIRunner(ABC):
|
5
|
+
"""
|
6
|
+
Interface for CLIRunner, defining the structure for handling CLI command execution.
|
7
|
+
|
8
|
+
This interface ensures that any implementing class properly processes and executes CLI commands.
|
9
|
+
|
10
|
+
Methods
|
11
|
+
-------
|
12
|
+
handle(signature: str = None, vars: dict = {}, *args, **kwargs) -> Any
|
13
|
+
Processes and executes a CLI command based on provided arguments.
|
14
|
+
"""
|
15
|
+
|
16
|
+
@abstractmethod
|
17
|
+
def handle(self, signature: str = None, vars: dict = {}, *args, **kwargs) -> Any:
|
18
|
+
"""
|
19
|
+
Processes and executes a CLI command.
|
20
|
+
|
21
|
+
This method:
|
22
|
+
- Determines whether the command is invoked from `sys.argv` or as a function.
|
23
|
+
- Extracts the command signature and arguments.
|
24
|
+
- Executes the command pipeline.
|
25
|
+
- Logs execution status and handles errors.
|
26
|
+
|
27
|
+
Parameters
|
28
|
+
----------
|
29
|
+
signature : str, optional
|
30
|
+
The command signature (default is None, meaning it is extracted from `sys.argv`).
|
31
|
+
vars : dict, optional
|
32
|
+
Named arguments for the command (default is an empty dictionary).
|
33
|
+
*args
|
34
|
+
Additional arguments for the command.
|
35
|
+
**kwargs
|
36
|
+
Additional keyword arguments for the command.
|
37
|
+
|
38
|
+
Returns
|
39
|
+
-------
|
40
|
+
Any
|
41
|
+
The output of the executed command.
|
42
|
+
|
43
|
+
Raises
|
44
|
+
------
|
45
|
+
ValueError
|
46
|
+
If no command signature is provided.
|
47
|
+
Exception
|
48
|
+
If an unexpected error occurs during execution.
|
49
|
+
"""
|
50
|
+
pass
|
@@ -0,0 +1,317 @@
|
|
1
|
+
|
2
|
+
from typing import Any
|
3
|
+
from datetime import datetime
|
4
|
+
from abc import ABC, abstractmethod
|
5
|
+
|
6
|
+
class ISchedule(ABC):
|
7
|
+
"""
|
8
|
+
A class that manages the scheduling of tasks using the APScheduler.
|
9
|
+
|
10
|
+
Attributes
|
11
|
+
----------
|
12
|
+
scheduler : BackgroundScheduler
|
13
|
+
The background scheduler instance used to schedule tasks.
|
14
|
+
callback : function | None
|
15
|
+
A callback function that will be called when the scheduled task is triggered.
|
16
|
+
|
17
|
+
Methods
|
18
|
+
-------
|
19
|
+
command(signature: str, vars: dict[str, Any] = {}, *args: Any, **kwargs: Any) -> 'Schedule':
|
20
|
+
Defines a command to execute.
|
21
|
+
"""
|
22
|
+
|
23
|
+
@abstractmethod
|
24
|
+
def command(self, signature: str, vars: dict[str, Any] = {}, *args: Any, **kwargs: Any):
|
25
|
+
"""
|
26
|
+
Defines a Orionis command to be executed.
|
27
|
+
|
28
|
+
Parameters
|
29
|
+
----------
|
30
|
+
signature : str
|
31
|
+
The signature of the command to execute.
|
32
|
+
vars : dict, optional
|
33
|
+
A dictionary of variables to pass to the command, by default an empty dictionary.
|
34
|
+
*args : Any
|
35
|
+
Additional positional arguments to pass to the command.
|
36
|
+
**kwargs : Any
|
37
|
+
Additional keyword arguments to pass to the command.
|
38
|
+
|
39
|
+
Returns
|
40
|
+
-------
|
41
|
+
Schedule
|
42
|
+
Returns the Schedule instance itself, allowing method chaining.
|
43
|
+
"""
|
44
|
+
pass
|
45
|
+
|
46
|
+
@abstractmethod
|
47
|
+
def onceAt(self, date: datetime):
|
48
|
+
"""
|
49
|
+
Schedule the defined command to execute every X seconds.
|
50
|
+
"""
|
51
|
+
pass
|
52
|
+
|
53
|
+
@abstractmethod
|
54
|
+
def everySeconds(self, seconds: int, start_date: datetime = None, end_date: datetime = None):
|
55
|
+
"""
|
56
|
+
Schedule the defined command to execute every X seconds.
|
57
|
+
"""
|
58
|
+
pass
|
59
|
+
|
60
|
+
@abstractmethod
|
61
|
+
def everySecond(self, start_date: datetime = None, end_date: datetime = None):
|
62
|
+
"""
|
63
|
+
Schedules the defined command to execute every second.
|
64
|
+
"""
|
65
|
+
pass
|
66
|
+
|
67
|
+
@abstractmethod
|
68
|
+
def everyTwoSeconds(self, start_date: datetime = None, end_date: datetime = None):
|
69
|
+
"""
|
70
|
+
Schedules the defined command to execute every two seconds.
|
71
|
+
"""
|
72
|
+
pass
|
73
|
+
|
74
|
+
@abstractmethod
|
75
|
+
def everyFiveSeconds(self, start_date: datetime = None, end_date: datetime = None):
|
76
|
+
"""
|
77
|
+
Schedules the defined command to execute every five seconds.
|
78
|
+
"""
|
79
|
+
pass
|
80
|
+
|
81
|
+
@abstractmethod
|
82
|
+
def everyTenSeconds(self, start_date: datetime = None, end_date: datetime = None):
|
83
|
+
"""
|
84
|
+
Schedules the defined command to execute every ten seconds.
|
85
|
+
"""
|
86
|
+
pass
|
87
|
+
|
88
|
+
@abstractmethod
|
89
|
+
def everyFifteenSeconds(self, start_date: datetime = None, end_date: datetime = None):
|
90
|
+
"""
|
91
|
+
Schedules the defined command to execute every fifteen seconds.
|
92
|
+
"""
|
93
|
+
pass
|
94
|
+
|
95
|
+
@abstractmethod
|
96
|
+
def everyTwentySeconds(self, start_date: datetime = None, end_date: datetime = None):
|
97
|
+
"""
|
98
|
+
Schedules the defined command to execute every twenty seconds.
|
99
|
+
"""
|
100
|
+
pass
|
101
|
+
|
102
|
+
@abstractmethod
|
103
|
+
def everyThirtySeconds(self, start_date: datetime = None, end_date: datetime = None):
|
104
|
+
"""
|
105
|
+
Schedules the defined command to execute every thirty seconds.
|
106
|
+
"""
|
107
|
+
pass
|
108
|
+
|
109
|
+
@abstractmethod
|
110
|
+
def everyMinutes(self, minutes: int, start_date: datetime = None, end_date: datetime = None):
|
111
|
+
"""
|
112
|
+
Schedules the defined command to execute every X minutes.
|
113
|
+
"""
|
114
|
+
pass
|
115
|
+
|
116
|
+
@abstractmethod
|
117
|
+
def everyMinute(self, start_date: datetime = None, end_date: datetime = None):
|
118
|
+
"""
|
119
|
+
Schedules the defined command to execute every minute.
|
120
|
+
"""
|
121
|
+
pass
|
122
|
+
|
123
|
+
@abstractmethod
|
124
|
+
def everyTwoMinutes(self, start_date: datetime = None, end_date: datetime = None):
|
125
|
+
"""
|
126
|
+
Schedules the defined command to execute every two minutes.
|
127
|
+
"""
|
128
|
+
pass
|
129
|
+
|
130
|
+
@abstractmethod
|
131
|
+
def everyThreeMinutes(self, start_date: datetime = None, end_date: datetime = None):
|
132
|
+
"""
|
133
|
+
Schedules the defined command to execute every three minutes.
|
134
|
+
"""
|
135
|
+
pass
|
136
|
+
|
137
|
+
@abstractmethod
|
138
|
+
def everyFourMinutes(self, start_date: datetime = None, end_date: datetime = None):
|
139
|
+
"""
|
140
|
+
Schedules the defined command to execute every four minutes.
|
141
|
+
"""
|
142
|
+
pass
|
143
|
+
|
144
|
+
@abstractmethod
|
145
|
+
def everyFiveMinutes(self, start_date: datetime = None, end_date: datetime = None):
|
146
|
+
"""
|
147
|
+
Schedules the defined command to execute every five minutes.
|
148
|
+
"""
|
149
|
+
pass
|
150
|
+
|
151
|
+
@abstractmethod
|
152
|
+
def everyTenMinutes(self, start_date: datetime = None, end_date: datetime = None):
|
153
|
+
"""
|
154
|
+
Schedules the defined command to execute every ten minutes.
|
155
|
+
"""
|
156
|
+
pass
|
157
|
+
|
158
|
+
@abstractmethod
|
159
|
+
def everyFifteenMinutes(self, start_date: datetime = None, end_date: datetime = None):
|
160
|
+
"""
|
161
|
+
Schedules the defined command to execute every fifteen minutes.
|
162
|
+
"""
|
163
|
+
pass
|
164
|
+
|
165
|
+
@abstractmethod
|
166
|
+
def everyThirtyMinutes(self, start_date: datetime = None, end_date: datetime = None):
|
167
|
+
"""
|
168
|
+
Schedules the defined command to execute every thirty minutes.
|
169
|
+
"""
|
170
|
+
pass
|
171
|
+
|
172
|
+
@abstractmethod
|
173
|
+
def hours(self, hours: int, start_date: datetime = None, end_date: datetime = None):
|
174
|
+
"""
|
175
|
+
Schedules the defined command to execute every X hours.
|
176
|
+
"""
|
177
|
+
pass
|
178
|
+
|
179
|
+
@abstractmethod
|
180
|
+
def hourly(self, start_date: datetime = None, end_date: datetime = None):
|
181
|
+
"""
|
182
|
+
Schedules the defined command to execute every hour.
|
183
|
+
"""
|
184
|
+
pass
|
185
|
+
|
186
|
+
@abstractmethod
|
187
|
+
def hourlyAt(self, minute: int, start_date: datetime = None, end_date: datetime = None):
|
188
|
+
"""
|
189
|
+
Schedules the defined command to execute every hour at a specific minute.
|
190
|
+
"""
|
191
|
+
pass
|
192
|
+
|
193
|
+
@abstractmethod
|
194
|
+
def everyOddHour(self, minute: int, start_date: datetime = None, end_date: datetime = None):
|
195
|
+
"""
|
196
|
+
Schedules the defined command to execute every odd hour.
|
197
|
+
"""
|
198
|
+
pass
|
199
|
+
|
200
|
+
@abstractmethod
|
201
|
+
def everyTwoHours(self, minute: int, start_date: datetime = None, end_date: datetime = None):
|
202
|
+
"""
|
203
|
+
Schedules the defined command to execute every two hours.
|
204
|
+
"""
|
205
|
+
pass
|
206
|
+
|
207
|
+
@abstractmethod
|
208
|
+
def everyThreeHours(self, minute: int, start_date: datetime = None, end_date: datetime = None):
|
209
|
+
"""
|
210
|
+
Schedules the defined command to execute every three hours.
|
211
|
+
"""
|
212
|
+
pass
|
213
|
+
|
214
|
+
@abstractmethod
|
215
|
+
def everyFourHours(self, minute: int, start_date: datetime = None, end_date: datetime = None):
|
216
|
+
"""
|
217
|
+
Schedules the defined command to execute every four hours.
|
218
|
+
"""
|
219
|
+
pass
|
220
|
+
|
221
|
+
@abstractmethod
|
222
|
+
def everySixHours(self, minute: int, start_date: datetime = None, end_date: datetime = None):
|
223
|
+
"""
|
224
|
+
Schedules the defined command to execute every six hours.
|
225
|
+
"""
|
226
|
+
pass
|
227
|
+
|
228
|
+
@abstractmethod
|
229
|
+
def days(self, days: int, start_date: datetime = None, end_date: datetime = None):
|
230
|
+
"""
|
231
|
+
Schedules the defined command to execute every X days.
|
232
|
+
"""
|
233
|
+
pass
|
234
|
+
|
235
|
+
@abstractmethod
|
236
|
+
def daily(self, start_date: datetime = None, end_date: datetime = None):
|
237
|
+
"""
|
238
|
+
Schedules the defined command to execute daily at midnight.
|
239
|
+
"""
|
240
|
+
pass
|
241
|
+
|
242
|
+
@abstractmethod
|
243
|
+
def dailyAt(self, at: str, start_date: datetime = None, end_date: datetime = None):
|
244
|
+
"""
|
245
|
+
Schedules the defined command to execute daily at a specific time.
|
246
|
+
"""
|
247
|
+
pass
|
248
|
+
|
249
|
+
@abstractmethod
|
250
|
+
def twiceDaily(self, first_hour: int, second_hour: int, start_date: datetime = None, end_date: datetime = None):
|
251
|
+
"""
|
252
|
+
Schedules the defined command to execute twice a day at specific hours.
|
253
|
+
"""
|
254
|
+
pass
|
255
|
+
|
256
|
+
@abstractmethod
|
257
|
+
def monday(self, at: str, start_date: datetime = None, end_date: datetime = None):
|
258
|
+
"""
|
259
|
+
Schedules the defined command to execute every Monday at a specific time.
|
260
|
+
"""
|
261
|
+
pass
|
262
|
+
|
263
|
+
@abstractmethod
|
264
|
+
def tuesday(self, at: str, start_date: datetime = None, end_date: datetime = None):
|
265
|
+
"""
|
266
|
+
Schedules the defined command to execute every tuesday at a specific time.
|
267
|
+
"""
|
268
|
+
pass
|
269
|
+
|
270
|
+
@abstractmethod
|
271
|
+
def wednesday(self, at: str, start_date: datetime = None, end_date: datetime = None):
|
272
|
+
"""
|
273
|
+
Schedules the defined command to execute every wednesday at a specific time.
|
274
|
+
"""
|
275
|
+
pass
|
276
|
+
|
277
|
+
@abstractmethod
|
278
|
+
def thursday(self, at: str, start_date: datetime = None, end_date: datetime = None):
|
279
|
+
"""
|
280
|
+
Schedules the defined command to execute every thursday at a specific time.
|
281
|
+
"""
|
282
|
+
pass
|
283
|
+
|
284
|
+
@abstractmethod
|
285
|
+
def friday(self, at: str, start_date: datetime = None, end_date: datetime = None):
|
286
|
+
"""
|
287
|
+
Schedules the defined command to execute every friday at a specific time.
|
288
|
+
"""
|
289
|
+
pass
|
290
|
+
|
291
|
+
@abstractmethod
|
292
|
+
def saturday(self, at: str, start_date: datetime = None, end_date: datetime = None):
|
293
|
+
"""
|
294
|
+
Schedules the defined command to execute every saturday at a specific time.
|
295
|
+
"""
|
296
|
+
pass
|
297
|
+
|
298
|
+
@abstractmethod
|
299
|
+
def sunday(self, at: str, start_date: datetime = None, end_date: datetime = None):
|
300
|
+
"""
|
301
|
+
Schedules the defined command to execute every sunday at a specific time.
|
302
|
+
"""
|
303
|
+
pass
|
304
|
+
|
305
|
+
@abstractmethod
|
306
|
+
def weekly(self, start_date: datetime = None, end_date: datetime = None):
|
307
|
+
"""
|
308
|
+
Schedules the defined command to execute weekly on Sunday at midnight.
|
309
|
+
"""
|
310
|
+
pass
|
311
|
+
|
312
|
+
@abstractmethod
|
313
|
+
def start(self):
|
314
|
+
"""
|
315
|
+
Starts the scheduler and stops automatically when there are no more jobs.
|
316
|
+
"""
|
317
|
+
pass
|
@@ -0,0 +1,37 @@
|
|
1
|
+
from abc import ABC, abstractmethod
|
2
|
+
from orionis.luminate.console.tasks.scheduler import Schedule
|
3
|
+
|
4
|
+
class ITaskManager(ABC):
|
5
|
+
"""
|
6
|
+
Abstract base class that defines the interface for managing tasks.
|
7
|
+
|
8
|
+
This class provides an abstract method `schedule` that must be implemented by any
|
9
|
+
subclass to define how tasks are scheduled.
|
10
|
+
|
11
|
+
Methods
|
12
|
+
-------
|
13
|
+
schedule(schedule: Schedule) -> None
|
14
|
+
Schedules a task based on the provided `Schedule` instance.
|
15
|
+
"""
|
16
|
+
|
17
|
+
@abstractmethod
|
18
|
+
def schedule(self, schedule: Schedule) -> None:
|
19
|
+
"""
|
20
|
+
Schedules a task based on the given `Schedule` instance.
|
21
|
+
|
22
|
+
This method is abstract and must be implemented by a subclass to define
|
23
|
+
the specific scheduling logic.
|
24
|
+
|
25
|
+
Parameters
|
26
|
+
----------
|
27
|
+
schedule : Schedule
|
28
|
+
An instance of the `Schedule` class, which contains the details of
|
29
|
+
when and how the task should be executed.
|
30
|
+
|
31
|
+
Returns
|
32
|
+
-------
|
33
|
+
None
|
34
|
+
This method does not return anything, but it is expected to schedule
|
35
|
+
the task as defined by the `schedule` object.
|
36
|
+
"""
|
37
|
+
pass
|
File without changes
|
@@ -0,0 +1,64 @@
|
|
1
|
+
from abc import ABC, abstractmethod
|
2
|
+
from typing import Optional, Dict
|
3
|
+
|
4
|
+
class IEnv(ABC):
|
5
|
+
"""
|
6
|
+
Interface for managing environment variables from a .env file.
|
7
|
+
"""
|
8
|
+
|
9
|
+
@abstractmethod
|
10
|
+
def get(self, key: str, default: Optional[str] = None) -> Optional[str]:
|
11
|
+
"""
|
12
|
+
Retrieve the value of an environment variable.
|
13
|
+
|
14
|
+
Parameters
|
15
|
+
----------
|
16
|
+
key : str
|
17
|
+
The key of the environment variable.
|
18
|
+
default : Optional[str], optional
|
19
|
+
Default value if the key does not exist, by default None.
|
20
|
+
|
21
|
+
Returns
|
22
|
+
-------
|
23
|
+
Optional[str]
|
24
|
+
The value of the environment variable or the default value.
|
25
|
+
"""
|
26
|
+
pass
|
27
|
+
|
28
|
+
@abstractmethod
|
29
|
+
def set(self, key: str, value: str) -> None:
|
30
|
+
"""
|
31
|
+
Set the value of an environment variable in the .env file.
|
32
|
+
|
33
|
+
Parameters
|
34
|
+
----------
|
35
|
+
key : str
|
36
|
+
The key of the environment variable.
|
37
|
+
value : str
|
38
|
+
The value to set.
|
39
|
+
"""
|
40
|
+
pass
|
41
|
+
|
42
|
+
@abstractmethod
|
43
|
+
def unset(self, key: str) -> None:
|
44
|
+
"""
|
45
|
+
Remove an environment variable from the .env file.
|
46
|
+
|
47
|
+
Parameters
|
48
|
+
----------
|
49
|
+
key : str
|
50
|
+
The key of the environment variable to remove.
|
51
|
+
"""
|
52
|
+
pass
|
53
|
+
|
54
|
+
@abstractmethod
|
55
|
+
def all(self) -> Dict[str, str]:
|
56
|
+
"""
|
57
|
+
Retrieve all environment variable values from the .env file.
|
58
|
+
|
59
|
+
Returns
|
60
|
+
-------
|
61
|
+
Dict[str, str]
|
62
|
+
A dictionary of all environment variables and their values.
|
63
|
+
"""
|
64
|
+
pass
|
@@ -0,0 +1,48 @@
|
|
1
|
+
from abc import ABC, abstractmethod
|
2
|
+
from typing import Optional
|
3
|
+
import logging
|
4
|
+
from orionis.luminate.contracts.log.logger_interface import ILogger
|
5
|
+
|
6
|
+
class ILogFacade(ABC):
|
7
|
+
"""
|
8
|
+
Facade interface for simplified access to logging operations.
|
9
|
+
|
10
|
+
Methods
|
11
|
+
-------
|
12
|
+
info(message: str) -> None
|
13
|
+
Logs an informational message.
|
14
|
+
error(message: str) -> None
|
15
|
+
Logs an error message.
|
16
|
+
success(message: str) -> None
|
17
|
+
Logs a success message (treated as info).
|
18
|
+
warning(message: str) -> None
|
19
|
+
Logs a warning message.
|
20
|
+
debug(message: str) -> None
|
21
|
+
Logs a debug message.
|
22
|
+
configure(path: Optional[str], level: int) -> ILogger
|
23
|
+
Configures and returns the logger instance.
|
24
|
+
"""
|
25
|
+
|
26
|
+
@abstractmethod
|
27
|
+
def info(self, message: str) -> None:
|
28
|
+
pass
|
29
|
+
|
30
|
+
@abstractmethod
|
31
|
+
def error(self, message: str) -> None:
|
32
|
+
pass
|
33
|
+
|
34
|
+
@abstractmethod
|
35
|
+
def success(self, message: str) -> None:
|
36
|
+
pass
|
37
|
+
|
38
|
+
@abstractmethod
|
39
|
+
def warning(self, message: str) -> None:
|
40
|
+
pass
|
41
|
+
|
42
|
+
@abstractmethod
|
43
|
+
def debug(self, message: str) -> None:
|
44
|
+
pass
|
45
|
+
|
46
|
+
@abstractmethod
|
47
|
+
def configure(self, path: Optional[str] = None, level: int = logging.INFO) -> ILogger:
|
48
|
+
pass
|
@@ -0,0 +1,141 @@
|
|
1
|
+
from abc import ABC, abstractmethod
|
2
|
+
|
3
|
+
class IPath(ABC):
|
4
|
+
|
5
|
+
@abstractmethod
|
6
|
+
def _resolve_directory(directory: str, file: str = None):
|
7
|
+
"""
|
8
|
+
Internal helper function to resolve an absolute path for a given directory.
|
9
|
+
|
10
|
+
Parameters
|
11
|
+
----------
|
12
|
+
directory : str
|
13
|
+
The base directory to resolve the path from.
|
14
|
+
file : str, optional
|
15
|
+
The relative file path inside the directory (default is an empty string).
|
16
|
+
|
17
|
+
Returns
|
18
|
+
-------
|
19
|
+
SkeletonPath
|
20
|
+
The resolved absolute path wrapped in a SkeletonPath object.
|
21
|
+
"""
|
22
|
+
pass
|
23
|
+
|
24
|
+
@abstractmethod
|
25
|
+
def app(file: str = None):
|
26
|
+
"""
|
27
|
+
Returns the absolute path for a file inside the 'app' directory.
|
28
|
+
|
29
|
+
Parameters
|
30
|
+
----------
|
31
|
+
file : str, optional
|
32
|
+
The relative file path inside the 'app' directory.
|
33
|
+
|
34
|
+
Returns
|
35
|
+
-------
|
36
|
+
SkeletonPath
|
37
|
+
The resolved path wrapped in a SkeletonPath object.
|
38
|
+
"""
|
39
|
+
pass
|
40
|
+
|
41
|
+
@abstractmethod
|
42
|
+
def config(file: str = None):
|
43
|
+
"""
|
44
|
+
Returns the absolute path for a file inside the 'config' directory.
|
45
|
+
|
46
|
+
Parameters
|
47
|
+
----------
|
48
|
+
file : str, optional
|
49
|
+
The relative file path inside the 'config' directory.
|
50
|
+
|
51
|
+
Returns
|
52
|
+
-------
|
53
|
+
SkeletonPath
|
54
|
+
The resolved path wrapped in a SkeletonPath object.
|
55
|
+
"""
|
56
|
+
pass
|
57
|
+
|
58
|
+
@abstractmethod
|
59
|
+
def database(file: str = None):
|
60
|
+
"""
|
61
|
+
Returns the absolute path for a file inside the 'database' directory.
|
62
|
+
|
63
|
+
Parameters
|
64
|
+
----------
|
65
|
+
file : str, optional
|
66
|
+
The relative file path inside the 'database' directory.
|
67
|
+
|
68
|
+
Returns
|
69
|
+
-------
|
70
|
+
SkeletonPath
|
71
|
+
The resolved path wrapped in a SkeletonPath object.
|
72
|
+
"""
|
73
|
+
pass
|
74
|
+
|
75
|
+
@abstractmethod
|
76
|
+
def resource(file: str = None):
|
77
|
+
"""
|
78
|
+
Returns the absolute path for a file inside the 'resource' directory.
|
79
|
+
|
80
|
+
Parameters
|
81
|
+
----------
|
82
|
+
file : str, optional
|
83
|
+
The relative file path inside the 'resource' directory.
|
84
|
+
|
85
|
+
Returns
|
86
|
+
-------
|
87
|
+
SkeletonPath
|
88
|
+
The resolved path wrapped in a SkeletonPath object.
|
89
|
+
"""
|
90
|
+
pass
|
91
|
+
|
92
|
+
@abstractmethod
|
93
|
+
def routes(file: str = None):
|
94
|
+
"""
|
95
|
+
Returns the absolute path for a file inside the 'routes' directory.
|
96
|
+
|
97
|
+
Parameters
|
98
|
+
----------
|
99
|
+
file : str, optional
|
100
|
+
The relative file path inside the 'routes' directory.
|
101
|
+
|
102
|
+
Returns
|
103
|
+
-------
|
104
|
+
SkeletonPath
|
105
|
+
The resolved path wrapped in a SkeletonPath object.
|
106
|
+
"""
|
107
|
+
pass
|
108
|
+
|
109
|
+
@abstractmethod
|
110
|
+
def storage(file: str = None):
|
111
|
+
"""
|
112
|
+
Returns the absolute path for a file inside the 'storage' directory.
|
113
|
+
|
114
|
+
Parameters
|
115
|
+
----------
|
116
|
+
file : str, optional
|
117
|
+
The relative file path inside the 'storage' directory.
|
118
|
+
|
119
|
+
Returns
|
120
|
+
-------
|
121
|
+
SkeletonPath
|
122
|
+
The resolved path wrapped in a SkeletonPath object.
|
123
|
+
"""
|
124
|
+
pass
|
125
|
+
|
126
|
+
@abstractmethod
|
127
|
+
def tests(file: str = None):
|
128
|
+
"""
|
129
|
+
Returns the absolute path for a file inside the 'tests' directory.
|
130
|
+
|
131
|
+
Parameters
|
132
|
+
----------
|
133
|
+
file : str, optional
|
134
|
+
The relative file path inside the 'tests' directory.
|
135
|
+
|
136
|
+
Returns
|
137
|
+
-------
|
138
|
+
SkeletonPath
|
139
|
+
The resolved path wrapped in a SkeletonPath object.
|
140
|
+
"""
|
141
|
+
pass
|
@@ -0,0 +1,33 @@
|
|
1
|
+
from abc import ABC, abstractmethod
|
2
|
+
|
3
|
+
class IUnitTests(ABC):
|
4
|
+
"""
|
5
|
+
Interface for executing unit tests in a specified directory.
|
6
|
+
|
7
|
+
This class defines the abstract structure for any unit test executor,
|
8
|
+
enforcing the implementation of the 'execute' method in any subclass.
|
9
|
+
|
10
|
+
Methods
|
11
|
+
-------
|
12
|
+
execute(pattern: str) -> dict
|
13
|
+
Executes the unit tests in the 'tests' directory and subdirectories,
|
14
|
+
using a file pattern for filtering test files.
|
15
|
+
"""
|
16
|
+
|
17
|
+
@abstractmethod
|
18
|
+
def execute(pattern='test_*.py') -> dict:
|
19
|
+
"""
|
20
|
+
Executes the unit tests in the 'tests' directory and its subdirectories
|
21
|
+
by filtering test files based on a specified pattern.
|
22
|
+
|
23
|
+
Parameters
|
24
|
+
----------
|
25
|
+
pattern : str, optional
|
26
|
+
The pattern to filter test files (default is 'test_*.py').
|
27
|
+
|
28
|
+
Returns
|
29
|
+
-------
|
30
|
+
dict
|
31
|
+
A dictionary containing the results of the executed tests.
|
32
|
+
"""
|
33
|
+
pass
|
File without changes
|