orionis 0.368.0__py3-none-any.whl → 0.370.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/base/__init__.py +0 -0
- orionis/console/base/command.py +85 -0
- orionis/foundation/application.py +11 -2
- orionis/metadata/framework.py +1 -1
- {orionis-0.368.0.dist-info → orionis-0.370.0.dist-info}/METADATA +1 -1
- {orionis-0.368.0.dist-info → orionis-0.370.0.dist-info}/RECORD +10 -8
- {orionis-0.368.0.dist-info → orionis-0.370.0.dist-info}/WHEEL +0 -0
- {orionis-0.368.0.dist-info → orionis-0.370.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.368.0.dist-info → orionis-0.370.0.dist-info}/top_level.txt +0 -0
- {orionis-0.368.0.dist-info → orionis-0.370.0.dist-info}/zip-safe +0 -0
|
File without changes
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
from orionis.console.dynamic.progress_bar import ProgressBar
|
|
3
|
+
from orionis.console.output.console import Console
|
|
4
|
+
|
|
5
|
+
class BaseCommand(Console, ProgressBar):
|
|
6
|
+
"""
|
|
7
|
+
Base abstract class for implementing console commands in the Orionis framework.
|
|
8
|
+
|
|
9
|
+
This class provides a foundation for creating command-line interface commands by
|
|
10
|
+
combining console output capabilities and progress bar functionality. It serves
|
|
11
|
+
as an abstract base that enforces the implementation of command-specific logic
|
|
12
|
+
while providing common argument handling functionality.
|
|
13
|
+
|
|
14
|
+
The class inherits from both Console and ProgressBar, providing access to:
|
|
15
|
+
- Console output methods for displaying messages, errors, and formatted text
|
|
16
|
+
- Progress bar functionality for long-running operations
|
|
17
|
+
- Argument parsing and management capabilities
|
|
18
|
+
|
|
19
|
+
Attributes
|
|
20
|
+
----------
|
|
21
|
+
args : dict
|
|
22
|
+
Dictionary containing the parsed command-line arguments passed to the command.
|
|
23
|
+
This is populated by calling the `setArgs` method with either an
|
|
24
|
+
`argparse.Namespace` object or a dictionary.
|
|
25
|
+
|
|
26
|
+
Methods
|
|
27
|
+
-------
|
|
28
|
+
handle()
|
|
29
|
+
Abstract method that must be implemented by subclasses to define the
|
|
30
|
+
command's execution logic.
|
|
31
|
+
setArgs(args)
|
|
32
|
+
Sets the command arguments from either an argparse.Namespace or dict.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
args = {}
|
|
36
|
+
|
|
37
|
+
def handle(self):
|
|
38
|
+
"""
|
|
39
|
+
Execute the command's main logic.
|
|
40
|
+
|
|
41
|
+
This abstract method defines the entry point for command execution and must
|
|
42
|
+
be overridden in all subclasses. It contains the core functionality that
|
|
43
|
+
the command should perform when invoked.
|
|
44
|
+
|
|
45
|
+
The method has access to:
|
|
46
|
+
- `self.args`: Dictionary of parsed command-line arguments
|
|
47
|
+
- Console output methods inherited from Console class
|
|
48
|
+
- Progress bar methods inherited from ProgressBar class
|
|
49
|
+
|
|
50
|
+
Raises
|
|
51
|
+
------
|
|
52
|
+
NotImplementedError
|
|
53
|
+
Always raised when called on the base class, as this method must be
|
|
54
|
+
implemented by concrete subclasses to define command-specific behavior.
|
|
55
|
+
"""
|
|
56
|
+
raise NotImplementedError("The 'handle' method must be implemented in the child class.")
|
|
57
|
+
|
|
58
|
+
def setArgs(self, args) -> None:
|
|
59
|
+
"""
|
|
60
|
+
Set command arguments from parsed command-line input.
|
|
61
|
+
|
|
62
|
+
This method accepts command arguments in multiple formats and normalizes
|
|
63
|
+
them into a dictionary format stored in `self.args`. It provides
|
|
64
|
+
flexibility in how arguments are passed to the command while ensuring
|
|
65
|
+
consistent internal representation.
|
|
66
|
+
|
|
67
|
+
Parameters
|
|
68
|
+
----------
|
|
69
|
+
args : argparse.Namespace or dict
|
|
70
|
+
The command arguments to be set. Can be either:
|
|
71
|
+
- argparse.Namespace: Result of argparse.ArgumentParser.parse_args()
|
|
72
|
+
- dict: Dictionary containing argument name-value pairs
|
|
73
|
+
|
|
74
|
+
Raises
|
|
75
|
+
------
|
|
76
|
+
ValueError
|
|
77
|
+
If `args` is neither an argparse.Namespace nor a dict, indicating
|
|
78
|
+
an unsupported argument type was passed.
|
|
79
|
+
"""
|
|
80
|
+
if isinstance(args, argparse.Namespace):
|
|
81
|
+
self.args = vars(args)
|
|
82
|
+
elif isinstance(args, dict):
|
|
83
|
+
self.args = args
|
|
84
|
+
else:
|
|
85
|
+
raise ValueError("Invalid argument type. Expected 'argparse.Namespace' or 'dict'.")
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from typing import Type, List
|
|
2
2
|
from orionis.container.container import Container
|
|
3
3
|
from orionis.container.contracts.service_provider import IServiceProvider
|
|
4
|
-
from orionis.foundation.providers.dumper_provider import DebugProvider
|
|
5
4
|
|
|
6
5
|
class App(Container):
|
|
7
6
|
"""
|
|
@@ -98,8 +97,18 @@ class App(Container):
|
|
|
98
97
|
This method should register core services required by the framework
|
|
99
98
|
before user-defined providers are loaded.
|
|
100
99
|
"""
|
|
100
|
+
from orionis.foundation.providers.console_provider import ConsoleProvider
|
|
101
|
+
from orionis.foundation.providers.dumper_provider import DumperProvider
|
|
102
|
+
from orionis.foundation.providers.path_resolver_provider import PathResolverProvider
|
|
103
|
+
from orionis.foundation.providers.progress_bar_provider import ProgressBarProvider
|
|
104
|
+
from orionis.foundation.providers.workers_provider import WorkersProvider
|
|
105
|
+
|
|
101
106
|
core_providers = [
|
|
102
|
-
|
|
107
|
+
ConsoleProvider,
|
|
108
|
+
DumperProvider,
|
|
109
|
+
PathResolverProvider,
|
|
110
|
+
ProgressBarProvider,
|
|
111
|
+
WorkersProvider
|
|
103
112
|
]
|
|
104
113
|
|
|
105
114
|
for provider_cls in core_providers:
|
orionis/metadata/framework.py
CHANGED
|
@@ -96,6 +96,8 @@ orionis/_services/commands/scheduler_service.py,sha256=71iH4ZArJ2D9dfbQPSNP_S3g4
|
|
|
96
96
|
orionis/_services/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
97
97
|
orionis/_services/config/config_service.py,sha256=iS5ftGd7VWCpOt9M5_rNNLHsCZaDcI-F8R2r3CCTM8g,2106
|
|
98
98
|
orionis/console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
99
|
+
orionis/console/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
100
|
+
orionis/console/base/command.py,sha256=4VUR8mF_NfoNqULh0o0jA8bvi5MTFqUFOL1bkVpgLeA,3444
|
|
99
101
|
orionis/console/dumper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
100
102
|
orionis/console/dumper/dump.py,sha256=CATERiQ6XuIrKQsDaWcVxzTtlAJI9qLJX44fQxEX8ws,22443
|
|
101
103
|
orionis/console/dumper/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -145,7 +147,7 @@ orionis/container/validators/is_subclass.py,sha256=4sBaGLoRs8nUhuWjlP0VJqyTwVHYq
|
|
|
145
147
|
orionis/container/validators/is_valid_alias.py,sha256=4uAYcq8xov7jZbXnpKpjNkxcZtlTNnL5RRctVPMwJes,1424
|
|
146
148
|
orionis/container/validators/lifetime.py,sha256=IQ43fDNrxYHMlZH2zlYDJnlkLO_eS4U7Fs3UJgQBidI,1844
|
|
147
149
|
orionis/foundation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
148
|
-
orionis/foundation/application.py,sha256=
|
|
150
|
+
orionis/foundation/application.py,sha256=OiBbTI-4cGTEZppVaFxDHadvsb_jRl8aDwJEwlypVLg,4799
|
|
149
151
|
orionis/foundation/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
150
152
|
orionis/foundation/config/startup.py,sha256=zutF-34DkW68bpiTxH9xrmIe1iJdXCF9Y6wueXS6qys,8265
|
|
151
153
|
orionis/foundation/config/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -245,7 +247,7 @@ orionis/foundation/providers/path_resolver_provider.py,sha256=rXvaVc5sSqmDgRzWJo
|
|
|
245
247
|
orionis/foundation/providers/progress_bar_provider.py,sha256=75Jr4iEgUOUGl8Di1DioeP5_HRQlR-1lVzPmS96sWjA,737
|
|
246
248
|
orionis/foundation/providers/workers_provider.py,sha256=WWlji3C69_-Y0c42aZDbR_bmcE_qZEh2SaA_cNkCivI,702
|
|
247
249
|
orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
248
|
-
orionis/metadata/framework.py,sha256=
|
|
250
|
+
orionis/metadata/framework.py,sha256=uWb-E59Z6jG1FTYOZfjfo1edZBIuB7aSMG_xOytZZlk,4960
|
|
249
251
|
orionis/metadata/package.py,sha256=tqLfBRo-w1j_GN4xvzUNFyweWYFS-qhSgAEc-AmCH1M,5452
|
|
250
252
|
orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
251
253
|
orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -377,7 +379,7 @@ orionis/test/output/dumper.py,sha256=3EV-G3KgEV4O0M4yl-4klPKc1etWOPZvPAcYhUQyXnI
|
|
|
377
379
|
orionis/test/output/printer.py,sha256=WGjGW2lgu_l5wWJ6Z8qTTV7NAObhoTBcvhM1TcNvwU4,16938
|
|
378
380
|
orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
379
381
|
orionis/test/view/render.py,sha256=jXZkbITBknbUwm_mD8bcTiwLDvsFkrO9qrf0ZgPwqxc,4903
|
|
380
|
-
orionis-0.
|
|
382
|
+
orionis-0.370.0.dist-info/licenses/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
|
|
381
383
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
382
384
|
tests/example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
383
385
|
tests/example/test_example.py,sha256=kvWgiW3ADEZf718dGsMPtDh_rmOSx1ypEInKm7_6ZPQ,601
|
|
@@ -478,8 +480,8 @@ tests/support/wrapper/test_services_wrapper_docdict.py,sha256=hIVqGt19vbW22xPjQS
|
|
|
478
480
|
tests/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
479
481
|
tests/testing/test_testing_result.py,sha256=1O_8xjsFPnzwZOpLT6ImqjO9HY5_jIgP7DTVBsgHvQA,4335
|
|
480
482
|
tests/testing/test_testing_unit.py,sha256=S3anwYcF2DBWYh_UfqKcZq2FgNpQjP0SfYVRd5sD5rI,7442
|
|
481
|
-
orionis-0.
|
|
482
|
-
orionis-0.
|
|
483
|
-
orionis-0.
|
|
484
|
-
orionis-0.
|
|
485
|
-
orionis-0.
|
|
483
|
+
orionis-0.370.0.dist-info/METADATA,sha256=ThIPJvF6BMpzcZ7eG6-X8ojdk7l_Ce8Meo7rddmoVlE,4772
|
|
484
|
+
orionis-0.370.0.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
|
485
|
+
orionis-0.370.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
|
|
486
|
+
orionis-0.370.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
487
|
+
orionis-0.370.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|