orionis 0.638.0__py3-none-any.whl → 0.639.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.
@@ -26,7 +26,7 @@ class CacheClearCommand(BaseCommand):
26
26
  """
27
27
 
28
28
  # Indicates whether timestamps will be shown in the command output
29
- timestamps: bool = True
29
+ timestamps: bool = False
30
30
 
31
31
  # Command signature and description
32
32
  signature: str = "cache:clear"
@@ -64,7 +64,7 @@ class CacheClearCommand(BaseCommand):
64
64
  raise CLIOrionisRuntimeError(f"Cache clearing failed: {error_message}")
65
65
 
66
66
  # If the command was successful, print the output
67
- self.textSuccess("Cache cleared successfully.")
67
+ self.info("Cache cleared successfully.")
68
68
 
69
69
  # If the command was successful, return True
70
70
  return True # Cache cleared successfully
@@ -0,0 +1,113 @@
1
+ import subprocess
2
+ from orionis.console.base.command import BaseCommand
3
+ from orionis.console.exceptions import CLIOrionisRuntimeError
4
+ from orionis.foundation.contracts.application import IApplication
5
+ import shutil
6
+ import logging
7
+
8
+ class LogClearCommand(BaseCommand):
9
+ """
10
+ Command to clear all existing log files and directories in the application's log storage.
11
+
12
+ This command disables all active loggers, locates the application's log directory,
13
+ and attempts to remove all files, symlinks, and subdirectories within it. If a log
14
+ file is locked, it will be truncated instead of deleted. Any unexpected errors during
15
+ the process will raise a CLIOrionisRuntimeError.
16
+
17
+ Parameters
18
+ ----------
19
+ app : IApplication
20
+ The application instance providing access to the log storage path.
21
+
22
+ Returns
23
+ -------
24
+ bool
25
+ Returns True if all log files and directories are cleared successfully,
26
+ or if the log directory does not exist. Raises CLIOrionisRuntimeError
27
+ if an unexpected error occurs during the process.
28
+
29
+ Raises
30
+ ------
31
+ CLIOrionisRuntimeError
32
+ If an unexpected error occurs while clearing the log files or directories.
33
+ """
34
+
35
+ # Indicates whether timestamps will be shown in the command output
36
+ timestamps: bool = False
37
+
38
+ # Command signature and description
39
+ signature: str = "log:clear"
40
+
41
+ # Command description
42
+ description: str = "Eliminar todos los logs existentes de la aplicacion."
43
+
44
+ def handle(self, app: IApplication) -> bool:
45
+ """
46
+ Clears all existing log files and directories in the application's log storage.
47
+
48
+ Parameters
49
+ ----------
50
+ app : IApplication
51
+ The application instance providing access to the log storage path.
52
+
53
+ Returns
54
+ -------
55
+ bool
56
+ True if the operation completes without raising an exception,
57
+ or if the log directory does not exist.
58
+
59
+ Raises
60
+ ------
61
+ CLIOrionisRuntimeError
62
+ If an unexpected error occurs during the log clearing process.
63
+ """
64
+ try:
65
+ # Shutdown all active loggers to release file handles
66
+ logging.shutdown()
67
+
68
+ # Get the path to the application's log directory
69
+ log_path = app.path('storage') / 'logs'
70
+
71
+ # Check if the log directory exists and is a directory
72
+ if log_path.exists() and log_path.is_dir():
73
+ for entry in log_path.iterdir():
74
+ try:
75
+ if entry.is_file() or entry.is_symlink():
76
+
77
+ # Attempt to truncate the file if it's in use, then delete it
78
+ try:
79
+
80
+ # Truncate file contents
81
+ with open(entry, 'w'):
82
+ pass
83
+
84
+ # Attempt to delete the file
85
+ entry.unlink()
86
+
87
+ except PermissionError:
88
+
89
+ # If the file is locked, just truncate and skip deletion
90
+ pass
91
+
92
+ elif entry.is_dir():
93
+
94
+ # Recursively remove subdirectories and their contents
95
+ shutil.rmtree(entry)
96
+
97
+ except Exception as e:
98
+
99
+ # Ignore errors for individual entries to continue processing others
100
+ pass
101
+
102
+ # Print success message
103
+ self.info("All log files have been successfully deleted.")
104
+
105
+ # Return True if the operation completes successfully
106
+ return True
107
+
108
+ except Exception as exc:
109
+
110
+ # Raise a CLIOrionisRuntimeError for any unexpected exception
111
+ raise CLIOrionisRuntimeError(
112
+ f"An unexpected error occurred while clearing the cache: {exc}"
113
+ )
@@ -87,9 +87,6 @@ class MakeCommand(BaseCommand):
87
87
 
88
88
  try:
89
89
 
90
- # Print a new line to separate output
91
- self.newLine()
92
-
93
90
  # Retrieve the 'name' argument (required) and 'signature' argument (optional, with default)
94
91
  name: str = self.argument("name")
95
92
  signature: str = self.argument("signature", "custom:command")
@@ -133,9 +130,6 @@ class MakeCommand(BaseCommand):
133
130
  file_path = file_path.relative_to(app.path('root'))
134
131
  self.info(f"Console command [{file_path}] created successfully.")
135
132
 
136
- # Print a new line to separate output
137
- self.newLine()
138
-
139
133
  except Exception as e:
140
134
 
141
135
  # Catch any unexpected exceptions and raise a CLI-specific runtime error
@@ -74,6 +74,9 @@ class WorkFlowGithubCommand(BaseCommand):
74
74
  "Test suite failed. Please fix the issues before proceeding with the workflow."
75
75
  )
76
76
 
77
+ # If all tests passed, print a success message
78
+ self.info("All tests passed successfully. Proceeding with the workflow.")
79
+
77
80
  except Exception as e:
78
81
 
79
82
  # Raise a custom runtime error if any exception occurs
@@ -289,6 +289,7 @@ class Reactor(IReactor):
289
289
  from orionis.console.commands.scheduler_work import ScheduleWorkCommand
290
290
  from orionis.console.commands.scheduler_list import ScheduleListCommand
291
291
  from orionis.console.commands.make_command import MakeCommand
292
+ from orionis.console.commands.log import LogClearCommand
292
293
 
293
294
  # List of core command classes to load (extend this list as more core commands are added)
294
295
  core_commands = [
@@ -300,7 +301,8 @@ class Reactor(IReactor):
300
301
  CacheClearCommand,
301
302
  ScheduleWorkCommand,
302
303
  ScheduleListCommand,
303
- MakeCommand
304
+ MakeCommand,
305
+ LogClearCommand
304
306
  ]
305
307
 
306
308
  # Iterate through the core command classes and register them
@@ -26,10 +26,10 @@ class Chunked(BaseEntity):
26
26
  """
27
27
 
28
28
  path: str = field(
29
- default = 'storage/log/chunked.log',
29
+ default = 'storage/logs/chunked.log',
30
30
  metadata = {
31
31
  "description": "The file path where the log is stored.",
32
- "default": "storage/log/chunked.log"
32
+ "default": "storage/logs/chunked.log"
33
33
  },
34
34
  )
35
35
 
@@ -18,10 +18,10 @@ class Daily(BaseEntity):
18
18
  """
19
19
 
20
20
  path: str = field(
21
- default = 'storage/log/daily.log',
21
+ default = 'storage/logs/daily.log',
22
22
  metadata = {
23
23
  "description": "The file path where the log is stored.",
24
- "default": "storage/log/daily.log"
24
+ "default": "storage/logs/daily.log"
25
25
  },
26
26
  )
27
27
 
@@ -16,10 +16,10 @@ class Hourly(BaseEntity):
16
16
  """
17
17
 
18
18
  path: str = field(
19
- default = 'storage/log/hourly.log',
19
+ default = 'storage/logs/hourly.log',
20
20
  metadata = {
21
21
  "description": "The file path where the log is stored.",
22
- "default": "storage/log/hourly.log"
22
+ "default": "storage/logs/hourly.log"
23
23
  },
24
24
  )
25
25
 
@@ -16,10 +16,10 @@ class Monthly(BaseEntity):
16
16
  """
17
17
 
18
18
  path: str = field(
19
- default = 'storage/log/monthly.log',
19
+ default = 'storage/logs/monthly.log',
20
20
  metadata = {
21
21
  "description": "The file path where the log is stored.",
22
- "default": "storage/log/monthly.log"
22
+ "default": "storage/logs/monthly.log"
23
23
  },
24
24
  )
25
25
 
@@ -10,10 +10,10 @@ class Stack(BaseEntity):
10
10
  """
11
11
 
12
12
  path: str = field(
13
- default = 'storage/log/stack.log',
13
+ default = 'storage/logs/stack.log',
14
14
  metadata = {
15
15
  "description": "The file path where the log is stored.",
16
- "default": "storage/log/stack.log"
16
+ "default": "storage/logs/stack.log"
17
17
  },
18
18
  )
19
19
 
@@ -16,10 +16,10 @@ class Weekly(BaseEntity):
16
16
  """
17
17
 
18
18
  path: str = field(
19
- default = 'storage/log/weekly.log',
19
+ default = 'storage/logs/weekly.log',
20
20
  metadata = {
21
21
  "description": "The file path where the log is stored.",
22
- "default": "storage/log/weekly.log"
22
+ "default": "storage/logs/weekly.log"
23
23
  },
24
24
  )
25
25
 
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.638.0"
8
+ VERSION = "0.639.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orionis
3
- Version: 0.638.0
3
+ Version: 0.639.0
4
4
  Summary: Orionis Framework – Elegant, Fast, and Powerful.
5
5
  Home-page: https://github.com/orionis-framework/framework
6
6
  Author: Raul Mauricio Uñate Castro
@@ -8,15 +8,16 @@ orionis/console/base/command.py,sha256=tAO_EVy1aNWneNSKYYMAf9yDTfbvHAqSJnZZ6pOR4
8
8
  orionis/console/base/scheduler.py,sha256=IKNhpI_lPbI8H3YruD9z7eNdjuqNYceaclx_Hr5BHfY,8065
9
9
  orionis/console/base/scheduler_event_listener.py,sha256=X2mZBAYLBCtLOH7QSrCEaLeJ5m8Hq5UtGxaWRRvWbfo,4421
10
10
  orionis/console/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- orionis/console/commands/cache.py,sha256=WU4VX4u1CoqHeY6ob2peCRzCKypRA7bpqUApo5_z1wU,3054
11
+ orionis/console/commands/cache.py,sha256=iwdMdRLw8BAGkR-OcBB3JD9pOidC3jWT-W-DUrENywQ,3048
12
12
  orionis/console/commands/help.py,sha256=VFIn3UqQm4pxwjfSQohVwKNpc7F-6XRcwSZQwDSLEaU,3739
13
- orionis/console/commands/make_command.py,sha256=NEdCW43-W_W9h1G4i5zEglhEIdvt_GWUBZFIGOCbPrY,6238
13
+ orionis/console/commands/log.py,sha256=qTiUhWMbEZFbWaxk4pVdWujkfq0TebiBUflsNDXoYJs,4060
14
+ orionis/console/commands/make_command.py,sha256=EbTicRHGf7uZ78MSDwZpQMDTB0MvwATclWNTK4vbkZ4,6076
14
15
  orionis/console/commands/publisher.py,sha256=xVFMVU4xrhmLK_ztou5UWJ2ONpzPc1fjjJufxnetej4,21371
15
16
  orionis/console/commands/scheduler_list.py,sha256=Wtjy73fpcjI6GGsJg6BHWVUXItzHbY1QLEhryXpCLcs,4770
16
17
  orionis/console/commands/scheduler_work.py,sha256=iPTgP7gOmTPr__TltYQWiqbDXbCP2njuO_2fCzwmMuc,5778
17
18
  orionis/console/commands/test.py,sha256=LXtl918TmYhg0sjBiCfbsvaXUmCLqwCXTazmy7AJhlE,2445
18
19
  orionis/console/commands/version.py,sha256=0EEFOzzUMzH7DOULKmkHkDLt4D8k938FIkkV3iBQ-t8,3694
19
- orionis/console/commands/workflow.py,sha256=uaesN9HotrgwuOYMCDeN_nzHr9CVZx4_sLTshISSbtU,2946
20
+ orionis/console/commands/workflow.py,sha256=16fpHjkMmdVI9cCemADLqNz3U50oaLoVTapGdbigrYU,3095
20
21
  orionis/console/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
22
  orionis/console/contracts/base_command.py,sha256=UlDN41Ts0ulxM-B2kgeKNr9_gNv_0LCth_pon1os-8U,7617
22
23
  orionis/console/contracts/base_scheduler.py,sha256=RSxEW57MoMU3pXfliIrQw9WuMk95p-xHXi1yACp1qsU,7728
@@ -32,7 +33,7 @@ orionis/console/contracts/reactor.py,sha256=iT6ShoCutAWEeJzOf_PK7CGXi9TgrOD5tewH
32
33
  orionis/console/contracts/schedule.py,sha256=xtXgp4BPhvhg3YSM4mrIdbyoBdr4OJBi1gBM_kJN5UQ,13694
33
34
  orionis/console/contracts/schedule_event_listener.py,sha256=h06qsBxuEMD3KLSyu0JXdUDHlQW19BX9lA09Qrh2QXg,3818
34
35
  orionis/console/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
- orionis/console/core/reactor.py,sha256=pnjL2MdqNLhhlfpVYC9tCGWO4ZjlrIS4ixNGk9PY7DU,43814
36
+ orionis/console/core/reactor.py,sha256=BxnjYxtK-KvIldbl_dYBEKJYpH9a6yh8MhjPg2DwnWY,43910
36
37
  orionis/console/dumper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
38
  orionis/console/dumper/debug.py,sha256=p8uflSXeDJDrVM9mZY4JMYEus73Z6TsLnQQtgP0QUak,22427
38
39
  orionis/console/dynamic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -155,13 +156,13 @@ orionis/foundation/config/filesystems/entitites/public.py,sha256=bcgp7wOLse_D-_A
155
156
  orionis/foundation/config/logging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
156
157
  orionis/foundation/config/logging/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
157
158
  orionis/foundation/config/logging/entities/channels.py,sha256=-bguMcxirxwJl1qLtDbFkRcJ594MaH9bo8jYk-RC3Ec,4928
158
- orionis/foundation/config/logging/entities/chunked.py,sha256=AAmvkTcwGe9j9lGzmOfrtRn-rHW7hvStVw1LHLE1X7w,3848
159
- orionis/foundation/config/logging/entities/daily.py,sha256=uGrBhj4QQm2TMnbeW_cF76jEjUc9KG5m16jiRCBcjM8,3994
160
- orionis/foundation/config/logging/entities/hourly.py,sha256=fQr-kO1zYYelzpe8YfmY_A45INd0NIbG1sDfcLpg758,2948
159
+ orionis/foundation/config/logging/entities/chunked.py,sha256=9hPqhTHlaQQ8EB1KDxf7I5G42EDOD2ZBqMaEOSHNuu8,3850
160
+ orionis/foundation/config/logging/entities/daily.py,sha256=h8_YVDs5bbwYvkqHLusKMXbpAmkUQTGKU9IGMF4pl2Y,3996
161
+ orionis/foundation/config/logging/entities/hourly.py,sha256=C_cOy_6s3W3jCpwF0RiKiUd1jrLC5StxTjVYYyMN-Ws,2950
161
162
  orionis/foundation/config/logging/entities/logging.py,sha256=Y6BZ1cnsKeeGUgK2zEMs0srFKI_AHBIghK58efZWj60,2569
162
- orionis/foundation/config/logging/entities/monthly.py,sha256=cNp1jbKA0OVvzw912YnMA9nzTA1VyNJ2k3FPJal2Hss,2939
163
- orionis/foundation/config/logging/entities/stack.py,sha256=srjiHVGo6jxJEVX23A0hiw7tRaLiQj9TF5jVyeNd9So,1732
164
- orionis/foundation/config/logging/entities/weekly.py,sha256=wtUMmjjaZvIzP1lzFu2JtQFUerwUdYRV6AFXrJqYddg,2883
163
+ orionis/foundation/config/logging/entities/monthly.py,sha256=QAA5VOHwumMKPtHGTKgTLM_kDFcNpUT8T1uIxzSnaSk,2941
164
+ orionis/foundation/config/logging/entities/stack.py,sha256=xcg-cRVxmG40sUNmjczX4sQgajt3JPvQdkim7zG776c,1734
165
+ orionis/foundation/config/logging/entities/weekly.py,sha256=SjWS5NEfO-Qjc6C5BLPLsF-isTaikfK_EoIqsWXp4L8,2885
165
166
  orionis/foundation/config/logging/enums/__init__.py,sha256=QUTGa3iIds08ycR7d-Oqa11P07G-djFLGco9ziJjg0E,57
166
167
  orionis/foundation/config/logging/enums/levels.py,sha256=9ELSmWnlaB14uqp5OsKXltsF5aVbxwdLQxYp8pjQAbk,872
167
168
  orionis/foundation/config/logging/validators/__init__.py,sha256=ZJmPiObyJgbGCgFFz20Ryu4CX5z-cPW9ZWxirQrJoZ0,121
@@ -216,7 +217,7 @@ orionis/foundation/providers/scheduler_provider.py,sha256=IrPQJwvQVLRm5Qnz0Cxon4
216
217
  orionis/foundation/providers/testing_provider.py,sha256=eI1p2lUlxl25b5Z487O4nmqLE31CTDb4c3Q21xFadkE,1615
217
218
  orionis/foundation/providers/workers_provider.py,sha256=GdHENYV_yGyqmHJHn0DCyWmWId5xWjD48e6Zq2PGCWY,1674
218
219
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
219
- orionis/metadata/framework.py,sha256=4WyL10ky-cJJ_T9t3TSHzWBwSA44NDqHZDr8gI2g1V8,4089
220
+ orionis/metadata/framework.py,sha256=sOy0KwTeysZ8n0GSmh5u2hXsJPkSENEtPd2T9RZzvT4,4089
220
221
  orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
221
222
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
222
223
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -403,8 +404,8 @@ orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnI
403
404
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
404
405
  orionis/test/view/render.py,sha256=R55ykeRs0wDKcdTf4O1YZ8GDHTFmJ0IK6VQkbJkYUvo,5571
405
406
  orionis/test/view/report.stub,sha256=QLqqCdRoENr3ECiritRB3DO_MOjRQvgBh5jxZ3Hs1r0,28189
406
- orionis-0.638.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
407
- orionis-0.638.0.dist-info/METADATA,sha256=QJnSTeP4n47XKy8l7TYmEJImOBgrcylGKM3RR3-GAak,4772
408
- orionis-0.638.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
409
- orionis-0.638.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
410
- orionis-0.638.0.dist-info/RECORD,,
407
+ orionis-0.639.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
408
+ orionis-0.639.0.dist-info/METADATA,sha256=dr3B2ScppB4iVyMGR5b403-JEu7qmuTzCaZXTQjnnYY,4772
409
+ orionis-0.639.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
410
+ orionis-0.639.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
411
+ orionis-0.639.0.dist-info/RECORD,,