orionis 0.727.0__py3-none-any.whl → 0.729.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.
@@ -63,13 +63,10 @@ class CacheClearCommand(BaseCommand):
63
63
  error_message = process.stderr.strip() or "Unknown error occurred."
64
64
  raise CLIOrionisRuntimeError(f"Cache clearing failed: {error_message}")
65
65
 
66
- # If the command was successful, print the output
67
- self.info("Cache cleared successfully.")
68
-
69
66
  # If the command was successful, return True
70
- return True # Cache cleared successfully
67
+ return True
71
68
 
72
- except Exception as exc:
69
+ except Exception as e:
73
70
 
74
- # Catch any unexpected exceptions and raise as a CLIOrionisRuntimeError
75
- raise CLIOrionisRuntimeError(f"An unexpected error occurred while clearing the cache: {exc}")
71
+ # Reraise any unexpected exceptions as CLIOrionisRuntimeError with the original error message
72
+ raise CLIOrionisRuntimeError(f"An unexpected error occurred during cache clearing: {str(e)}") from e
@@ -60,8 +60,8 @@ class HelpCommand(BaseCommand):
60
60
  commands = reactor.info()
61
61
 
62
62
  # Build the usage and commands help text
63
- usage = "[bold cyan]Usage:[/]\n python -B <command> <params/flags>\n\n"
64
- usage += "[bold cyan]Example:[/]\n python -B app:command --flag\n\n"
63
+ usage = "[bold cyan]Usage:[/]\n python -B reactor <command> <params/flags>\n\n"
64
+ usage += "[bold cyan]Example:[/]\n python -B reactor app:command --flag\n\n"
65
65
  usage += "[bold cyan]Available Commands:[/]\n"
66
66
 
67
67
  # Determine the maximum signature length for alignment
@@ -80,7 +80,7 @@ class HelpCommand(BaseCommand):
80
80
  # Create a rich panel to display the help information
81
81
  panel = Panel(
82
82
  usage,
83
- title="[bold green]Orionis CLI Help[/]",
83
+ title="[bold green]Orionis CLI | Reactor[/]",
84
84
  expand=False,
85
85
  border_style="bright_blue",
86
86
  padding=(1, 2)
@@ -2,6 +2,7 @@ from typing import Dict, List
2
2
  from rich.console import Console
3
3
  from rich.panel import Panel
4
4
  from rich.table import Table
5
+ from rich import box
5
6
  from orionis.console.base.command import BaseCommand
6
7
  from orionis.console.contracts.schedule import ISchedule
7
8
  from orionis.console.exceptions import CLIOrionisRuntimeError
@@ -77,14 +78,17 @@ class ScheduleListCommand(BaseCommand):
77
78
  console.line()
78
79
 
79
80
  # Create and configure a table to display scheduled jobs
80
- table = Table(title="Scheduled Jobs", show_lines=True)
81
- table.add_column("Signature", style="cyan", no_wrap=True)
82
- table.add_column("Arguments", style="magenta")
83
- table.add_column("Purpose", style="green")
84
- table.add_column("Random Delay (Calculated Result)", style="yellow")
85
- table.add_column("Start Date", style="white")
86
- table.add_column("End Date", style="white")
87
- table.add_column("Details", style="dim")
81
+ table = Table(show_lines=True, box=box.SIMPLE_HEAVY)
82
+ table.add_column("Signature", style="bold cyan", no_wrap=True)
83
+ table.add_column("Arguments", style="bold magenta")
84
+ table.add_column("Purpose", style="bold green")
85
+ table.add_column("Random Delay\n(Calculated Result)", style="bold yellow")
86
+ table.add_column("Coalesce", style="bold blue")
87
+ table.add_column("Max Instances", style="bold red")
88
+ table.add_column("Misfire Grace Time", style="bold orange3")
89
+ table.add_column("Start Date", style="bold bright_white")
90
+ table.add_column("End Date", style="bold bright_white")
91
+ table.add_column("Details", style="italic dim")
88
92
 
89
93
  # Populate the table with job details
90
94
  for job in list_tasks:
@@ -92,15 +96,25 @@ class ScheduleListCommand(BaseCommand):
92
96
  args = str(job.get("args", []))
93
97
  purpose = str(job.get("purpose"))
94
98
  random_delay = str(job.get("random_delay"))
99
+ coalesce = str(job.get("coalesce"))
100
+ max_instances = str(job.get("max_instances"))
101
+ misfire_grace_time = str(job.get("misfire_grace_time"))
95
102
  start_date = str(job.get("start_date"))
96
103
  end_date = str(job.get("end_date"))
97
104
  details = str(job.get("details"))
98
105
 
99
- table.add_row(signature, args, purpose, random_delay, start_date, end_date, details)
106
+ table.add_row(signature, args, purpose, random_delay, coalesce, max_instances, misfire_grace_time, start_date, end_date, details)
100
107
 
101
- # Print the table to the console
108
+ # Print the table inside a panel with custom title and style
109
+ panel = Panel(
110
+ table,
111
+ title="[bold green]Orionis Schedule Jobs[/]",
112
+ expand=False,
113
+ border_style="bright_blue",
114
+ padding=(0, 0)
115
+ )
102
116
  console.line()
103
- console.print(table)
117
+ console.print(panel)
104
118
  console.line()
105
119
 
106
120
  except Exception as e:
@@ -5,6 +5,7 @@ from orionis.console.exceptions import CLIOrionisRuntimeError
5
5
  from rich.console import Console
6
6
  from rich.panel import Panel
7
7
  from orionis.metadata import framework
8
+ from datetime import datetime
8
9
 
9
10
  class VersionCommand(BaseCommand):
10
11
  """
@@ -84,13 +85,12 @@ class VersionCommand(BaseCommand):
84
85
  if self.argument("without_console", False):
85
86
  return framework.VERSION
86
87
 
87
- # Compose the main information strings using framework metadata
88
- title = f"[bold yellow]{framework.NAME.capitalize()} Framework[/bold yellow] [white]v{framework.VERSION}[/white]"
89
- author = f"[bold]Author:[/bold] {framework.AUTHOR} | [bold]Email:[/bold] {framework.AUTHOR_EMAIL}"
90
- desc = f"[italic]{framework.DESCRIPTION}[/italic]"
91
- python_req = f"[bold]Python Requires:[/bold] {framework.PYTHON_REQUIRES}"
92
- docs = f"[bold]Docs:[/bold] [underline blue]{framework.DOCS}[/underline blue]"
93
- repo = f"[bold]Repo:[/bold] [underline blue]{framework.FRAMEWORK}[/underline blue]"
88
+ # Compose the main information strings using framework metadata, adding icons for visual appeal
89
+ author = f"👤 [bold]Author:[/bold] {framework.AUTHOR} | ✉️ [bold]Email:[/bold] {framework.AUTHOR_EMAIL}"
90
+ desc = f"📝 [italic]{framework.DESCRIPTION}[/italic]"
91
+ python_req = f"🐍 [bold]Python Requires:[/bold] {framework.PYTHON_REQUIRES}"
92
+ docs = f"📖 [bold]Docs:[/bold] [underline blue]{framework.DOCS}[/underline blue]"
93
+ repo = f"💻 [bold]Repo:[/bold] [underline blue]{framework.FRAMEWORK}[/underline blue]"
94
94
 
95
95
  # Combine all information into the panel body
96
96
  body = "\n".join([desc, "", author, python_req, docs, repo, ""])
@@ -98,11 +98,11 @@ class VersionCommand(BaseCommand):
98
98
  # Create a styled panel with the collected information
99
99
  panel = Panel(
100
100
  body,
101
- title=title,
102
- border_style="bold yellow",
103
- padding=(1, 6),
101
+ title=f"[bold green]{framework.NAME.capitalize()} Framework | v{framework.VERSION}[/]",
102
+ border_style="bright_blue",
103
+ padding=(1, 2),
104
104
  expand=False,
105
- subtitle="[bold yellow]Orionis CLI[/bold yellow]",
105
+ subtitle=f"[grey50]{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}[/grey50]",
106
106
  subtitle_align="right"
107
107
  )
108
108
 
@@ -283,7 +283,6 @@ class Reactor(IReactor):
283
283
  from orionis.console.commands.__publisher__ import PublisherCommand
284
284
  from orionis.console.commands.cache_clear import CacheClearCommand
285
285
  from orionis.console.commands.help import HelpCommand
286
- from orionis.console.commands.log_clear import LogClearCommand
287
286
  from orionis.console.commands.make_command import MakeCommand
288
287
  from orionis.console.commands.scheduler_list import ScheduleListCommand
289
288
  from orionis.console.commands.scheduler_work import ScheduleWorkCommand
@@ -295,7 +294,6 @@ class Reactor(IReactor):
295
294
  PublisherCommand,
296
295
  CacheClearCommand,
297
296
  HelpCommand,
298
- LogClearCommand,
299
297
  MakeCommand,
300
298
  ScheduleListCommand,
301
299
  ScheduleWorkCommand,
@@ -83,7 +83,7 @@ class Event(IEvent):
83
83
  self.__max_instances: Optional[int] = 1
84
84
 
85
85
  # Initialize the misfire grace time attribute as None
86
- self.__misfire_grace_time: Optional[int] = 1
86
+ self.__misfire_grace_time: Optional[int] = None
87
87
 
88
88
  # Initialize the coalesce attribute as True
89
89
  self.__coalesce: bool = True
@@ -3,9 +3,6 @@ from orionis.console.args.argument import CLIArgument
3
3
  from typing import List
4
4
 
5
5
  class {{class_name}}(BaseCommand):
6
- """
7
- [Command objective]
8
- """
9
6
 
10
7
  # Command signature
11
8
  signature: str = "{{signature}}"
@@ -25,7 +22,4 @@ class {{class_name}}(BaseCommand):
25
22
  Implement the command logic here.
26
23
  You can access arguments using self.argument("name").
27
24
  """
28
- try:
29
- pass
30
- except Exception as e:
31
- raise e
25
+ pass
@@ -2,9 +2,9 @@ from orionis.console.base.scheduler_event_listener import BaseScheduleEventListe
2
2
  from orionis.console.contracts.schedule import ISchedule
3
3
  from orionis.console.entities.event_job import EventJob
4
4
 
5
- class {{name-listener}}(BaseScheduleEventListener):
5
+ class InspireListener(BaseScheduleEventListener):
6
6
 
7
- async def before(self, event: EventJob, schedule: ISchedule) -> None:
7
+ async def before(self, event: EventJob, schedule: ISchedule):
8
8
  """
9
9
  Called before processing a job submission event.
10
10
 
@@ -20,9 +20,9 @@ class {{name-listener}}(BaseScheduleEventListener):
20
20
  None
21
21
  This method does not return any value.
22
22
  """
23
- pass
23
+ await super().before(event, schedule)
24
24
 
25
- async def after(self, event: EventJob, schedule: ISchedule) -> None:
25
+ async def after(self, event: EventJob, schedule: ISchedule):
26
26
  """
27
27
  Called after processing a job execution event.
28
28
 
@@ -38,9 +38,9 @@ class {{name-listener}}(BaseScheduleEventListener):
38
38
  None
39
39
  This method does not return any value.
40
40
  """
41
- pass
41
+ await super().after(event, schedule)
42
42
 
43
- async def onFailure(self, event: EventJob, schedule: ISchedule) -> None:
43
+ async def onFailure(self, event: EventJob, schedule: ISchedule):
44
44
  """
45
45
  Called when a job execution fails.
46
46
 
@@ -56,9 +56,9 @@ class {{name-listener}}(BaseScheduleEventListener):
56
56
  None
57
57
  This method does not return any value.
58
58
  """
59
- pass
59
+ await super().onFailure(event, schedule)
60
60
 
61
- async def onMissed(self, event: EventJob, schedule: ISchedule) -> None:
61
+ async def onMissed(self, event: EventJob, schedule: ISchedule):
62
62
  """
63
63
  Called when a job execution is missed.
64
64
 
@@ -74,9 +74,9 @@ class {{name-listener}}(BaseScheduleEventListener):
74
74
  None
75
75
  This method does not return any value.
76
76
  """
77
- pass
77
+ await super().onMissed(event, schedule)
78
78
 
79
- async def onMaxInstances(self, event: EventJob, schedule: ISchedule) -> None:
79
+ async def onMaxInstances(self, event: EventJob, schedule: ISchedule):
80
80
  """
81
81
  Called when a job exceeds the maximum allowed instances.
82
82
 
@@ -92,9 +92,9 @@ class {{name-listener}}(BaseScheduleEventListener):
92
92
  None
93
93
  This method does not return any value.
94
94
  """
95
- pass
95
+ await super().onMaxInstances(event, schedule)
96
96
 
97
- async def onPaused(self, event: EventJob, schedule: ISchedule) -> None:
97
+ async def onPaused(self, event: EventJob, schedule: ISchedule):
98
98
  """
99
99
  Called when the scheduler is paused.
100
100
 
@@ -110,9 +110,9 @@ class {{name-listener}}(BaseScheduleEventListener):
110
110
  None
111
111
  This method does not return any value.
112
112
  """
113
- pass
113
+ await super().onPaused(event, schedule)
114
114
 
115
- async def onResumed(self, event: EventJob, schedule: ISchedule) -> None:
115
+ async def onResumed(self, event: EventJob, schedule: ISchedule):
116
116
  """
117
117
  Called when the scheduler is resumed.
118
118
 
@@ -128,9 +128,9 @@ class {{name-listener}}(BaseScheduleEventListener):
128
128
  None
129
129
  This method does not return any value.
130
130
  """
131
- pass
131
+ await super().onResumed(event, schedule)
132
132
 
133
- async def onRemoved(self, event: EventJob, schedule: ISchedule) -> None:
133
+ async def onRemoved(self, event: EventJob, schedule: ISchedule):
134
134
  """
135
135
  Called when a job is removed from the scheduler.
136
136
 
@@ -146,4 +146,4 @@ class {{name-listener}}(BaseScheduleEventListener):
146
146
  None
147
147
  This method does not return any value.
148
148
  """
149
- pass
149
+ await super().onRemoved(event, schedule)
@@ -738,6 +738,27 @@ class Schedule(ISchedule):
738
738
  )
739
739
  )
740
740
 
741
+ def __getPID(
742
+ self
743
+ ) -> int:
744
+ """
745
+ Retrieve the current process ID (PID) of the running scheduler.
746
+
747
+ This method obtains the process ID of the current Python process using the `os` module.
748
+ The PID is a unique identifier assigned by the operating system to each running process.
749
+ This information can be useful for logging, monitoring, or managing the scheduler process.
750
+
751
+ Returns
752
+ -------
753
+ int
754
+ The process ID (PID) of the current Python process.
755
+ """
756
+
757
+ import os
758
+
759
+ # Return the current process ID using os.getpid()
760
+ return os.getpid()
761
+
741
762
  def __startedListener(
742
763
  self,
743
764
  event
@@ -770,14 +791,12 @@ class Schedule(ISchedule):
770
791
  # Add a blank line for better formatting
771
792
  self.__rich_console.line()
772
793
  panel_content = Text.assemble(
773
- (" Orionis Scheduler Worker ", "bold white on green"), # Header text with styling
774
- ("\n\n", ""), # Add spacing
775
- ("The scheduled tasks worker has started successfully.\n", "white"), # Main message
776
- (f"Started at: {now}\n", "dim"), # Display the start time in dim text
777
- (f"Timezone: {self.__tz.key}\n", "dim"), # Display the configured timezone
778
- ("To stop the worker, press ", "white"), # Instruction text
779
- ("Ctrl+C", "bold yellow"), # Highlight the key combination
780
- (".", "white") # End the instruction
794
+ ("🚀 Orionis Scheduler Worker ", "bold white on green"),
795
+ ("\n\n", ""),
796
+ ("The scheduled tasks worker has started successfully.\n", "white"),
797
+ (f"🕒 Started at: {now} | 🌐 Timezone: {self.__tz.key} | 🆔 PID: {self.__getPID()}\n", "dim"),
798
+ ("🛑 To stop the worker, press ", "white"),
799
+ ("Ctrl+C", "bold yellow")
781
800
  )
782
801
 
783
802
  # Display the message in a styled panel
@@ -1958,6 +1977,9 @@ class Schedule(ISchedule):
1958
1977
  start_date: datetime = self.__getAttribute(job, 'start_date', None)
1959
1978
  end_date: datetime = self.__getAttribute(job, 'end_date', None)
1960
1979
  details: str = self.__getAttribute(job, 'details', 'Not Available')
1980
+ coalesce: bool = self.__getAttribute(job, 'coalesce', False)
1981
+ max_instances: int = self.__getAttribute(job, 'max_instances', 1)
1982
+ misfire_grace_time: int = self.__getAttribute(job, 'misfire_grace_time', None)
1961
1983
 
1962
1984
  # Format the start and end dates as strings, or mark as 'Not Applicable' if not set
1963
1985
  formatted_start = start_date.strftime('%Y-%m-%d %H:%M:%S') if start_date else self.NOT_APPLICABLE
@@ -1971,7 +1993,10 @@ class Schedule(ISchedule):
1971
1993
  'random_delay': random_delay,
1972
1994
  'start_date': formatted_start,
1973
1995
  'end_date': formatted_end,
1974
- 'details': details
1996
+ 'details': details,
1997
+ 'coalesce': coalesce,
1998
+ 'max_instances': max_instances,
1999
+ 'misfire_grace_time': misfire_grace_time
1975
2000
  })
1976
2001
 
1977
2002
  # Return the list of scheduled job details
@@ -6,7 +6,7 @@
6
6
  NAME = "orionis"
7
7
 
8
8
  # Current version of the framework
9
- VERSION = "0.727.0"
9
+ VERSION = "0.729.0"
10
10
 
11
11
  # Full name of the author or maintainer of the project
12
12
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orionis
3
- Version: 0.727.0
3
+ Version: 0.729.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
@@ -10,14 +10,13 @@ orionis/console/base/scheduler.py,sha256=JoZdtyrVJiNzBoVEWUovHscqBxqw_fPPwaENIQc
10
10
  orionis/console/base/scheduler_event_listener.py,sha256=X2mZBAYLBCtLOH7QSrCEaLeJ5m8Hq5UtGxaWRRvWbfo,4421
11
11
  orionis/console/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  orionis/console/commands/__publisher__.py,sha256=TS2WGZoWx7YX8CP7ixKB5lHc_1r-bBDNB8OkkWR9lzc,21647
13
- orionis/console/commands/cache_clear.py,sha256=iwdMdRLw8BAGkR-OcBB3JD9pOidC3jWT-W-DUrENywQ,3048
14
- orionis/console/commands/help.py,sha256=VFIn3UqQm4pxwjfSQohVwKNpc7F-6XRcwSZQwDSLEaU,3739
15
- orionis/console/commands/log_clear.py,sha256=OI1j_myCYUOMI-SfnN-NH-6BYzzWKXOKIEb55vFTXq4,4045
13
+ orionis/console/commands/cache_clear.py,sha256=UlFEZI8Q4BONsZybE6IgKrjLhW5N-JJLNEPMVFRw6LA,2926
14
+ orionis/console/commands/help.py,sha256=GF5N6uabqBaGVVgiBRmlB0TQkUlDK71bvIgJQIPJxak,3760
16
15
  orionis/console/commands/make_command.py,sha256=WHE2J78fuY9RHScCOn9R_2KjkiayYJHFlm-Mp-k8X-o,5956
17
- orionis/console/commands/scheduler_list.py,sha256=7Ug0eoqusIOsmHaiakm3-JYAK8VNIypOtKMcSzn-AL0,4544
16
+ orionis/console/commands/scheduler_list.py,sha256=7E0C926e7YVU3YxqQ8Ot2as7Yco0jviFaxM8WrOYfsg,5316
18
17
  orionis/console/commands/scheduler_work.py,sha256=dDW9XTjGb-5ABuhPYjfd1rfO7xLDhgYu5nd6nToiYFE,5597
19
18
  orionis/console/commands/test.py,sha256=G3pveONRbeWTcVwaHat3wTAhxMm4g_BwhJhIejq6V0Y,3518
20
- orionis/console/commands/version.py,sha256=u5_8CfnEVdS3VSME8rbP6o3Z0XFZ30nSz8uHdahBAoY,4766
19
+ orionis/console/commands/version.py,sha256=Av_9oVkhtisf-oDljKbXK5TmCFaeYagLJmOwEVYJPZw,4835
21
20
  orionis/console/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
21
  orionis/console/contracts/base_command.py,sha256=0N1XeV2AdAJaCZCAJNpwItx3YI4GDQmVGrfApx0r0B4,7513
23
22
  orionis/console/contracts/base_scheduler.py,sha256=RSxEW57MoMU3pXfliIrQw9WuMk95p-xHXi1yACp1qsU,7728
@@ -33,7 +32,7 @@ orionis/console/contracts/reactor.py,sha256=iT6ShoCutAWEeJzOf_PK7CGXi9TgrOD5tewH
33
32
  orionis/console/contracts/schedule.py,sha256=NaVOUpuE08X5rm9-oXyNs6r3LbOg7B_rIz-k4r7y4Qk,13703
34
33
  orionis/console/contracts/schedule_event_listener.py,sha256=h06qsBxuEMD3KLSyu0JXdUDHlQW19BX9lA09Qrh2QXg,3818
35
34
  orionis/console/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
- orionis/console/core/reactor.py,sha256=qctLns-f5eB9Air7Qi4hvX5KB5A7SsHeV8M5zYJEiPA,44286
35
+ orionis/console/core/reactor.py,sha256=z3Yp4fvZoXv5YcDJc8sS8AfV9wHC80IgkTO31EijZUg,44184
37
36
  orionis/console/debug/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
37
  orionis/console/debug/dumper.py,sha256=vbmP_GlrzBj0KDjiQl4iDudPRe6V0W5r5UA8i3h9_c4,6555
39
38
  orionis/console/dynamic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -56,16 +55,16 @@ orionis/console/exceptions/__init__.py,sha256=rY9PE85TO_HpI5cfGWbZSDzk5aOUjErqBZ
56
55
  orionis/console/exceptions/cli_exceptions.py,sha256=nk3EGkRheDbw8vrxKgUxkAAPA6gPpO2dE5nDeVHJHA0,3580
57
56
  orionis/console/fluent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
57
  orionis/console/fluent/command.py,sha256=0jyhB45LIjDS7nkjNhkkvEXEzdOBmT49qKIooYY_DbI,8261
59
- orionis/console/fluent/event.py,sha256=lw0lYRhHxyflA7JE4ZLye6rjEOGUmLFMO9e9btwWfNM,168532
58
+ orionis/console/fluent/event.py,sha256=0QdgRDERbKy_ENp44ChvgOGLosp4NbkbWvGEs2e6L1s,168535
60
59
  orionis/console/output/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
61
60
  orionis/console/output/console.py,sha256=xRZXSZiVqlyc1L16MBUV1M3TUHQwrWSFYUtisivm8U8,24423
62
61
  orionis/console/output/executor.py,sha256=uQjFPOlyZLFj9pcyYPugCqxwJog0AJgK1OcmQH2ELbw,7314
63
62
  orionis/console/request/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
63
  orionis/console/request/cli_request.py,sha256=sH7Q2MpMIasiPiEPBeGhExnbfpSic98vQdAKvG9cgew,9071
65
- orionis/console/stubs/command.stub,sha256=ABQ2eFxJ0u0DvTfmoO_DdECkBy-rie-woG62G2Gxw8Y,805
66
- orionis/console/stubs/listener.stub,sha256=DbX-ghx2-vb73kzQ6L20lyg5vSKn58jSLTwFuwNQU9k,4331
64
+ orionis/console/stubs/command.stub,sha256=hvtIUd5JHOOsoHnrwF2yMkzFs2sZeeBgM8RZMPrNgjM,691
65
+ orionis/console/stubs/listener.stub,sha256=kDAdt-q2K3OduzaluWHG6Zu9kZofvfgcQU2f-zFNCyQ,4549
67
66
  orionis/console/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
68
- orionis/console/tasks/schedule.py,sha256=R2mkjp7zFSnhlaBWDrdzcQsHmj8cdOUNyx2_73tzWx0,92762
67
+ orionis/console/tasks/schedule.py,sha256=QExrIRcxr7s31xY1-DLUsrc7GmeuAhFjpCo4OicnChg,93309
69
68
  orionis/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
70
69
  orionis/container/container.py,sha256=LaGFSzDH2YjmWzdiV-r8Z9xs9fyFGJnsanRsEStqHp8,114033
71
70
  orionis/container/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -207,7 +206,7 @@ orionis/foundation/providers/scheduler_provider.py,sha256=IrPQJwvQVLRm5Qnz0Cxon4
207
206
  orionis/foundation/providers/testing_provider.py,sha256=eI1p2lUlxl25b5Z487O4nmqLE31CTDb4c3Q21xFadkE,1615
208
207
  orionis/foundation/providers/workers_provider.py,sha256=GdHENYV_yGyqmHJHn0DCyWmWId5xWjD48e6Zq2PGCWY,1674
209
208
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
210
- orionis/metadata/framework.py,sha256=nfWN_AFm6d2eQFvlJzxl1uswTO-wwXT7brAA27gKiEw,4720
209
+ orionis/metadata/framework.py,sha256=7BKJXREGzMaJpnqFnMTykt4uPO0tUqYaKD8jb_qokaQ,4720
211
210
  orionis/metadata/package.py,sha256=s1JeGJPwdVh4jO3IOfmpwMuJ_oX6Vf9NL7jgPEQNf5Y,16050
212
211
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
213
212
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -402,8 +401,8 @@ orionis/test/validators/workers.py,sha256=HcZ3cnrk6u7cvM1xZpn_lsglHAq69_jx9RcTSv
402
401
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
403
402
  orionis/test/view/render.py,sha256=arysoswhkV2vUd2aVMZRPpmH317jaWbgjDpQ_AWQ5AE,5663
404
403
  orionis/test/view/report.stub,sha256=QLqqCdRoENr3ECiritRB3DO_MOjRQvgBh5jxZ3Hs1r0,28189
405
- orionis-0.727.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
406
- orionis-0.727.0.dist-info/METADATA,sha256=SqjKGk5oqSuIgDXwexcEWVR_ie_IARUEVjM9OgmCsus,4962
407
- orionis-0.727.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
408
- orionis-0.727.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
409
- orionis-0.727.0.dist-info/RECORD,,
404
+ orionis-0.729.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
405
+ orionis-0.729.0.dist-info/METADATA,sha256=lIVvV5wKTf-Eb8rPvW9HfJ7_eJEin9eWH3aXJ4EmM_A,4962
406
+ orionis-0.729.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
407
+ orionis-0.729.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
408
+ orionis-0.729.0.dist-info/RECORD,,
@@ -1,112 +0,0 @@
1
- from orionis.console.base.command import BaseCommand
2
- from orionis.console.exceptions import CLIOrionisRuntimeError
3
- from orionis.foundation.contracts.application import IApplication
4
- import shutil
5
- import logging
6
-
7
- class LogClearCommand(BaseCommand):
8
- """
9
- Command to clear all existing log files and directories in the application's log storage.
10
-
11
- This command disables all active loggers, locates the application's log directory,
12
- and attempts to remove all files, symlinks, and subdirectories within it. If a log
13
- file is locked, it will be truncated instead of deleted. Any unexpected errors during
14
- the process will raise a CLIOrionisRuntimeError.
15
-
16
- Parameters
17
- ----------
18
- app : IApplication
19
- The application instance providing access to the log storage path.
20
-
21
- Returns
22
- -------
23
- bool
24
- Returns True if all log files and directories are cleared successfully,
25
- or if the log directory does not exist. Raises CLIOrionisRuntimeError
26
- if an unexpected error occurs during the process.
27
-
28
- Raises
29
- ------
30
- CLIOrionisRuntimeError
31
- If an unexpected error occurs while clearing the log files or directories.
32
- """
33
-
34
- # Indicates whether timestamps will be shown in the command output
35
- timestamps: bool = False
36
-
37
- # Command signature and description
38
- signature: str = "log:clear"
39
-
40
- # Command description
41
- description: str = "Eliminar todos los logs existentes de la aplicacion."
42
-
43
- def handle(self, app: IApplication) -> bool: # NOSONAR
44
- """
45
- Clears all existing log files and directories in the application's log storage.
46
-
47
- Parameters
48
- ----------
49
- app : IApplication
50
- The application instance providing access to the log storage path.
51
-
52
- Returns
53
- -------
54
- bool
55
- True if the operation completes without raising an exception,
56
- or if the log directory does not exist.
57
-
58
- Raises
59
- ------
60
- CLIOrionisRuntimeError
61
- If an unexpected error occurs during the log clearing process.
62
- """
63
- try:
64
- # Shutdown all active loggers to release file handles
65
- logging.shutdown()
66
-
67
- # Get the path to the application's log directory
68
- log_path = app.path('storage') / 'logs'
69
-
70
- # Check if the log directory exists and is a directory
71
- if log_path.exists() and log_path.is_dir():
72
- for entry in log_path.iterdir():
73
- try:
74
- if entry.is_file() or entry.is_symlink():
75
-
76
- # Attempt to truncate the file if it's in use, then delete it
77
- try:
78
-
79
- # Truncate file contents
80
- with open(entry, 'w'):
81
- ...
82
-
83
- # Attempt to delete the file
84
- entry.unlink()
85
-
86
- except PermissionError:
87
-
88
- # If the file is locked, just truncate and skip deletion
89
- pass
90
-
91
- elif entry.is_dir():
92
-
93
- # Recursively remove subdirectories and their contents
94
- shutil.rmtree(entry)
95
-
96
- except Exception:
97
-
98
- # Ignore errors for individual entries to continue processing others
99
- pass
100
-
101
- # Print success message
102
- self.info("All log files have been successfully deleted.")
103
-
104
- # Return True if the operation completes successfully
105
- return True
106
-
107
- except Exception as exc:
108
-
109
- # Raise a CLIOrionisRuntimeError for any unexpected exception
110
- raise CLIOrionisRuntimeError(
111
- f"An unexpected error occurred while clearing the cache: {exc}"
112
- )