orionis 0.198.0__py3-none-any.whl → 0.200.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.
Files changed (35) hide show
  1. orionis/framework.py +1 -1
  2. orionis/luminate/config/app.py +0 -3
  3. orionis/luminate/config/auth.py +0 -2
  4. orionis/luminate/config/database.py +0 -2
  5. orionis/luminate/config/filesystems.py +0 -7
  6. orionis/luminate/config/logging.py +0 -9
  7. orionis/luminate/config/mail.py +0 -8
  8. orionis/luminate/config/queue.py +0 -5
  9. orionis/luminate/config/session.py +3 -7
  10. orionis/luminate/console/base/command.py +88 -80
  11. orionis/luminate/console/command_filter.py +0 -1
  12. orionis/luminate/console/commands/cache_clear.py +19 -11
  13. orionis/luminate/console/commands/help.py +19 -10
  14. orionis/luminate/console/commands/schedule_work.py +1 -4
  15. orionis/luminate/console/commands/version.py +1 -3
  16. orionis/luminate/console/exceptions/cli-orionis-value-error.py +41 -0
  17. orionis/luminate/console/exceptions/cli_exception.py +1 -127
  18. orionis/luminate/console/exceptions/cli_runtime_error.py +41 -0
  19. orionis/luminate/console/exceptions/cli_schedule_exception.py +41 -0
  20. orionis/luminate/console/output/console.py +160 -68
  21. orionis/luminate/console/output/executor.py +1 -1
  22. orionis/luminate/console/output/styles.py +12 -4
  23. orionis/luminate/console/parser.py +1 -1
  24. orionis/luminate/contracts/console/base/command.py +65 -75
  25. orionis/luminate/contracts/console/output/console.py +160 -60
  26. orionis/luminate/contracts/support/{exception_to_dict.py → exception_parse.py} +2 -2
  27. orionis/luminate/services/commands/scheduler_service.py +1 -1
  28. orionis/luminate/support/{exception_to_dict.py → exception_parse.py} +11 -16
  29. {orionis-0.198.0.dist-info → orionis-0.200.0.dist-info}/METADATA +1 -1
  30. {orionis-0.198.0.dist-info → orionis-0.200.0.dist-info}/RECORD +34 -32
  31. orionis/luminate/console/commands/tests.py +0 -34
  32. {orionis-0.198.0.dist-info → orionis-0.200.0.dist-info}/LICENCE +0 -0
  33. {orionis-0.198.0.dist-info → orionis-0.200.0.dist-info}/WHEEL +0 -0
  34. {orionis-0.198.0.dist-info → orionis-0.200.0.dist-info}/entry_points.txt +0 -0
  35. {orionis-0.198.0.dist-info → orionis-0.200.0.dist-info}/top_level.txt +0 -0
@@ -4,208 +4,208 @@ from orionis.luminate.console.output.progress_bar import ProgressBar
4
4
 
5
5
  class IBaseCommand(ABC):
6
6
  """
7
- Interface for console output commands. This defines the methods that must be implemented in a command class.
7
+ Interface for a base command class.
8
8
  """
9
9
 
10
10
  @abstractmethod
11
- def success(self, message: str = '', timestamp: bool = True) -> None:
11
+ def success(self, message: str, timestamp: bool = True) -> None:
12
12
  """
13
13
  Prints a success message with a green background.
14
14
 
15
15
  Parameters
16
16
  ----------
17
- message : str, optional
18
- The message to display (default is an empty string).
17
+ message : str
18
+ The message to display.
19
19
  timestamp : bool, optional
20
20
  Whether to include a timestamp (default is True).
21
21
  """
22
22
  pass
23
23
 
24
24
  @abstractmethod
25
- def textSuccess(self, message: str = '') -> None:
25
+ def textSuccess(self, message: str) -> None:
26
26
  """
27
27
  Prints a success message in green.
28
28
 
29
29
  Parameters
30
30
  ----------
31
- message : str, optional
32
- The message to display (default is an empty string).
31
+ message : str
32
+ The message to display.
33
33
  """
34
34
  pass
35
35
 
36
36
  @abstractmethod
37
- def textSuccessBold(self, message: str = '') -> None:
37
+ def textSuccessBold(self, message: str) -> None:
38
38
  """
39
39
  Prints a bold success message in green.
40
40
 
41
41
  Parameters
42
42
  ----------
43
- message : str, optional
44
- The message to display (default is an empty string).
43
+ message : str
44
+ The message to display.
45
45
  """
46
46
  pass
47
47
 
48
48
  @abstractmethod
49
- def info(self, message: str = '', timestamp: bool = True) -> None:
49
+ def info(self, message: str, timestamp: bool = True) -> None:
50
50
  """
51
51
  Prints an informational message with a blue background.
52
52
 
53
53
  Parameters
54
54
  ----------
55
- message : str, optional
56
- The message to display (default is an empty string).
55
+ message : str
56
+ The message to display.
57
57
  timestamp : bool, optional
58
58
  Whether to include a timestamp (default is True).
59
59
  """
60
60
  pass
61
61
 
62
62
  @abstractmethod
63
- def textInfo(self, message: str = '') -> None:
63
+ def textInfo(self, message: str) -> None:
64
64
  """
65
65
  Prints an informational message in blue.
66
66
 
67
67
  Parameters
68
68
  ----------
69
- message : str, optional
70
- The message to display (default is an empty string).
69
+ message : str
70
+ The message to display.
71
71
  """
72
72
  pass
73
73
 
74
74
  @abstractmethod
75
- def textInfoBold(self, message: str = '') -> None:
75
+ def textInfoBold(self, message: str) -> None:
76
76
  """
77
77
  Prints a bold informational message in blue.
78
78
 
79
79
  Parameters
80
80
  ----------
81
- message : str, optional
82
- The message to display (default is an empty string).
81
+ message : str
82
+ The message to display.
83
83
  """
84
84
  pass
85
85
 
86
86
  @abstractmethod
87
- def warning(self, message: str = '', timestamp: bool = True) -> None:
87
+ def warning(self, message: str, timestamp: bool = True):
88
88
  """
89
89
  Prints a warning message with a yellow background.
90
90
 
91
91
  Parameters
92
92
  ----------
93
- message : str, optional
94
- The message to display (default is an empty string).
93
+ message : str
94
+ The message to display.
95
95
  timestamp : bool, optional
96
96
  Whether to include a timestamp (default is True).
97
97
  """
98
98
  pass
99
99
 
100
100
  @abstractmethod
101
- def textWarning(self, message: str = '') -> None:
101
+ def textWarning(self, message: str) -> None:
102
102
  """
103
103
  Prints a warning message in yellow.
104
104
 
105
105
  Parameters
106
106
  ----------
107
- message : str, optional
108
- The message to display (default is an empty string).
107
+ message : str
108
+ The message to display.
109
109
  """
110
110
  pass
111
111
 
112
112
  @abstractmethod
113
- def textWarningBold(self, message: str = '') -> None:
113
+ def textWarningBold(self, message: str) -> None:
114
114
  """
115
115
  Prints a bold warning message in yellow.
116
116
 
117
117
  Parameters
118
118
  ----------
119
- message : str, optional
120
- The message to display (default is an empty string).
119
+ message : str
120
+ The message to display.
121
121
  """
122
122
  pass
123
123
 
124
124
  @abstractmethod
125
- def fail(self, message: str = '', timestamp: bool = True) -> None:
125
+ def fail(self, message: str, timestamp: bool = True) -> None:
126
126
  """
127
127
  Prints a failure message with a red background.
128
128
 
129
129
  Parameters
130
130
  ----------
131
- message : str, optional
132
- The message to display (default is an empty string).
131
+ message : str
132
+ The message to display.
133
133
  timestamp : bool, optional
134
134
  Whether to include a timestamp (default is True).
135
135
  """
136
136
  pass
137
137
 
138
138
  @abstractmethod
139
- def error(self, message: str = '', timestamp: bool = True) -> None:
139
+ def error(self, message: str, timestamp: bool = True) -> None:
140
140
  """
141
141
  Prints an error message with a red background.
142
142
 
143
143
  Parameters
144
144
  ----------
145
- message : str, optional
146
- The message to display (default is an empty string).
145
+ message : str
146
+ The message to display.
147
147
  timestamp : bool, optional
148
148
  Whether to include a timestamp (default is True).
149
149
  """
150
150
  pass
151
151
 
152
152
  @abstractmethod
153
- def textError(self, message: str = '') -> None:
153
+ def textError(self, message: str) -> None:
154
154
  """
155
155
  Prints an error message in red.
156
156
 
157
157
  Parameters
158
158
  ----------
159
- message : str, optional
160
- The message to display (default is an empty string).
159
+ message : str
160
+ The message to display.
161
161
  """
162
162
  pass
163
163
 
164
164
  @abstractmethod
165
- def textErrorBold(self, message: str = '') -> None:
165
+ def textErrorBold(self, message: str) -> None:
166
166
  """
167
167
  Prints a bold error message in red.
168
168
 
169
169
  Parameters
170
170
  ----------
171
- message : str, optional
172
- The message to display (default is an empty string).
171
+ message : str
172
+ The message to display.
173
173
  """
174
174
  pass
175
175
 
176
176
  @abstractmethod
177
- def textMuted(self, message: str = '') -> None:
177
+ def textMuted(self, message: str) -> None:
178
178
  """
179
179
  Prints a muted (gray) message.
180
180
 
181
181
  Parameters
182
182
  ----------
183
- message : str, optional
184
- The message to display (default is an empty string).
183
+ message : str
184
+ The message to display.
185
185
  """
186
186
  pass
187
187
 
188
188
  @abstractmethod
189
- def textMutedBold(self, message: str = '') -> None:
189
+ def textMutedBold(self, message: str) -> None:
190
190
  """
191
191
  Prints a bold muted (gray) message.
192
192
 
193
193
  Parameters
194
194
  ----------
195
- message : str, optional
196
- The message to display (default is an empty string).
195
+ message : str
196
+ The message to display.
197
197
  """
198
198
  pass
199
199
 
200
200
  @abstractmethod
201
- def textUnderline(self, message: str = '') -> None:
201
+ def textUnderline(self, message: str) -> None:
202
202
  """
203
203
  Prints an underlined message.
204
204
 
205
205
  Parameters
206
206
  ----------
207
- message : str, optional
208
- The message to display (default is an empty string).
207
+ message : str
208
+ The message to display.
209
209
  """
210
210
  pass
211
211
 
@@ -224,14 +224,9 @@ class IBaseCommand(ABC):
224
224
  pass
225
225
 
226
226
  @abstractmethod
227
- def line(self, message: str = '') -> None:
227
+ def line(self) -> None:
228
228
  """
229
- Prints a line of text.
230
-
231
- Parameters
232
- ----------
233
- message : str, optional
234
- The message to display (default is an empty string).
229
+ Prints a line empty.
235
230
  """
236
231
  pass
237
232
 
@@ -248,19 +243,19 @@ class IBaseCommand(ABC):
248
243
  pass
249
244
 
250
245
  @abstractmethod
251
- def write(self, message: str = '') -> None:
246
+ def write(self, message: str) -> None:
252
247
  """
253
248
  Prints a message without moving to the next line.
254
249
 
255
250
  Parameters
256
251
  ----------
257
252
  message : str, optional
258
- The message to display (default is an empty string).
253
+ The message to display.
259
254
  """
260
255
  pass
261
256
 
262
257
  @abstractmethod
263
- def writeLine(self, message: str = '') -> None:
258
+ def writeLine(self, message: str) -> None:
264
259
  """
265
260
  Prints a message and moves to the next line.
266
261
 
@@ -325,7 +320,7 @@ class IBaseCommand(ABC):
325
320
  pass
326
321
 
327
322
  @abstractmethod
328
- def table(self, headers: List[str], rows: List[List[str]]) -> None:
323
+ def table(self, headers: list, rows: list):
329
324
  """
330
325
  Prints a formatted table in the console.
331
326
 
@@ -344,7 +339,7 @@ class IBaseCommand(ABC):
344
339
  pass
345
340
 
346
341
  @abstractmethod
347
- def anticipate(self, question: str, options: List[str], default=None) -> str:
342
+ def anticipate(self, question: str, options: list, default=None):
348
343
  """
349
344
  Provides autocomplete suggestions for user input.
350
345
 
@@ -365,7 +360,7 @@ class IBaseCommand(ABC):
365
360
  pass
366
361
 
367
362
  @abstractmethod
368
- def choice(self, question: str, choices: List[str], default_index: int = 0) -> str:
363
+ def choice(self, question: str, choices: list, default_index: int = 0) -> str:
369
364
  """
370
365
  Prompts the user to select a choice from a list.
371
366
 
@@ -420,28 +415,23 @@ class IBaseCommand(ABC):
420
415
  @abstractmethod
421
416
  def setArgs(self, args) -> None:
422
417
  """
423
- Abstract method to define the logic of setting command arguments.
418
+ Define the logic of setting command arguments.
424
419
 
425
420
  Parameters
426
421
  ----------
427
- args : argparse.Namespace
422
+ args : argparse.Namespace or dict
428
423
  Contain the arguments to be set for the command.
429
424
  """
430
425
  pass
431
426
 
432
427
  @abstractmethod
433
- def handle(self, *args, **kwargs):
428
+ def getArgs(self) -> dict:
434
429
  """
435
- Abstract method to define the logic of the command.
436
-
437
- This method must be overridden in subclasses.
438
-
439
- Arguments:
440
- *args: A list of variable-length arguments.
441
- **kwargs: Arbitrary keyword arguments.
430
+ Get the command arguments.
442
431
 
443
- Raises:
444
- NotImplementedError: If the method is not implemented in a subclass. This ensures that all command classes
445
- adhere to the expected structure.
432
+ Returns
433
+ -------
434
+ dict
435
+ The command arguments.
446
436
  """
447
437
  pass
@@ -1,131 +1,228 @@
1
1
  from abc import ABC, abstractmethod
2
2
 
3
3
  class IConsole(ABC):
4
- """
5
- Interface for console utility operations, ensuring consistent method definitions.
6
4
 
7
- Provides methods to print success, info, warning, and error messages with
8
- optional timestamps, as well as general text formatting methods.
9
- """
10
-
11
- # ---- SUCCESS ----
12
5
  @abstractmethod
13
- def success(message: str = '', timestamp: bool = True):
6
+ def success(message: str, timestamp: bool = True):
14
7
  """
15
8
  Prints a success message with a green background.
16
9
 
17
10
  Parameters
18
11
  ----------
19
12
  message : str, optional
20
- The success message to print (default is '').
13
+ The success message to print.
21
14
  timestamp : bool, optional
22
15
  Whether to include a timestamp (default is True).
23
16
  """
24
17
  pass
25
18
 
26
19
  @abstractmethod
27
- def textSuccess(message: str = ''):
28
- """Prints a success message in green."""
20
+ def textSuccess(message: str):
21
+ """
22
+ Prints a success message in green.
23
+
24
+ Parameters
25
+ ----------
26
+ message : str
27
+ The success message to print.
28
+ """
29
29
  pass
30
30
 
31
31
  @abstractmethod
32
- def textSuccessBold(message: str = ''):
33
- """Prints a bold success message in green."""
32
+ def textSuccessBold(message: str):
33
+ """
34
+ Prints a bold success message in green.
35
+
36
+ Parameters
37
+ ----------
38
+ message : str
39
+ The success message to print.
40
+ """
34
41
  pass
35
42
 
36
- # ---- INFO ----
37
43
  @abstractmethod
38
- def info(message: str = '', timestamp: bool = True):
39
- """Prints an informational message with a blue background."""
44
+ def info(message: str, timestamp: bool = True):
45
+ """
46
+ Prints an informational message with a blue background.
47
+
48
+ Parameters
49
+ ----------
50
+ message : str
51
+ The informational message to print.
52
+ timestamp : bool, optional
53
+ Whether to include a timestamp (default is True).
54
+ """
40
55
  pass
41
56
 
42
57
  @abstractmethod
43
- def textInfo(message: str = ''):
44
- """Prints an informational message in blue."""
58
+ def textInfo(message: str):
59
+ """
60
+ Prints an informational message in blue.
61
+
62
+ Parameters
63
+ ----------
64
+ message : str
65
+ The informational message to print.
66
+ """
45
67
  pass
46
68
 
47
69
  @abstractmethod
48
- def textInfoBold(message: str = ''):
49
- """Prints a bold informational message in blue."""
70
+ def textInfoBold(message: str):
71
+ """
72
+ Prints a bold informational message in blue.
73
+
74
+ Parameters
75
+ ----------
76
+ message : str
77
+ The informational message to print.
78
+ """
50
79
  pass
51
80
 
52
- # ---- WARNING ----
53
81
  @abstractmethod
54
- def warning(message: str = '', timestamp: bool = True):
55
- """Prints a warning message with a yellow background."""
82
+ def warning(message: str, timestamp: bool = True):
83
+ """
84
+ Prints a warning message with a yellow background.
85
+
86
+ Parameters
87
+ ----------
88
+ message : str
89
+ The warning message to print.
90
+ timestamp : bool, optional
91
+ Whether to include a timestamp (default is True).
92
+ """
56
93
  pass
57
94
 
58
95
  @abstractmethod
59
- def textWarning(message: str = ''):
60
- """Prints a warning message in yellow."""
96
+ def textWarning(message: str):
97
+ """
98
+ Prints a warning message in yellow.
99
+
100
+ Parameters
101
+ ----------
102
+ message : str
103
+ The warning message to print.
104
+ """
61
105
  pass
62
106
 
63
107
  @abstractmethod
64
- def textWarningBold(message: str = ''):
65
- """Prints a bold warning message in yellow."""
108
+ def textWarningBold(message: str):
109
+ """
110
+ Prints a bold warning message in yellow.
111
+
112
+ Parameters
113
+ ----------
114
+ message : str
115
+ The warning message to print.
116
+ """
66
117
  pass
67
118
 
68
- # ---- FAIL ----
69
119
  @abstractmethod
70
- def fail(message: str = '', timestamp: bool = True):
71
- """Prints an fail message with a red background."""
120
+ def fail(message: str, timestamp: bool = True):
121
+ """
122
+ Prints a failure message with a red background.
123
+
124
+ Parameters
125
+ ----------
126
+ message : str
127
+ The failure message to print.
128
+ timestamp : bool, optional
129
+ Whether to include a timestamp (default is True).
130
+ """
72
131
  pass
73
132
 
74
- # ---- ERROR ----
75
133
  @abstractmethod
76
- def error(message: str = '', timestamp: bool = True):
77
- """Prints an error message with a red background."""
134
+ def error(message: str, timestamp: bool = True):
135
+ """
136
+ Prints an error message with a red background.
137
+
138
+ Parameters
139
+ ----------
140
+ message : str
141
+ The error message to print.
142
+ timestamp : bool, optional
143
+ Whether to include a timestamp (default is True).
144
+ """
78
145
  pass
79
146
 
80
147
  @abstractmethod
81
- def textError(message: str = ''):
82
- """Prints an error message in red."""
148
+ def textError(message: str):
149
+ """
150
+ Prints an error message in red.
151
+
152
+ Parameters
153
+ ----------
154
+ message : str
155
+ The error message to print.
156
+ """
83
157
  pass
84
158
 
85
159
  @abstractmethod
86
- def textErrorBold(message: str = ''):
87
- """Prints a bold error message in red."""
160
+ def textErrorBold(message: str):
161
+ """
162
+ Prints a bold error message in red.
163
+
164
+ Parameters
165
+ ----------
166
+ message : str
167
+ The error message to print.
168
+ """
88
169
  pass
89
170
 
90
- # ---- MUTED ----
91
171
  @abstractmethod
92
- def textMuted(message: str = ''):
93
- """Prints a muted (gray) message."""
172
+ def textMuted(message: str):
173
+ """
174
+ Prints a muted (gray) message.
175
+
176
+ Parameters
177
+ ----------
178
+ message : str
179
+ The message to print.
180
+ """
94
181
  pass
95
182
 
96
183
  @abstractmethod
97
- def textMutedBold(message: str = ''):
98
- """Prints a bold muted (gray) message."""
184
+ def textMutedBold(message: str):
185
+ """
186
+ Prints a bold muted (gray) message.
187
+
188
+ Parameters
189
+ ----------
190
+ message : str
191
+ The message to print.
192
+ """
99
193
  pass
100
194
 
101
- # ---- UNDERLINE ----
102
195
  @abstractmethod
103
- def textUnderline(message: str = ''):
196
+ def textUnderline(message: str):
104
197
  """
105
198
  Prints an underlined message.
106
199
 
107
200
  Parameters
108
201
  ----------
109
202
  message : str, optional
110
- The message to print (default is '').
203
+ The message to print.
111
204
  """
112
205
  pass
113
206
 
114
- # ---- CLEAR CONSOLE ----
115
207
  @abstractmethod
116
208
  def clear():
117
- """Clears the console screen."""
209
+ """
210
+ Clears the console screen.
211
+ """
118
212
  pass
119
213
 
120
214
  @abstractmethod
121
215
  def clearLine():
122
- """Clears the current console line."""
216
+ """
217
+ Clears the current line in the console.
218
+ """
123
219
  pass
124
220
 
125
- # ---- EMPTY LINE CONSOLE ----
126
221
  @abstractmethod
127
- def line(message: str = ''):
128
- """Prints a line of text."""
222
+ def line():
223
+ """
224
+ Prints a horizontal line in the console.
225
+ """
129
226
  pass
130
227
 
131
228
  @abstractmethod
@@ -145,28 +242,27 @@ class IConsole(ABC):
145
242
  """
146
243
  pass
147
244
 
148
- # ---- WRITE CONSOLE ----
149
245
  @abstractmethod
150
- def write(message: str = ''):
246
+ def write(message: str):
151
247
  """
152
248
  Prints a message without moving to the next line.
153
249
 
154
250
  Parameters
155
251
  ----------
156
- message : str, optional
157
- The message to print (default is '').
252
+ message : str
253
+ The message to print.
158
254
  """
159
255
  pass
160
256
 
161
257
  @abstractmethod
162
- def writeLine(message: str = ''):
258
+ def writeLine(message: str):
163
259
  """
164
260
  Prints a message and moves to the next line.
165
261
 
166
262
  Parameters
167
263
  ----------
168
264
  message : str, optional
169
- The message to print (default is '').
265
+ The message to print.
170
266
  """
171
267
  pass
172
268
 
@@ -228,7 +324,7 @@ class IConsole(ABC):
228
324
  @abstractmethod
229
325
  def table(headers: list, rows: list):
230
326
  """
231
- Prints a table in the console with the given headers and rows.
327
+ Prints a table in the console with the given headers and rows, with bold headers.
232
328
 
233
329
  Parameters
234
330
  ----------
@@ -237,10 +333,14 @@ class IConsole(ABC):
237
333
  rows : list of list of str
238
334
  The rows of the table, where each row is a list of strings representing the columns.
239
335
 
336
+ Raises
337
+ ------
338
+ ValueError
339
+ If headers or rows are empty.
340
+
240
341
  Notes
241
342
  -----
242
- The method calculates the maximum width of each column and formats the output accordingly.
243
- It prints a header row followed by a separator and the data rows.
343
+ The table adjusts column widths dynamically, includes bold headers, and uses box-drawing characters for formatting.
244
344
  """
245
345
  pass
246
346