orionis 0.620.0__py3-none-any.whl → 0.621.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.
@@ -1,5 +1,3 @@
1
- import asyncio
2
- from datetime import datetime
3
1
  from rich.console import Console
4
2
  from rich.panel import Panel
5
3
  from orionis.console.base.command import BaseCommand
@@ -79,29 +77,32 @@ class ScheduleWorkCommand(BaseCommand):
79
77
  # Create an instance of ReflectionInstance
80
78
  rf_scheduler = ReflectionInstance(scheduler)
81
79
 
82
- # If the Scheduler class is not found, raise an error
80
+ # If the Scheduler class does not define the 'tasks' method, raise an error
83
81
  if not rf_scheduler.hasMethod("tasks"):
84
82
  raise CLIOrionisRuntimeError(
85
- "The 'tasks' method is not defined in the Scheduler class."
83
+ "The 'tasks' method was not found in the Scheduler class. "
84
+ "Please ensure your Scheduler class defines a 'tasks(self, schedule: ISchedule)' method "
85
+ "to register scheduled tasks."
86
86
  )
87
87
 
88
88
  # Create an instance of the ISchedule service
89
89
  schedule_service: ISchedule = app.make(ISchedule)
90
90
 
91
91
  # Register scheduled tasks using the Scheduler's tasks method
92
- if asyncio.iscoroutinefunction(scheduler.tasks):
93
- await scheduler.tasks(schedule_service)
94
- else:
95
- scheduler.tasks(schedule_service)
92
+ app.call(scheduler, 'tasks', schedule_service)
96
93
 
97
94
  # Retrieve the list of scheduled jobs/events
98
95
  list_tasks = schedule_service.events()
99
96
 
100
97
  # Display a message if no scheduled jobs are found
101
98
  if not list_tasks:
99
+
100
+ # Print a message indicating no scheduled jobs are found
102
101
  console.line()
103
102
  console.print(Panel("No scheduled jobs found.", border_style="green"))
104
103
  console.line()
104
+
105
+ # Return True indicating the command completed successfully
105
106
  return True
106
107
 
107
108
  # If there are scheduled jobs and the scheduler has an onStarted method
@@ -124,35 +125,6 @@ class ScheduleWorkCommand(BaseCommand):
124
125
  if rf_scheduler.hasMethod("onError"):
125
126
  schedule_service.setListener(ListeningEvent.SCHEDULER_ERROR, scheduler.onError)
126
127
 
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
-
135
-
136
-
137
-
138
- # If the scheduler has FINALIZE_AT and it is not None
139
- if hasattr(scheduler, "FINALIZE_AT") and scheduler.FINALIZE_AT is not None:
140
- if not isinstance(scheduler.FINALIZE_AT, datetime):
141
- raise CLIOrionisRuntimeError("FINALIZE_AT must be a datetime instance.")
142
- schedule_service.shutdownEverythingAt(scheduler.FINALIZE_AT)
143
-
144
- # If the scheduler has RESUME_AT and it is not None
145
- if hasattr(scheduler, "RESUME_AT") and scheduler.RESUME_AT is not None:
146
- if not isinstance(scheduler.RESUME_AT, datetime):
147
- raise CLIOrionisRuntimeError("RESUME_AT must be a datetime instance.")
148
- schedule_service.resumeEverythingAt(scheduler.RESUME_AT)
149
-
150
- # If the scheduler has PAUSE_AT and it is not None
151
- if hasattr(scheduler, "PAUSE_AT") and scheduler.PAUSE_AT is not None:
152
- if not isinstance(scheduler.PAUSE_AT, datetime):
153
- raise CLIOrionisRuntimeError("PAUSE_AT must be a datetime instance.")
154
- schedule_service.pauseEverythingAt(scheduler.PAUSE_AT)
155
-
156
128
  # Start the scheduler worker asynchronously
157
129
  await schedule_service.start()
158
130
 
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.620.0"
8
+ VERSION = "0.621.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.620.0
3
+ Version: 0.621.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
@@ -13,7 +13,7 @@ orionis/console/commands/help.py,sha256=0VQLw_8ghyMIbWH9L6S2I5umwa_rniK1lzDdX0qY
13
13
  orionis/console/commands/make_listener.py,sha256=vuXKOPIw_7MbiGwHGiDjLyd5-OqyBov1LKozsv2itEc,1801
14
14
  orionis/console/commands/publisher.py,sha256=m-4RGDI3gc3-ED7Pl0rASLcoZP694q9jNKq0vRMM9uA,21380
15
15
  orionis/console/commands/scheduler_list.py,sha256=OU9qOjZNZRRElxwpg-E8nVefJToeiWu2E2l8P17NZtI,4759
16
- orionis/console/commands/scheduler_work.py,sha256=yoS1CQG7nU0-GvWG4uZbAPGtYNwM-qV9fESz2PEHPKE,6939
16
+ orionis/console/commands/scheduler_work.py,sha256=YYKqGLI5crJKuyVjCVwO1ZY_ZxlTWFr1eoz0bQUvyXU,5919
17
17
  orionis/console/commands/test.py,sha256=-EmQwFwMBuby3OI9HwqMIwuJzd2CGbWbOqmwrR25sOE,2402
18
18
  orionis/console/commands/version.py,sha256=u2f7SetqEX__ufG6c37Ga-CylT4FGvy6wgld6RPBZGc,3589
19
19
  orionis/console/commands/workflow.py,sha256=NYOmjTSvm2o6AE4h9LSTZMFSYPQreNmEJtronyOxaYk,2451
@@ -216,7 +216,7 @@ orionis/foundation/providers/scheduler_provider.py,sha256=IrPQJwvQVLRm5Qnz0Cxon4
216
216
  orionis/foundation/providers/testing_provider.py,sha256=eI1p2lUlxl25b5Z487O4nmqLE31CTDb4c3Q21xFadkE,1615
217
217
  orionis/foundation/providers/workers_provider.py,sha256=GdHENYV_yGyqmHJHn0DCyWmWId5xWjD48e6Zq2PGCWY,1674
218
218
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
219
- orionis/metadata/framework.py,sha256=dHnA-XjUAX5r_D9IYSd3Z0NMvP0t-lm8qT0ioHe_XQw,4109
219
+ orionis/metadata/framework.py,sha256=lbvbicyGSvxD7hHMZszvxPibTTbu-sMZ5D2ru8djvdU,4109
220
220
  orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
221
221
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
222
222
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -403,8 +403,8 @@ orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnI
403
403
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
404
404
  orionis/test/view/render.py,sha256=R55ykeRs0wDKcdTf4O1YZ8GDHTFmJ0IK6VQkbJkYUvo,5571
405
405
  orionis/test/view/report.stub,sha256=QLqqCdRoENr3ECiritRB3DO_MOjRQvgBh5jxZ3Hs1r0,28189
406
- orionis-0.620.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
407
- orionis-0.620.0.dist-info/METADATA,sha256=KzJ_nQgRLM-Fp9BY-ardlDd20FasYHu5q5ar6iRZiko,4801
408
- orionis-0.620.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
409
- orionis-0.620.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
410
- orionis-0.620.0.dist-info/RECORD,,
406
+ orionis-0.621.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
407
+ orionis-0.621.0.dist-info/METADATA,sha256=G6IePwko5jyIq0Ywu5X5uSepzFGUM_mTQZDvfAbs6E4,4801
408
+ orionis-0.621.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
409
+ orionis-0.621.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
410
+ orionis-0.621.0.dist-info/RECORD,,