orionis 0.514.0__py3-none-any.whl → 0.516.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.
@@ -4,9 +4,7 @@ from rich.table import Table
4
4
  from orionis.console.base.command import BaseCommand
5
5
  from orionis.console.contracts.schedule import ISchedule
6
6
  from orionis.console.exceptions import CLIOrionisRuntimeError
7
- from orionis.container.exceptions.exception import OrionisContainerException
8
7
  from orionis.foundation.contracts.application import IApplication
9
- from orionis.foundation.exceptions.runtime import OrionisRuntimeError
10
8
 
11
9
  class ScheduleListCommand(BaseCommand):
12
10
  """
@@ -112,10 +110,6 @@ class ScheduleListCommand(BaseCommand):
112
110
 
113
111
  except Exception as e:
114
112
 
115
- # If the exception is already a CLIOrionisRuntimeError or OrionisContainerException, re-raise it
116
- if isinstance(e, (OrionisRuntimeError, OrionisContainerException)):
117
- raise
118
-
119
113
  # Catch any unexpected exceptions and raise as a CLIOrionisRuntimeError
120
114
  raise CLIOrionisRuntimeError(
121
115
  f"An unexpected error occurred while listing the scheduled jobs: {e}"
@@ -1,9 +1,9 @@
1
1
  from abc import ABC, abstractmethod
2
2
  from datetime import datetime
3
3
  from typing import List, Optional, Union
4
+ from orionis.console.contracts.event import IEvent
4
5
  from orionis.console.contracts.schedule_event_listener import IScheduleEventListener
5
6
  from orionis.console.enums.listener import ListeningEvent
6
- from orionis.console.tasks.event import Event
7
7
 
8
8
  class ISchedule(ABC):
9
9
 
@@ -12,7 +12,7 @@ class ISchedule(ABC):
12
12
  self,
13
13
  signature: str,
14
14
  args: Optional[List[str]] = None
15
- ) -> 'Event':
15
+ ) -> 'IEvent':
16
16
  """
17
17
  Prepare an Event instance for a given command signature and its arguments.
18
18
 
@@ -125,7 +125,7 @@ class Event(IEvent):
125
125
  raise CLIOrionisValueError("Details must be a string or None.")
126
126
 
127
127
  # Validate that listener is an IScheduleEventListener instance if it is set
128
- if self.__listener is not None and not isinstance(self.__listener, IScheduleEventListener):
128
+ if self.__listener is not None and not issubclass(self.__listener, IScheduleEventListener):
129
129
  raise CLIOrionisValueError("Listener must implement IScheduleEventListener interface or be None.")
130
130
 
131
131
  # Construct and return an EventEntity with the current event's attributes
@@ -351,7 +351,7 @@ class Event(IEvent):
351
351
  """
352
352
 
353
353
  # Validate that the provided listener is an instance of IScheduleEventListener
354
- if not isinstance(listener, IScheduleEventListener):
354
+ if not issubclass(listener, IScheduleEventListener):
355
355
  raise CLIOrionisValueError("Listener must be an instance of IScheduleEventListener.")
356
356
 
357
357
  # Assign the listener to the event's internal listener attribute
@@ -20,6 +20,7 @@ from apscheduler.schedulers.asyncio import AsyncIOScheduler as APSAsyncIOSchedul
20
20
  from rich.console import Console
21
21
  from rich.panel import Panel
22
22
  from rich.text import Text
23
+ from orionis.console.contracts.event import IEvent
23
24
  from orionis.console.contracts.reactor import IReactor
24
25
  from orionis.console.contracts.schedule import ISchedule
25
26
  from orionis.console.contracts.schedule_event_listener import IScheduleEventListener
@@ -39,7 +40,6 @@ from orionis.console.enums.event import Event as EventEntity
39
40
  from orionis.console.exceptions import CLIOrionisRuntimeError
40
41
  from orionis.console.exceptions.cli_orionis_value_error import CLIOrionisValueError
41
42
  from orionis.console.output.contracts.console import IConsole
42
- from orionis.console.tasks.event import Event
43
43
  from orionis.foundation.contracts.application import IApplication
44
44
  from orionis.services.log.contracts.log_service import ILogger
45
45
 
@@ -104,7 +104,7 @@ class Scheduler(ISchedule):
104
104
  self.__available_commands = self.__getCommands()
105
105
 
106
106
  # Initialize the jobs dictionary to keep track of scheduled jobs.
107
- self.__events: Dict[str, Event] = {}
107
+ self.__events: Dict[str, IEvent] = {}
108
108
 
109
109
  # Initialize the jobs list to keep track of all scheduled jobs.
110
110
  self.__jobs: List[EventEntity] = []
@@ -232,7 +232,7 @@ class Scheduler(ISchedule):
232
232
  self,
233
233
  signature: str,
234
234
  args: Optional[List[str]] = None
235
- ) -> 'Event':
235
+ ) -> 'IEvent':
236
236
  """
237
237
  Prepare an Event instance for a given command signature and its arguments.
238
238
 
@@ -278,6 +278,7 @@ class Scheduler(ISchedule):
278
278
  raise CLIOrionisValueError(f"The command '{signature}' is not available or does not exist.")
279
279
 
280
280
  # Store the command and its arguments for scheduling
281
+ from orionis.console.tasks.event import Event
281
282
  self.__events[signature] = Event(
282
283
  signature=signature,
283
284
  args=args or [],
@@ -930,7 +931,7 @@ class Scheduler(ISchedule):
930
931
 
931
932
  # If a listener is associated with the event, register it
932
933
  if entity.listener:
933
- self._setListener(signature, entity.listener)
934
+ self.setListener(signature, entity.listener)
934
935
 
935
936
  def setListener(
936
937
  self,
@@ -1377,13 +1378,13 @@ class Scheduler(ISchedule):
1377
1378
  for job in self.__jobs:
1378
1379
  # Append a dictionary with relevant job details to the events list
1379
1380
  events.append({
1380
- 'signature': job['signature'],
1381
- 'args': job['args'],
1382
- 'purpose': job['purpose'],
1383
- 'random_delay': job['random_delay'],
1384
- 'start_date': job['start_date'].strftime('%Y-%m-%d %H:%M:%S') if job['start_date'] else None,
1385
- 'end_date': job['end_date'].strftime('%Y-%m-%d %H:%M:%S') if job['end_date'] else None,
1386
- 'details': job['details']
1381
+ 'signature': job.signature,
1382
+ 'args': job.args,
1383
+ 'purpose': job.purpose,
1384
+ 'random_delay': job.random_delay,
1385
+ 'start_date': job.start_date.strftime('%Y-%m-%d %H:%M:%S') if job.start_date else None,
1386
+ 'end_date': job.end_date.strftime('%Y-%m-%d %H:%M:%S') if job.end_date else None,
1387
+ 'details': job.details
1387
1388
  })
1388
1389
 
1389
1390
  # Return the list of scheduled job details
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.514.0"
8
+ VERSION = "0.516.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.514.0
3
+ Version: 0.516.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
@@ -14,7 +14,7 @@ orionis/console/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
14
14
  orionis/console/commands/cache.py,sha256=8DsYoRzSBLn0P9qkGVItRbo0R6snWBDBg0_Xa7tmVhs,2322
15
15
  orionis/console/commands/help.py,sha256=zfSw0pYaOnFN-_Ozdn4veBQDYMgSSDY10nPDCi-7tTY,3199
16
16
  orionis/console/commands/publisher.py,sha256=FUg-EUzK7LLXsla10ZUZro8V0Z5S-KjmsaSdRHSSGbA,21381
17
- orionis/console/commands/scheduler_list.py,sha256=6jVuHwVC33_0gXiXxVefyTvOj94gOZ2P5G-vwDAmF6U,5191
17
+ orionis/console/commands/scheduler_list.py,sha256=iPO-tc5qj-Q17lL_1MRSCaRov_o4GoQcnWTATLKPeLE,4826
18
18
  orionis/console/commands/scheduler_work.py,sha256=yHTbnDH1frAmyvPaUgn0a5q34Eym9QYMXdqYZWwodFs,6336
19
19
  orionis/console/commands/test.py,sha256=-EmQwFwMBuby3OI9HwqMIwuJzd2CGbWbOqmwrR25sOE,2402
20
20
  orionis/console/commands/version.py,sha256=SUuNDJ40f2uq69OQUmPQXJKaa9Bm_iVRDPmBd7zc1Yc,3658
@@ -24,7 +24,7 @@ orionis/console/contracts/command.py,sha256=vmAJD0yMQ5-AD_s9_xCFEAl64sKk65z7U2E1
24
24
  orionis/console/contracts/event.py,sha256=zaOkbRNKpU6U_cIEFic84C3WIcD8kCIyX9hc50jN8N0,119797
25
25
  orionis/console/contracts/kernel.py,sha256=mh4LlhEYHh3FuGZZQ0GBhD6ZLa5YQvaNj2r01IIHI5Y,826
26
26
  orionis/console/contracts/reactor.py,sha256=Xeq7Zrw6WE5MV_XOQfiQEchAFbb6-0TjLpjWOxYW--g,4554
27
- orionis/console/contracts/schedule.py,sha256=xDVe_nAy9ij2D3L1D4G13SZ-PgILxTO0kSZXAgDP-1E,12165
27
+ orionis/console/contracts/schedule.py,sha256=17cfPYtLo-jqF8FxYOhh4epJZnxw5mMPuLGaWoUwxL4,12171
28
28
  orionis/console/contracts/schedule_event_listener.py,sha256=G-Ye9YIzfeXFcJD1jqNOy7Cj_-VQGq0ynXZCTPTp7Mc,11550
29
29
  orionis/console/contracts/scheduler.py,sha256=90QoeoUGOLgLhzCKbWHpuAdWzmHiV1FQXrhzJajLMBA,4354
30
30
  orionis/console/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -79,9 +79,9 @@ orionis/console/output/enums/__init__.py,sha256=LAaAxg-DpArCjf_jqZ0_9s3p8899gntD
79
79
  orionis/console/output/enums/styles.py,sha256=6a4oQCOBOKMh2ARdeq5GlIskJ3wjiylYmh66tUKKmpQ,4053
80
80
  orionis/console/request/cli_request.py,sha256=7-sgYmNUCipuHLVAwWLJiHv0cJCDmsM1Lu9s2D8RIII,1498
81
81
  orionis/console/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
82
- orionis/console/tasks/event.py,sha256=AlOO--HNaUyZ5MXZsKSJJnQnLhZwqg52NvwsdSF8LEk,164395
82
+ orionis/console/tasks/event.py,sha256=l4J-HEPaj1mxB_PYQMgG9dRHUe01wUag8fKLLnR2N2M,164395
83
83
  orionis/console/tasks/listener.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
84
- orionis/console/tasks/schedule.py,sha256=JzE4_ixuReQ_ZKWDrxd4gofl2DjONWUpp8abPD3uUQ4,58324
84
+ orionis/console/tasks/schedule.py,sha256=jhafp0Ve4SBEzjPF-KiFtytuzny_-1K0a6um96ev_xE,58358
85
85
  orionis/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
86
86
  orionis/container/container.py,sha256=aF_b6lTUpG4YCo9yFJEzsntTdIzgMMXFW5LyWqAJVBQ,87987
87
87
  orionis/container/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -239,7 +239,7 @@ orionis/foundation/providers/scheduler_provider.py,sha256=72SoixFog9IOE9Ve9Xcfw6
239
239
  orionis/foundation/providers/testing_provider.py,sha256=SrJRpdvcblx9WvX7x9Y3zc7OQfiTf7la0HAJrm2ESlE,3725
240
240
  orionis/foundation/providers/workers_provider.py,sha256=oa_2NIDH6UxZrtuGkkoo_zEoNIMGgJ46vg5CCgAm7wI,3926
241
241
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
242
- orionis/metadata/framework.py,sha256=T9E1Nd--YQAJFtBds5mLsFfoO3LszEvmMMgKIjG18FE,4109
242
+ orionis/metadata/framework.py,sha256=fWyRaPJyekqoEqSgvF_l6V8UQHuzMrGvl4w-oq2YRE8,4109
243
243
  orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
244
244
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
245
245
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -415,7 +415,7 @@ orionis/test/validators/web_report.py,sha256=n9BfzOZz6aEiNTypXcwuWbFRG0OdHNSmCNu
415
415
  orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnIfJYgc,1206
416
416
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
417
417
  orionis/test/view/render.py,sha256=f-zNhtKSg9R5Njqujbg2l2amAs2-mRVESneLIkWOZjU,4082
418
- orionis-0.514.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
418
+ orionis-0.516.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
419
419
  tests/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
420
420
  tests/container/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
421
421
  tests/container/context/test_manager.py,sha256=wOwXpl9rHNfTTexa9GBKYMwK0_-KSQPbI-AEyGNkmAE,1356
@@ -561,8 +561,8 @@ tests/testing/validators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
561
561
  tests/testing/validators/test_testing_validators.py,sha256=WPo5GxTP6xE-Dw3X1vZoqOMpb6HhokjNSbgDsDRDvy4,16588
562
562
  tests/testing/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
563
563
  tests/testing/view/test_render.py,sha256=tnnMBwS0iKUIbogLvu-7Rii50G6Koddp3XT4wgdFEYM,1050
564
- orionis-0.514.0.dist-info/METADATA,sha256=FWl6moQ7oRWBd-ukjEyZHZcaEEUQaUlz28DopfyCS58,4801
565
- orionis-0.514.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
566
- orionis-0.514.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
567
- orionis-0.514.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
568
- orionis-0.514.0.dist-info/RECORD,,
564
+ orionis-0.516.0.dist-info/METADATA,sha256=8Vw84gKCm7mpEULZ7PuEbIi0aOz8Mlq9LrtsAgf-d4k,4801
565
+ orionis-0.516.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
566
+ orionis-0.516.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
567
+ orionis-0.516.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
568
+ orionis-0.516.0.dist-info/RECORD,,