orionis 0.465.0__py3-none-any.whl → 0.467.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.
- orionis/console/commands/cache.py +57 -0
- orionis/console/core/reactor.py +3 -1
- orionis/metadata/framework.py +1 -1
- {orionis-0.465.0.dist-info → orionis-0.467.0.dist-info}/METADATA +1 -1
- {orionis-0.465.0.dist-info → orionis-0.467.0.dist-info}/RECORD +9 -8
- {orionis-0.465.0.dist-info → orionis-0.467.0.dist-info}/WHEEL +0 -0
- {orionis-0.465.0.dist-info → orionis-0.467.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.465.0.dist-info → orionis-0.467.0.dist-info}/top_level.txt +0 -0
- {orionis-0.465.0.dist-info → orionis-0.467.0.dist-info}/zip-safe +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import subprocess
|
|
2
|
+
from orionis.console.base.command import BaseCommand
|
|
3
|
+
from orionis.console.exceptions import CLIOrionisRuntimeError
|
|
4
|
+
|
|
5
|
+
class CacheClearCommand(BaseCommand):
|
|
6
|
+
"""
|
|
7
|
+
Command class to display usage information for the Orionis CLI.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
# Indicates whether timestamps will be shown in the command output
|
|
11
|
+
timestamps: bool = True
|
|
12
|
+
|
|
13
|
+
# Command signature and description
|
|
14
|
+
signature: str = "cache:clear"
|
|
15
|
+
|
|
16
|
+
# Command description
|
|
17
|
+
description: str = "Clears the cache for the Orionis application."
|
|
18
|
+
|
|
19
|
+
def handle(self) -> bool:
|
|
20
|
+
"""
|
|
21
|
+
Clears all `.pyc` files and `__pycache__` directories in the current directory using the `pyclean` utility.
|
|
22
|
+
|
|
23
|
+
This method invokes the `pyclean .` command to recursively remove Python bytecode cache files and directories,
|
|
24
|
+
helping to ensure a clean state for the Orionis application. If the command fails or an unexpected error occurs,
|
|
25
|
+
a `CLIOrionisRuntimeError` is raised with the relevant error message.
|
|
26
|
+
|
|
27
|
+
Returns
|
|
28
|
+
-------
|
|
29
|
+
bool
|
|
30
|
+
Returns True if the cache was cleared successfully. Raises an exception otherwise.
|
|
31
|
+
|
|
32
|
+
Raises
|
|
33
|
+
------
|
|
34
|
+
CLIOrionisRuntimeError
|
|
35
|
+
If the cache clearing process fails or an unexpected error occurs.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
try:
|
|
39
|
+
|
|
40
|
+
# Run the 'pyclean .' command to remove .pyc files and __pycache__ directories
|
|
41
|
+
process = subprocess.run(['pyclean', '.'], capture_output=True, text=True)
|
|
42
|
+
if process.returncode != 0:
|
|
43
|
+
|
|
44
|
+
# If the command failed, extract the error message and raise a custom exception
|
|
45
|
+
error_message = process.stderr.strip() or "Unknown error occurred."
|
|
46
|
+
raise CLIOrionisRuntimeError(f"Cache clearing failed: {error_message}")
|
|
47
|
+
|
|
48
|
+
# If the command was successful, print the output
|
|
49
|
+
self.textSuccess(f"Cache cleared successfully.")
|
|
50
|
+
|
|
51
|
+
# If the command was successful, return True
|
|
52
|
+
return True # Cache cleared successfully
|
|
53
|
+
|
|
54
|
+
except Exception as exc:
|
|
55
|
+
|
|
56
|
+
# Catch any unexpected exceptions and raise as a CLIOrionisRuntimeError
|
|
57
|
+
raise CLIOrionisRuntimeError(f"An unexpected error occurred while clearing the cache: {exc}")
|
orionis/console/core/reactor.py
CHANGED
|
@@ -105,6 +105,7 @@ class Reactor(IReactor):
|
|
|
105
105
|
from orionis.console.commands.test import TestCommand
|
|
106
106
|
from orionis.console.commands.publisher import PublisherCommand
|
|
107
107
|
from orionis.console.commands.workflow import WorkFlowGithubCommand
|
|
108
|
+
from orionis.console.commands.cache import CacheClearCommand
|
|
108
109
|
|
|
109
110
|
# List of core command classes to load (extend this list as more core commands are added)
|
|
110
111
|
core_commands = [
|
|
@@ -112,7 +113,8 @@ class Reactor(IReactor):
|
|
|
112
113
|
HelpCommand,
|
|
113
114
|
TestCommand,
|
|
114
115
|
PublisherCommand,
|
|
115
|
-
WorkFlowGithubCommand
|
|
116
|
+
WorkFlowGithubCommand,
|
|
117
|
+
CacheClearCommand
|
|
116
118
|
]
|
|
117
119
|
|
|
118
120
|
# Iterate through the core command classes and register them
|
orionis/metadata/framework.py
CHANGED
|
@@ -11,6 +11,7 @@ orionis/console/base/command.py,sha256=nasVPyKEvuv8sDFEWXhHyBCWAmSLfPPm2XlKaYYt_
|
|
|
11
11
|
orionis/console/base/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
orionis/console/base/contracts/command.py,sha256=vmAJD0yMQ5-AD_s9_xCFEAl64sKk65z7U2E196dALQM,5760
|
|
13
13
|
orionis/console/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
orionis/console/commands/cache.py,sha256=8DsYoRzSBLn0P9qkGVItRbo0R6snWBDBg0_Xa7tmVhs,2322
|
|
14
15
|
orionis/console/commands/help.py,sha256=ooPoenP08ArMAWiL89_oUGD9l1Faen2QjLTG90i4zCQ,3187
|
|
15
16
|
orionis/console/commands/publisher.py,sha256=FUg-EUzK7LLXsla10ZUZro8V0Z5S-KjmsaSdRHSSGbA,21381
|
|
16
17
|
orionis/console/commands/test.py,sha256=mWPB_m_nUrsakCT1N6fcCBYU9mYj1IC39n3ICbQp8SQ,2128
|
|
@@ -21,7 +22,7 @@ orionis/console/contracts/kernel.py,sha256=mh4LlhEYHh3FuGZZQ0GBhD6ZLa5YQvaNj2r01
|
|
|
21
22
|
orionis/console/contracts/reactor.py,sha256=GGhWSNYBE6E_W3HNEi4kjiDwqohsa-nnwJfoC1nJPM8,1998
|
|
22
23
|
orionis/console/contracts/schedule.py,sha256=A7yYPjPmRizDHOR9k4qvY3NuRPrWBmNuQs6ENGXWtBs,70
|
|
23
24
|
orionis/console/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
|
-
orionis/console/core/reactor.py,sha256=
|
|
25
|
+
orionis/console/core/reactor.py,sha256=R5mS6hdNivqBQEUQaBePcMi0HXtN_ifWbb-ZlPIlIKU,23572
|
|
25
26
|
orionis/console/dumper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
27
|
orionis/console/dumper/dump.py,sha256=CATERiQ6XuIrKQsDaWcVxzTtlAJI9qLJX44fQxEX8ws,22443
|
|
27
28
|
orionis/console/dumper/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -189,7 +190,7 @@ orionis/foundation/providers/reactor_provider.py,sha256=P0KQcp4AFKTrD6BStGfCTqhG
|
|
|
189
190
|
orionis/foundation/providers/testing_provider.py,sha256=SrJRpdvcblx9WvX7x9Y3zc7OQfiTf7la0HAJrm2ESlE,3725
|
|
190
191
|
orionis/foundation/providers/workers_provider.py,sha256=oa_2NIDH6UxZrtuGkkoo_zEoNIMGgJ46vg5CCgAm7wI,3926
|
|
191
192
|
orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
192
|
-
orionis/metadata/framework.py,sha256=
|
|
193
|
+
orionis/metadata/framework.py,sha256=tc_Woa9KY_Z5mkcpyRMTouEy2_1YzPIDttwbWKn5vTw,4088
|
|
193
194
|
orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
|
|
194
195
|
orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
195
196
|
orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -355,7 +356,7 @@ orionis/test/validators/web_report.py,sha256=n9BfzOZz6aEiNTypXcwuWbFRG0OdHNSmCNu
|
|
|
355
356
|
orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnIfJYgc,1206
|
|
356
357
|
orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
357
358
|
orionis/test/view/render.py,sha256=f-zNhtKSg9R5Njqujbg2l2amAs2-mRVESneLIkWOZjU,4082
|
|
358
|
-
orionis-0.
|
|
359
|
+
orionis-0.467.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
|
|
359
360
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
360
361
|
tests/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
361
362
|
tests/container/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -498,8 +499,8 @@ tests/testing/validators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
498
499
|
tests/testing/validators/test_testing_validators.py,sha256=WPo5GxTP6xE-Dw3X1vZoqOMpb6HhokjNSbgDsDRDvy4,16588
|
|
499
500
|
tests/testing/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
500
501
|
tests/testing/view/test_render.py,sha256=tnnMBwS0iKUIbogLvu-7Rii50G6Koddp3XT4wgdFEYM,1050
|
|
501
|
-
orionis-0.
|
|
502
|
-
orionis-0.
|
|
503
|
-
orionis-0.
|
|
504
|
-
orionis-0.
|
|
505
|
-
orionis-0.
|
|
502
|
+
orionis-0.467.0.dist-info/METADATA,sha256=4z_uKHB1QJ7ZniTRiaOuQ9tplQqAIQ3P3xTNcQ9ilj8,4772
|
|
503
|
+
orionis-0.467.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
504
|
+
orionis-0.467.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
|
|
505
|
+
orionis-0.467.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
506
|
+
orionis-0.467.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|