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
orionis/framework.py CHANGED
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.198.0"
8
+ VERSION = "0.200.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -34,7 +34,6 @@ class App:
34
34
  custom : dict
35
35
  A dictionary for storing additional custom properties. Defaults to an empty dictionary.
36
36
  """
37
-
38
37
  name: str
39
38
  debug: bool
40
39
  bytecode: bool
@@ -45,6 +44,4 @@ class App:
45
44
  reload: bool
46
45
  cipher: str
47
46
  key: str
48
-
49
- # Holds additional custom properties, initialized as an empty dictionary
50
47
  custom: Dict[str, any] = field(default_factory=dict)
@@ -12,6 +12,4 @@ class Auth:
12
12
  A dictionary to store any additional custom properties.
13
13
  This field is initialized with an empty dictionary by default.
14
14
  """
15
-
16
- # Custom dictionary to hold dynamic or extra properties, initialized as an empty dict
17
15
  custom: Dict[str, any] = field(default_factory=dict)
@@ -201,6 +201,4 @@ class Database:
201
201
  """
202
202
  default: str
203
203
  connections: Connections
204
-
205
- # Holds additional custom properties, initialized as an empty dictionary
206
204
  custom: Dict[str, any] = field(default_factory=dict)
@@ -13,7 +13,6 @@ class Local:
13
13
  """
14
14
  path: str
15
15
 
16
-
17
16
  @dataclass
18
17
  class Public:
19
18
  """
@@ -29,7 +28,6 @@ class Public:
29
28
  path: str
30
29
  slug: str
31
30
 
32
-
33
31
  @dataclass
34
32
  class AWSS3:
35
33
  """
@@ -65,7 +63,6 @@ class AWSS3:
65
63
  use_path_style_endpoint: bool = False
66
64
  throw: bool = False
67
65
 
68
-
69
66
  @dataclass
70
67
  class Disks:
71
68
  """
@@ -84,7 +81,6 @@ class Disks:
84
81
  public: Public
85
82
  s3: AWSS3
86
83
 
87
-
88
84
  @dataclass
89
85
  class Filesystems:
90
86
  """
@@ -97,9 +93,6 @@ class Filesystems:
97
93
  disks : Disks
98
94
  A collection of configured storage disks.
99
95
  """
100
-
101
96
  default: str
102
97
  disks: Disks
103
-
104
- # Holds additional custom properties, initialized as an empty dictionary
105
98
  custom: Dict[str, any] = field(default_factory=dict)
@@ -19,7 +19,6 @@ class Stack:
19
19
  path: str
20
20
  level: str
21
21
 
22
-
23
22
  @dataclass
24
23
  class Hourly:
25
24
  """
@@ -38,7 +37,6 @@ class Hourly:
38
37
  level: str
39
38
  retention_hours: int
40
39
 
41
-
42
40
  @dataclass
43
41
  class Daily:
44
42
  """
@@ -60,7 +58,6 @@ class Daily:
60
58
  retention_days: int
61
59
  at: time
62
60
 
63
-
64
61
  @dataclass
65
62
  class Weekly:
66
63
  """
@@ -79,7 +76,6 @@ class Weekly:
79
76
  level: str
80
77
  retention_weeks: int
81
78
 
82
-
83
79
  @dataclass
84
80
  class Monthly:
85
81
  """
@@ -98,7 +94,6 @@ class Monthly:
98
94
  level: str
99
95
  retention_months: int
100
96
 
101
-
102
97
  @dataclass
103
98
  class Chunked:
104
99
  """
@@ -124,7 +119,6 @@ class Chunked:
124
119
  mb_size: Union[int, str]
125
120
  files: int
126
121
 
127
-
128
122
  @dataclass
129
123
  class Channels:
130
124
  """
@@ -146,7 +140,6 @@ class Channels:
146
140
  monthly : Monthly
147
141
  chunked : Chunked
148
142
 
149
-
150
143
  @dataclass
151
144
  class Logging:
152
145
  """
@@ -161,6 +154,4 @@ class Logging:
161
154
  """
162
155
  default: str
163
156
  channels: Channels
164
-
165
- # Holds additional custom properties, initialized as an empty dictionary
166
157
  custom: Dict[str, any] = field(default_factory=dict)
@@ -23,7 +23,6 @@ class Smtp:
23
23
  timeout : Optional[int], default=None
24
24
  The connection timeout duration in seconds. If None, defaults to the system setting.
25
25
  """
26
-
27
26
  url: str
28
27
  host: str
29
28
  port: int
@@ -32,7 +31,6 @@ class Smtp:
32
31
  password: str
33
32
  timeout: Optional[int] = None
34
33
 
35
-
36
34
  @dataclass
37
35
  class File:
38
36
  """
@@ -43,7 +41,6 @@ class File:
43
41
  path : str
44
42
  The file path where outgoing emails are stored instead of being sent.
45
43
  """
46
-
47
44
  path: str
48
45
 
49
46
 
@@ -59,11 +56,9 @@ class Mailers:
59
56
  file : File
60
57
  The file-based mail transport configuration (used for local development/testing).
61
58
  """
62
-
63
59
  smtp: Smtp
64
60
  file: File
65
61
 
66
-
67
62
  @dataclass
68
63
  class Mail:
69
64
  """
@@ -76,9 +71,6 @@ class Mail:
76
71
  mailers : Mailers
77
72
  The available mail transport configurations.
78
73
  """
79
-
80
74
  default: str
81
75
  mailers: Mailers
82
-
83
- # Holds additional custom properties, initialized as an empty dictionary
84
76
  custom: Dict[str, any] = field(default_factory=dict)
@@ -33,7 +33,6 @@ class Database:
33
33
  retry_after: int
34
34
  after_commit: bool
35
35
 
36
-
37
36
  @dataclass
38
37
  class Connections:
39
38
  """
@@ -44,7 +43,6 @@ class Connections:
44
43
  database : DatabaseQueue
45
44
  The configuration for the database-backed queue.
46
45
  """
47
-
48
46
  database: Database
49
47
 
50
48
  @dataclass
@@ -59,9 +57,6 @@ class Queue:
59
57
  connections : QueueConnections
60
58
  The available queue connection configurations.
61
59
  """
62
-
63
60
  default: str
64
61
  connections: Connections
65
-
66
- # Holds additional custom properties, initialized as an empty dictionary
67
62
  custom: Dict[str, any] = field(default_factory=dict)
@@ -1,5 +1,6 @@
1
1
  from dataclasses import dataclass, field
2
2
  from typing import Dict, Optional
3
+ from orionis.framework import NAME
3
4
 
4
5
  @dataclass
5
6
  class Cookie:
@@ -21,15 +22,13 @@ class Cookie:
21
22
  same_site : str
22
23
  The SameSite policy for the session cookie ('lax', 'strict', or 'none').
23
24
  """
24
-
25
- name: str = "orionis_session"
25
+ name: str = f"{NAME}_session"
26
26
  path: str = "/"
27
27
  domain: Optional[str] = None
28
28
  secure: Optional[bool] = None
29
29
  http_only: bool = True
30
30
  same_site: str = "lax"
31
31
 
32
-
33
32
  @dataclass
34
33
  class Session:
35
34
  """
@@ -50,13 +49,10 @@ class Session:
50
49
  cookie : SessionCookie
51
50
  The configuration settings for the session cookie.
52
51
  """
53
-
54
52
  driver: str
55
53
  lifetime: int
56
54
  expire_on_close: bool
57
55
  encrypt: bool
58
56
  files: str
59
57
  cookie: Cookie
60
-
61
- # Holds additional custom properties, initialized as an empty dictionary
62
- custom: Dict[str, any] = field(default_factory=dict)
58
+ custom: Dict[str, any] = field(default_factory=dict)
@@ -1,6 +1,7 @@
1
- from orionis.luminate.contracts.console.base.command import IBaseCommand
1
+ import argparse
2
2
  from orionis.luminate.console.output.console import Console
3
3
  from orionis.luminate.console.output.progress_bar import ProgressBar
4
+ from orionis.luminate.contracts.console.base.command import IBaseCommand
4
5
 
5
6
  class BaseCommand(IBaseCommand):
6
7
  """
@@ -16,73 +17,73 @@ class BaseCommand(IBaseCommand):
16
17
  """
17
18
  args = {}
18
19
 
19
- def success(self, message: str, timestamp: bool = True):
20
+ def success(self, message: str, timestamp: bool = True) -> None:
20
21
  """
21
22
  Prints a success message with a green background.
22
23
 
23
24
  Parameters
24
25
  ----------
25
- message : str, optional
26
- The message to display (default is an empty string).
26
+ message : str
27
+ The message to display.
27
28
  timestamp : bool, optional
28
29
  Whether to include a timestamp (default is True).
29
30
  """
30
31
  Console.success(message, timestamp)
31
32
 
32
- def textSuccess(self, message: str):
33
+ def textSuccess(self, message: str) -> None:
33
34
  """
34
35
  Prints a success message in green.
35
36
 
36
37
  Parameters
37
38
  ----------
38
- message : str, optional
39
- The message to display (default is an empty string).
39
+ message : str
40
+ The message to display.
40
41
  """
41
42
  Console.textSuccess(message)
42
43
 
43
- def textSuccessBold(self, message: str):
44
+ def textSuccessBold(self, message: str) -> None:
44
45
  """
45
46
  Prints a bold success message in green.
46
47
 
47
48
  Parameters
48
49
  ----------
49
- message : str, optional
50
- The message to display (default is an empty string).
50
+ message : str
51
+ The message to display.
51
52
  """
52
53
  Console.textSuccessBold(message)
53
54
 
54
- def info(self, message: str, timestamp: bool = True):
55
+ def info(self, message: str, timestamp: bool = True) -> None:
55
56
  """
56
57
  Prints an informational message with a blue background.
57
58
 
58
59
  Parameters
59
60
  ----------
60
- message : str, optional
61
- The message to display (default is an empty string).
61
+ message : str
62
+ The message to display.
62
63
  timestamp : bool, optional
63
64
  Whether to include a timestamp (default is True).
64
65
  """
65
66
  Console.info(message, timestamp)
66
67
 
67
- def textInfo(self, message: str):
68
+ def textInfo(self, message: str) -> None:
68
69
  """
69
70
  Prints an informational message in blue.
70
71
 
71
72
  Parameters
72
73
  ----------
73
- message : str, optional
74
- The message to display (default is an empty string).
74
+ message : str
75
+ The message to display.
75
76
  """
76
77
  Console.textInfo(message)
77
78
 
78
- def textInfoBold(self, message: str):
79
+ def textInfoBold(self, message: str) -> None:
79
80
  """
80
81
  Prints a bold informational message in blue.
81
82
 
82
83
  Parameters
83
84
  ----------
84
- message : str, optional
85
- The message to display (default is an empty string).
85
+ message : str
86
+ The message to display.
86
87
  """
87
88
  Console.textInfoBold(message)
88
89
 
@@ -92,140 +93,135 @@ class BaseCommand(IBaseCommand):
92
93
 
93
94
  Parameters
94
95
  ----------
95
- message : str, optional
96
- The message to display (default is an empty string).
96
+ message : str
97
+ The message to display.
97
98
  timestamp : bool, optional
98
99
  Whether to include a timestamp (default is True).
99
100
  """
100
101
  Console.warning(message, timestamp)
101
102
 
102
- def textWarning(self, message: str):
103
+ def textWarning(self, message: str) -> None:
103
104
  """
104
105
  Prints a warning message in yellow.
105
106
 
106
107
  Parameters
107
108
  ----------
108
- message : str, optional
109
- The message to display (default is an empty string).
109
+ message : str
110
+ The message to display.
110
111
  """
111
112
  Console.textWarning(message)
112
113
 
113
- def textWarningBold(self, message: str):
114
+ def textWarningBold(self, message: str) -> None:
114
115
  """
115
116
  Prints a bold warning message in yellow.
116
117
 
117
118
  Parameters
118
119
  ----------
119
- message : str, optional
120
- The message to display (default is an empty string).
120
+ message : str
121
+ The message to display.
121
122
  """
122
123
  Console.textWarningBold(message)
123
124
 
124
- def fail(self, message: str, timestamp: bool = True):
125
+ def fail(self, message: str, timestamp: bool = True) -> None:
125
126
  """
126
127
  Prints a failure message with a red background.
127
128
 
128
129
  Parameters
129
130
  ----------
130
- message : str, optional
131
- The message to display (default is an empty string).
131
+ message : str
132
+ The message to display.
132
133
  timestamp : bool, optional
133
134
  Whether to include a timestamp (default is True).
134
135
  """
135
136
  Console.fail(message, timestamp)
136
137
 
137
- def error(self, message: str, timestamp: bool = True):
138
+ def error(self, message: str, timestamp: bool = True) -> None:
138
139
  """
139
140
  Prints an error message with a red background.
140
141
 
141
142
  Parameters
142
143
  ----------
143
- message : str, optional
144
- The message to display (default is an empty string).
144
+ message : str
145
+ The message to display.
145
146
  timestamp : bool, optional
146
147
  Whether to include a timestamp (default is True).
147
148
  """
148
149
  Console.error(message, timestamp)
149
150
 
150
- def textError(self, message: str):
151
+ def textError(self, message: str) -> None:
151
152
  """
152
153
  Prints an error message in red.
153
154
 
154
155
  Parameters
155
156
  ----------
156
- message : str, optional
157
- The message to display (default is an empty string).
157
+ message : str
158
+ The message to display.
158
159
  """
159
160
  Console.textError(message)
160
161
 
161
- def textErrorBold(self, message: str):
162
+ def textErrorBold(self, message: str) -> None:
162
163
  """
163
164
  Prints a bold error message in red.
164
165
 
165
166
  Parameters
166
167
  ----------
167
- message : str, optional
168
- The message to display (default is an empty string).
168
+ message : str
169
+ The message to display.
169
170
  """
170
171
  Console.textErrorBold(message)
171
172
 
172
- def textMuted(self, message: str):
173
+ def textMuted(self, message: str) -> None:
173
174
  """
174
175
  Prints a muted (gray) message.
175
176
 
176
177
  Parameters
177
178
  ----------
178
- message : str, optional
179
- The message to display (default is an empty string).
179
+ message : str
180
+ The message to display.
180
181
  """
181
182
  Console.textMuted(message)
182
183
 
183
- def textMutedBold(self, message: str):
184
+ def textMutedBold(self, message: str) -> None:
184
185
  """
185
186
  Prints a bold muted (gray) message.
186
187
 
187
188
  Parameters
188
189
  ----------
189
- message : str, optional
190
- The message to display (default is an empty string).
190
+ message : str
191
+ The message to display.
191
192
  """
192
193
  Console.textMutedBold(message)
193
194
 
194
- def textUnderline(self, message: str):
195
+ def textUnderline(self, message: str) -> None:
195
196
  """
196
197
  Prints an underlined message.
197
198
 
198
199
  Parameters
199
200
  ----------
200
- message : str, optional
201
- The message to display (default is an empty string).
201
+ message : str
202
+ The message to display.
202
203
  """
203
204
  Console.textUnderline(message)
204
205
 
205
- def clear(self):
206
+ def clear(self) -> None:
206
207
  """
207
208
  Clears the console screen.
208
209
  """
209
210
  Console.clear()
210
211
 
211
- def clearLine(self):
212
+ def clearLine(self) -> None:
212
213
  """
213
214
  Clears the current console line.
214
215
  """
215
216
  Console.clearLine()
216
217
 
217
- def line(self, message: str):
218
+ def line(self) -> None:
218
219
  """
219
- Prints a line of text.
220
-
221
- Parameters
222
- ----------
223
- message : str, optional
224
- The message to display (default is an empty string).
220
+ Prints a line empty.
225
221
  """
226
- Console.line(message)
222
+ Console.line()
227
223
 
228
- def newLine(self, count: int = 1):
224
+ def newLine(self, count: int = 1) -> None:
229
225
  """
230
226
  Prints multiple new lines.
231
227
 
@@ -236,18 +232,18 @@ class BaseCommand(IBaseCommand):
236
232
  """
237
233
  Console.newLine(count)
238
234
 
239
- def write(self, message: str):
235
+ def write(self, message: str) -> None:
240
236
  """
241
237
  Prints a message without moving to the next line.
242
238
 
243
239
  Parameters
244
240
  ----------
245
241
  message : str, optional
246
- The message to display (default is an empty string).
242
+ The message to display.
247
243
  """
248
244
  Console.write(message)
249
245
 
250
- def writeLine(self, message: str):
246
+ def writeLine(self, message: str) -> None:
251
247
  """
252
248
  Prints a message and moves to the next line.
253
249
 
@@ -272,7 +268,7 @@ class BaseCommand(IBaseCommand):
272
268
  str
273
269
  The user's input.
274
270
  """
275
- return Console.ask(question)
271
+ return Console.ask(question).strip()
276
272
 
277
273
  def confirm(self, question: str, default: bool = False) -> bool:
278
274
  """
@@ -290,7 +286,7 @@ class BaseCommand(IBaseCommand):
290
286
  bool
291
287
  The user's response.
292
288
  """
293
- return Console.ask(question, default)
289
+ return Console.confirm(question, default)
294
290
 
295
291
  def secret(self, question: str) -> str:
296
292
  """
@@ -397,21 +393,6 @@ class BaseCommand(IBaseCommand):
397
393
  """
398
394
  return ProgressBar(total=total, width=width)
399
395
 
400
- def setArgs(self, args):
401
- """
402
- Define the logic of setting command arguments.
403
-
404
- Parameters
405
- ----------
406
- args : argparse.Namespace
407
- Contain the arguments to be set for the command.
408
- """
409
- try:
410
- self.args = vars(args)
411
- except TypeError:
412
- self.args = {}
413
-
414
-
415
396
  def handle(self, **kwargs):
416
397
  """
417
398
  Abstract method to define the logic of the command.
@@ -425,4 +406,31 @@ class BaseCommand(IBaseCommand):
425
406
  NotImplementedError: If the method is not implemented in a subclass. This ensures that all command classes
426
407
  adhere to the expected structure.
427
408
  """
428
- raise NotImplementedError("The 'handle' method must be implemented in the child class.")
409
+ raise NotImplementedError("The 'handle' method must be implemented in the child class.")
410
+
411
+ def setArgs(self, args) -> None:
412
+ """
413
+ Define the logic of setting command arguments.
414
+
415
+ Parameters
416
+ ----------
417
+ args : argparse.Namespace or dict
418
+ Contain the arguments to be set for the command.
419
+ """
420
+ if isinstance(args, argparse.Namespace):
421
+ self.args = vars(args)
422
+ elif isinstance(args, dict):
423
+ self.args = args
424
+ else:
425
+ raise ValueError("Invalid argument type. Expected 'argparse.Namespace' or 'dict'.")
426
+
427
+ def getArgs(self) -> dict:
428
+ """
429
+ Get the command arguments.
430
+
431
+ Returns
432
+ -------
433
+ dict
434
+ The command arguments.
435
+ """
436
+ return self.args
@@ -33,5 +33,4 @@ class CommandFilter(ICommandFilter):
33
33
  'schedule:work', # Command to handle scheduled work
34
34
  'help', # Command to show help information
35
35
  'version', # Command to display version information
36
- 'tests:run' # Command to run tests
37
36
  ]
@@ -1,7 +1,7 @@
1
1
  import os
2
2
  import shutil
3
3
  from orionis.luminate.console.base.command import BaseCommand
4
- from orionis.luminate.console.exceptions.cli_exception import CLIOrionisRuntimeError
4
+ from orionis.luminate.console.exceptions.cli_runtime_error import CLIOrionisRuntimeError
5
5
 
6
6
  class CacheClearCommand(BaseCommand):
7
7
  """
@@ -9,21 +9,29 @@ class CacheClearCommand(BaseCommand):
9
9
 
10
10
  This command recursively searches for and removes all `__pycache__` directories
11
11
  in the project folder to ensure that no stale bytecode files persist.
12
-
13
- Attributes
14
- ----------
15
- signature : str
16
- The unique identifier for the command, used to trigger its execution.
17
- description : str
18
- A brief summary describing the purpose of the command.
19
12
  """
20
13
 
21
- # The command signature used to execute this command.
22
14
  signature = 'cache:clear'
23
15
 
24
- # A brief description of the command.
25
16
  description = 'Clears the project cache by removing all __pycache__ directories.'
26
17
 
18
+ def __init__(self) -> None:
19
+ """
20
+ Initializes the command instance, setting the list of directories to exclude from the cache clearing process.
21
+ """
22
+ self.exclude_dirs = [
23
+ 'venv',
24
+ 'env',
25
+ 'virtualenv',
26
+ 'venv3',
27
+ 'env3',
28
+ 'venv2',
29
+ 'env2',
30
+ 'vendor',
31
+ 'node_modules',
32
+ 'environment'
33
+ ]
34
+
27
35
  def handle(self) -> None:
28
36
  """
29
37
  Executes the cache clearing process.
@@ -45,7 +53,7 @@ class CacheClearCommand(BaseCommand):
45
53
  for root, dirs, files in os.walk(base_path, topdown=True):
46
54
 
47
55
  # Skip common environment directories (e.g., venv, env, vendor, node_modules)
48
- for env_dir in ['venv', 'env', 'virtualenv', 'venv3', 'env3', 'venv2', 'env2', 'vendor', 'node_modules', 'environment']:
56
+ for env_dir in self.exclude_dirs:
49
57
  if env_dir in dirs:
50
58
  dirs.remove(env_dir)
51
59