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
@@ -1,10 +1,10 @@
1
+ import datetime
2
+ import getpass
1
3
  import os
2
4
  import sys
3
- import getpass
4
- import datetime
5
- from orionis.luminate.contracts.console.output.console import IConsole
6
5
  from orionis.luminate.console.output.styles import ANSIColors
7
- from orionis.luminate.support.exception_to_dict import ExceptionsToDict
6
+ from orionis.luminate.contracts.console.output.console import IConsole
7
+ from orionis.luminate.support.exception_parse import ExceptionParse
8
8
 
9
9
  class Console(IConsole):
10
10
  """
@@ -59,135 +59,229 @@ class Console(IConsole):
59
59
  """
60
60
  print(f"{text_color.value}{message}{ANSIColors.DEFAULT.value}")
61
61
 
62
- # ---- SUCCESS ----
63
-
64
62
  @staticmethod
65
- def success(message: str = '', timestamp: bool = True):
63
+ def success(message: str, timestamp: bool = True):
66
64
  """
67
65
  Prints a success message with a green background.
68
66
 
69
67
  Parameters
70
68
  ----------
71
69
  message : str, optional
72
- The success message to print (default is '').
70
+ The success message to print.
73
71
  timestamp : bool, optional
74
72
  Whether to include a timestamp (default is True).
75
73
  """
76
74
  Console._print_with_background("SUCCESS", ANSIColors.BG_SUCCESS, message, timestamp)
77
75
 
78
76
  @staticmethod
79
- def textSuccess(message: str = ''):
80
- """Prints a success message in green."""
77
+ def textSuccess(message: str):
78
+ """
79
+ Prints a success message in green.
80
+
81
+ Parameters
82
+ ----------
83
+ message : str
84
+ The success message to print.
85
+ """
81
86
  Console._print_colored(message, ANSIColors.TEXT_SUCCESS)
82
87
 
83
88
  @staticmethod
84
- def textSuccessBold(message: str = ''):
85
- """Prints a bold success message in green."""
86
- Console._print_colored(message, ANSIColors.TEXT_BOLD_SUCCESS)
89
+ def textSuccessBold(message: str):
90
+ """
91
+ Prints a bold success message in green.
87
92
 
88
- # ---- INFO ----
93
+ Parameters
94
+ ----------
95
+ message : str
96
+ The success message to print.
97
+ """
98
+ Console._print_colored(message, ANSIColors.TEXT_BOLD_SUCCESS)
89
99
 
90
100
  @staticmethod
91
- def info(message: str = '', timestamp: bool = True):
92
- """Prints an informational message with a blue background."""
101
+ def info(message: str, timestamp: bool = True):
102
+ """
103
+ Prints an informational message with a blue background.
104
+
105
+ Parameters
106
+ ----------
107
+ message : str
108
+ The informational message to print.
109
+ timestamp : bool, optional
110
+ Whether to include a timestamp (default is True).
111
+ """
93
112
  Console._print_with_background("INFO", ANSIColors.BG_INFO, message, timestamp)
94
113
 
95
114
  @staticmethod
96
- def textInfo(message: str = ''):
97
- """Prints an informational message in blue."""
115
+ def textInfo(message: str):
116
+ """
117
+ Prints an informational message in blue.
118
+
119
+ Parameters
120
+ ----------
121
+ message : str
122
+ The informational message to print.
123
+ """
98
124
  Console._print_colored(message, ANSIColors.TEXT_INFO)
99
125
 
100
126
  @staticmethod
101
- def textInfoBold(message: str = ''):
102
- """Prints a bold informational message in blue."""
103
- Console._print_colored(message, ANSIColors.TEXT_BOLD_INFO)
127
+ def textInfoBold(message: str):
128
+ """
129
+ Prints a bold informational message in blue.
104
130
 
105
- # ---- WARNING ----
131
+ Parameters
132
+ ----------
133
+ message : str
134
+ The informational message to print.
135
+ """
136
+ Console._print_colored(message, ANSIColors.TEXT_BOLD_INFO)
106
137
 
107
138
  @staticmethod
108
- def warning(message: str = '', timestamp: bool = True):
109
- """Prints a warning message with a yellow background."""
139
+ def warning(message: str, timestamp: bool = True):
140
+ """
141
+ Prints a warning message with a yellow background.
142
+
143
+ Parameters
144
+ ----------
145
+ message : str
146
+ The warning message to print.
147
+ timestamp : bool, optional
148
+ Whether to include a timestamp (default is True).
149
+ """
110
150
  Console._print_with_background("WARNING", ANSIColors.BG_WARNING, message, timestamp)
111
151
 
112
152
  @staticmethod
113
- def textWarning(message: str = ''):
114
- """Prints a warning message in yellow."""
153
+ def textWarning(message: str):
154
+ """
155
+ Prints a warning message in yellow.
156
+
157
+ Parameters
158
+ ----------
159
+ message : str
160
+ The warning message to print.
161
+ """
115
162
  Console._print_colored(message, ANSIColors.TEXT_WARNING)
116
163
 
117
164
  @staticmethod
118
- def textWarningBold(message: str = ''):
119
- """Prints a bold warning message in yellow."""
120
- Console._print_colored(message, ANSIColors.TEXT_BOLD_WARNING)
165
+ def textWarningBold(message: str):
166
+ """
167
+ Prints a bold warning message in yellow.
121
168
 
122
- # ---- FAIL ----
169
+ Parameters
170
+ ----------
171
+ message : str
172
+ The warning message to print.
173
+ """
174
+ Console._print_colored(message, ANSIColors.TEXT_BOLD_WARNING)
123
175
 
124
176
  @staticmethod
125
- def fail(message: str = '', timestamp: bool = True):
126
- """Prints an fail message with a red background."""
127
- Console._print_with_background("FAIL", ANSIColors.BG_FAIL, message, timestamp)
177
+ def fail(message: str, timestamp: bool = True):
178
+ """
179
+ Prints a failure message with a red background.
128
180
 
129
- # ---- ERROR ----
181
+ Parameters
182
+ ----------
183
+ message : str
184
+ The failure message to print.
185
+ timestamp : bool, optional
186
+ Whether to include a timestamp (default is True).
187
+ """
188
+ Console._print_with_background("FAIL", ANSIColors.BG_FAIL, message, timestamp)
130
189
 
131
190
  @staticmethod
132
- def error(message: str = '', timestamp: bool = True):
133
- """Prints an error message with a red background."""
191
+ def error(message: str, timestamp: bool = True):
192
+ """
193
+ Prints an error message with a red background.
194
+
195
+ Parameters
196
+ ----------
197
+ message : str
198
+ The error message to print.
199
+ timestamp : bool, optional
200
+ Whether to include a timestamp (default is True).
201
+ """
134
202
  Console._print_with_background("ERROR", ANSIColors.BG_ERROR, message, timestamp)
135
203
 
136
204
  @staticmethod
137
- def textError(message: str = ''):
138
- """Prints an error message in red."""
205
+ def textError(message: str):
206
+ """
207
+ Prints an error message in red.
208
+
209
+ Parameters
210
+ ----------
211
+ message : str
212
+ The error message to print.
213
+ """
139
214
  Console._print_colored(message, ANSIColors.TEXT_ERROR)
140
215
 
141
216
  @staticmethod
142
- def textErrorBold(message: str = ''):
143
- """Prints a bold error message in red."""
144
- Console._print_colored(message, ANSIColors.TEXT_BOLD_ERROR)
217
+ def textErrorBold(message: str):
218
+ """
219
+ Prints a bold error message in red.
145
220
 
146
- # ---- MUTED ----
221
+ Parameters
222
+ ----------
223
+ message : str
224
+ The error message to print.
225
+ """
226
+ Console._print_colored(message, ANSIColors.TEXT_BOLD_ERROR)
147
227
 
148
228
  @staticmethod
149
- def textMuted(message: str = ''):
150
- """Prints a muted (gray) message."""
229
+ def textMuted(message: str):
230
+ """
231
+ Prints a muted (gray) message.
232
+
233
+ Parameters
234
+ ----------
235
+ message : str
236
+ The message to print.
237
+ """
151
238
  Console._print_colored(message, ANSIColors.TEXT_MUTED)
152
239
 
153
240
  @staticmethod
154
- def textMutedBold(message: str = ''):
155
- """Prints a bold muted (gray) message."""
156
- Console._print_colored(message, ANSIColors.TEXT_BOLD_MUTED)
241
+ def textMutedBold(message: str):
242
+ """
243
+ Prints a bold muted (gray) message.
157
244
 
158
- # ---- UNDERLINE ----
245
+ Parameters
246
+ ----------
247
+ message : str
248
+ The message to print.
249
+ """
250
+ Console._print_colored(message, ANSIColors.TEXT_BOLD_MUTED)
159
251
 
160
252
  @staticmethod
161
- def textUnderline(message: str = ''):
253
+ def textUnderline(message: str):
162
254
  """
163
255
  Prints an underlined message.
164
256
 
165
257
  Parameters
166
258
  ----------
167
259
  message : str, optional
168
- The message to print (default is '').
260
+ The message to print.
169
261
  """
170
262
  print(f"{ANSIColors.TEXT_STYLE_UNDERLINE.value}{message}{ANSIColors.DEFAULT.value}")
171
263
 
172
- # ---- CLEAR CONSOLE ----
173
-
174
264
  @staticmethod
175
265
  def clear():
176
- """Clears the console screen."""
266
+ """
267
+ Clears the console screen.
268
+ """
177
269
  os.system('cls' if os.name == 'nt' else 'clear')
178
270
 
179
271
  @staticmethod
180
272
  def clearLine():
181
- """Clears the current console line."""
273
+ """
274
+ Clears the current line in the console.
275
+ """
182
276
  sys.stdout.write("\r \r")
183
277
  sys.stdout.flush()
184
278
 
185
- # ---- EMPTY LINE CONSOLE ----
186
-
187
279
  @staticmethod
188
- def line(message: str = ''):
189
- """Prints a line of text."""
190
- print(message)
280
+ def line():
281
+ """
282
+ Prints a horizontal line in the console.
283
+ """
284
+ print("\n", end="")
191
285
 
192
286
  @staticmethod
193
287
  def newLine(count: int = 1):
@@ -208,30 +302,28 @@ class Console(IConsole):
208
302
  raise ValueError(f"Unsupported Value '{count}'")
209
303
  print("\n" * count, end="")
210
304
 
211
- # ---- WRITE CONSOLE ----
212
-
213
305
  @staticmethod
214
- def write(message: str = ''):
306
+ def write(message: str):
215
307
  """
216
308
  Prints a message without moving to the next line.
217
309
 
218
310
  Parameters
219
311
  ----------
220
- message : str, optional
221
- The message to print (default is '').
312
+ message : str
313
+ The message to print.
222
314
  """
223
315
  sys.stdout.write(f"{message}")
224
316
  sys.stdout.flush()
225
317
 
226
318
  @staticmethod
227
- def writeLine(message: str = ''):
319
+ def writeLine(message: str):
228
320
  """
229
321
  Prints a message and moves to the next line.
230
322
 
231
323
  Parameters
232
324
  ----------
233
325
  message : str, optional
234
- The message to print (default is '').
326
+ The message to print.
235
327
  """
236
328
  print(f"{message}")
237
329
 
@@ -272,7 +364,7 @@ class Console(IConsole):
272
364
  or False if 'N' is entered or the default is used.
273
365
  """
274
366
  response = input(f"{ANSIColors.TEXT_INFO.value}{str(question).strip()} (Y/n): {ANSIColors.DEFAULT.value} ").upper()
275
- return default if not response else response == 'Y'
367
+ return default if not response else str(response).upper in ["Y", "YES"]
276
368
 
277
369
  @staticmethod
278
370
  def secret(question: str) -> str:
@@ -441,7 +533,7 @@ class Console(IConsole):
441
533
  This method prints the exception type, message, and a detailed stack trace.
442
534
  """
443
535
 
444
- errors = ExceptionsToDict.parse(e)
536
+ errors = ExceptionParse.toDict(e)
445
537
  error_type = str(errors.get("error_type")).split(".")[-1]
446
538
  error_message = str(errors.get("error_message")).replace(error_type, "").replace("[]", "").strip()
447
539
  stack_trace = errors.get("stack_trace")
@@ -1,6 +1,6 @@
1
1
  from datetime import datetime
2
- from orionis.luminate.contracts.console.output.executor import IExecutor
3
2
  from orionis.luminate.console.output.styles import ANSIColors
3
+ from orionis.luminate.contracts.console.output.executor import IExecutor
4
4
 
5
5
  class Executor(IExecutor):
6
6
  """
@@ -62,6 +62,14 @@ class ANSIColors(Enum):
62
62
  Underlined text for emphasis.
63
63
  TEXT_RESET : str
64
64
  Resets text styles to default settings.
65
+ CYAN : str
66
+ Cyan text for special emphasis.
67
+ DIM : str
68
+ Dim text for subtle emphasis.
69
+ MAGENTA : str
70
+ Magenta text for special emphasis.
71
+ ITALIC : str
72
+ Italic text for special emphasis.
65
73
  """
66
74
 
67
75
  DEFAULT = '\033[0m' # Reset all colors and styles
@@ -93,7 +101,7 @@ class ANSIColors(Enum):
93
101
  TEXT_BOLD = "\033[1m" # Bold text
94
102
  TEXT_STYLE_UNDERLINE = '\033[4m' # Underline text
95
103
  TEXT_RESET = "\033[0m" # Reset styles
96
- CYAN = "\033[36m"
97
- DIM = "\033[2m"
98
- MAGENTA = "\033[35m"
99
- ITALIC = "\033[3m"
104
+ CYAN = "\033[36m" # Cyan text
105
+ DIM = "\033[2m" # Dim text
106
+ MAGENTA = "\033[35m" # Magenta text
107
+ ITALIC = "\033[3m" # Italic text
@@ -1,6 +1,6 @@
1
+ import argparse
1
2
  import shlex
2
3
  import types
3
- import argparse
4
4
  from contextlib import redirect_stderr
5
5
  from io import StringIO
6
6
  from orionis.luminate.contracts.console.parser import IParser