orionis 0.459.0__py3-none-any.whl → 0.460.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,4 +1,5 @@
1
1
  from orionis.console.base.command import BaseCommand
2
+ from orionis.console.contracts.reactor import IReactor
2
3
  from orionis.console.exceptions import CLIOrionisRuntimeError
3
4
  from rich.console import Console
4
5
  from rich.panel import Panel
@@ -8,29 +9,75 @@ class HelpCommand(BaseCommand):
8
9
  Command class to display usage information for the Orionis CLI.
9
10
  """
10
11
 
12
+ # Indicates whether timestamps will be shown in the command output
11
13
  timestamps: bool = False
14
+
15
+ # Command signature and description
12
16
  signature: str = "help"
13
- description: str = "Prints help information for the Orionis CLI commands."
14
17
 
15
- def handle(self) -> None:
18
+ # Command description
19
+ description: str = "Displays usage information, examples, and a list of available commands in the Orionis CLI."
20
+
21
+ def handle(self, reactor: IReactor) -> None:
16
22
  """
17
- Executes the command to display usage information for the Orionis CLI.
23
+ Displays usage information and a list of available commands for the Orionis CLI.
24
+
25
+ Parameters
26
+ ----------
27
+ reactor : IReactor
28
+ The reactor instance providing command metadata via the `info()` method.
29
+
30
+ Returns
31
+ -------
32
+ None
33
+ This method does not return any value. It prints help information to the console.
34
+
35
+ Raises
36
+ ------
37
+ CLIOrionisRuntimeError
38
+ If an unexpected error occurs during help information generation or display.
18
39
  """
19
40
  try:
41
+
42
+ # Retrieve the list of available commands from the reactor
43
+ commands = reactor.info() # List of dicts with 'signature' and 'description'
44
+
45
+ # Initialize the rich console for formatted output
20
46
  console = Console()
21
- usage = (
22
- "[bold cyan]Usage:[/]\n"
23
- " orionis <command> [options]\n\n"
24
- "[bold cyan]Available Commands:[/]\n"
25
- " help Show this help message\n"
26
- " run Run the application\n"
27
- " make Generate code scaffolding\n"
28
- " migrate Run database migrations\n"
29
- " ... Other available commands\n\n"
30
- "[bold cyan]Options:[/]\n"
31
- " -h, --help Show this help message and exit\n"
47
+
48
+ # Build the usage and commands help text
49
+ usage = "[bold cyan]Usage:[/]\n python -B <command> <params/flags>\n\n"
50
+ usage += "[bold cyan]Example:[/]\n python -B app:command --flag\n\n"
51
+ usage += "[bold cyan]Available Commands:[/]\n"
52
+
53
+ # Determine the maximum signature length for alignment
54
+ max_sig_len = max((len(cmd['signature']) for cmd in commands), default=0)
55
+
56
+ # Append each command's signature and description to the usage string
57
+ for cmd in commands:
58
+ usage += f" [bold yellow]{cmd['signature']:<{max_sig_len}}[/] {cmd['description']}\n"
59
+
60
+ # Add options section
61
+ usage += (
62
+ "\n[bold cyan]Options:[/]\n"
63
+ " -h, --help Show this help message and exit"
64
+ )
65
+
66
+ # Create a rich panel to display the help information
67
+ panel = Panel(
68
+ usage,
69
+ title="[bold green]Orionis CLI Help[/]",
70
+ expand=False,
71
+ border_style="bright_blue",
72
+ padding=(1, 2)
32
73
  )
33
- panel = Panel(usage, title="[bold green]Orionis CLI Help[/]", expand=False, border_style="bright_blue")
74
+
75
+ # Print the panel to the console
76
+ console.print()
34
77
  console.print(panel)
78
+ console.print()
79
+
35
80
  except Exception as e:
81
+
82
+ # Raise a custom runtime error if any exception occurs
36
83
  raise CLIOrionisRuntimeError(f"An unexpected error occurred: {e}") from e
@@ -24,7 +24,7 @@ class TestCommand(BaseCommand):
24
24
  signature: str = "test"
25
25
 
26
26
  # Command description
27
- description: str = "Prints help information for the Orionis CLI commands."
27
+ description: str = "Executes all automated tests using the configured test kernel for the Orionis application."
28
28
 
29
29
  def handle(self) -> None:
30
30
  """
@@ -25,7 +25,7 @@ class VersionCommand(BaseCommand):
25
25
  signature: str = "version"
26
26
 
27
27
  # Command description
28
- description: str = "Prints the version of the framework in use."
28
+ description: str = "Displays the current Orionis framework version and metadata, including author, Python requirements, documentation, and repository links."
29
29
 
30
30
  def handle(self) -> None:
31
31
  """
@@ -36,4 +36,22 @@ class IReactor(ABC):
36
36
  SystemExit
37
37
  If argument parsing fails due to invalid arguments provided.
38
38
  """
39
+ pass
40
+
41
+ @abstractmethod
42
+ def info(self) -> List[dict]:
43
+ """
44
+ Retrieves a list of all registered commands with their metadata.
45
+
46
+ This method returns a list of dictionaries, each containing information about
47
+ a registered command, including its signature, description, and whether it has
48
+ timestamps enabled. This is useful for introspection and displaying available
49
+ commands to the user.
50
+
51
+ Returns
52
+ -------
53
+ List[dict]
54
+ A list of dictionaries representing the registered commands, where each dictionary
55
+ contains the command's signature, description, and timestamps status.
56
+ """
39
57
  pass
@@ -397,6 +397,33 @@ class Reactor(IReactor):
397
397
  # Return the configured ArgumentParser
398
398
  return arg_parser
399
399
 
400
+ def info(self) -> List[dict]:
401
+ """
402
+ Retrieves a list of all registered commands with their metadata.
403
+
404
+ This method returns a list of dictionaries, each containing information about
405
+ a registered command, including its signature, description, and whether it has
406
+ timestamps enabled. This is useful for introspection and displaying available
407
+ commands to the user.
408
+
409
+ Returns
410
+ -------
411
+ List[dict]
412
+ A list of dictionaries representing the registered commands, where each dictionary
413
+ contains the command's signature, description, and timestamps status.
414
+ """
415
+
416
+ # Prepare a list to hold command information
417
+ commands_info = []
418
+ for command in self.__commands.values():
419
+ commands_info.append({
420
+ "signature": command.get("signature"),
421
+ "description": command.get("description"),
422
+ })
423
+
424
+ # Return the sorted list of command information by signature
425
+ return sorted(commands_info, key=lambda x: x["signature"].lower())
426
+
400
427
  def call(
401
428
  self,
402
429
  signature: str,
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.459.0"
8
+ VERSION = "0.460.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.459.0
3
+ Version: 0.460.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
@@ -11,14 +11,14 @@ 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/help.py,sha256=EGg5FfWnLasi7I7gCTBLyvau6I0gVpc2ewNefyJlHeE,1494
15
- orionis/console/commands/test.py,sha256=TgiK-6s23ZEiSdUekdngmpcmoqZYGcy8F7YoX-afk3Y,2151
16
- orionis/console/commands/version.py,sha256=NhLzMrr022mIY4C4SjX_FfKNDXWfIPyWAqzpx_9Hi2k,3547
14
+ orionis/console/commands/help.py,sha256=q8UlSm1kKspl391oRWmt0DZFJHE1mp358Fv8wyWFcsE,3072
15
+ orionis/console/commands/test.py,sha256=yw5Cvi5YQdnUM3o33HYnphT_rKLIvP3W8ow1xhUY1-4,2188
16
+ orionis/console/commands/version.py,sha256=RhON-KZt8bJfMcFTk3MB9aQgRnG7ZghD4f5gX9z81Ps,3640
17
17
  orionis/console/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  orionis/console/contracts/kernel.py,sha256=mh4LlhEYHh3FuGZZQ0GBhD6ZLa5YQvaNj2r01IIHI5Y,826
19
- orionis/console/contracts/reactor.py,sha256=fT49-794RI-y0ZhDyXf91VQoFdGx6kF1Kg-monJnj7s,1296
19
+ orionis/console/contracts/reactor.py,sha256=GGhWSNYBE6E_W3HNEi4kjiDwqohsa-nnwJfoC1nJPM8,1998
20
20
  orionis/console/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
- orionis/console/core/reactor.py,sha256=0d-2Gp3PGoLQeDZwZemKnRjQaAs0O8O3cb2GZnm8OkA,21708
21
+ orionis/console/core/reactor.py,sha256=XTgQZyi9Z2epYPOlFc05wXaX_69-fL8GEobIN2UkZsE,22825
22
22
  orionis/console/dumper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
23
  orionis/console/dumper/dump.py,sha256=CATERiQ6XuIrKQsDaWcVxzTtlAJI9qLJX44fQxEX8ws,22443
24
24
  orionis/console/dumper/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -184,7 +184,7 @@ orionis/foundation/providers/reactor_provider.py,sha256=P0KQcp4AFKTrD6BStGfCTqhG
184
184
  orionis/foundation/providers/testing_provider.py,sha256=SrJRpdvcblx9WvX7x9Y3zc7OQfiTf7la0HAJrm2ESlE,3725
185
185
  orionis/foundation/providers/workers_provider.py,sha256=oa_2NIDH6UxZrtuGkkoo_zEoNIMGgJ46vg5CCgAm7wI,3926
186
186
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
187
- orionis/metadata/framework.py,sha256=OVAWdZLzd6BJfIxZft1kImeNLy1pIeap9mw2Vmxispw,4088
187
+ orionis/metadata/framework.py,sha256=0PF-xadVQmg1GOQI54wxR7uPM9jc_FB2x0bKKHxOR-w,4088
188
188
  orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
189
189
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
190
190
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -349,7 +349,7 @@ orionis/test/validators/web_report.py,sha256=n9BfzOZz6aEiNTypXcwuWbFRG0OdHNSmCNu
349
349
  orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnIfJYgc,1206
350
350
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
351
351
  orionis/test/view/render.py,sha256=f-zNhtKSg9R5Njqujbg2l2amAs2-mRVESneLIkWOZjU,4082
352
- orionis-0.459.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
352
+ orionis-0.460.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
353
353
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
354
354
  tests/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
355
355
  tests/container/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -492,8 +492,8 @@ tests/testing/validators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
492
492
  tests/testing/validators/test_testing_validators.py,sha256=WPo5GxTP6xE-Dw3X1vZoqOMpb6HhokjNSbgDsDRDvy4,16588
493
493
  tests/testing/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
494
494
  tests/testing/view/test_render.py,sha256=tnnMBwS0iKUIbogLvu-7Rii50G6Koddp3XT4wgdFEYM,1050
495
- orionis-0.459.0.dist-info/METADATA,sha256=DvbDAHKJQSOxDRplgWjNmGwb1Tlt6OoaptuVR1jDP88,4772
496
- orionis-0.459.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
497
- orionis-0.459.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
498
- orionis-0.459.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
499
- orionis-0.459.0.dist-info/RECORD,,
495
+ orionis-0.460.0.dist-info/METADATA,sha256=kMihwp0zpZKD5J9NVo-O4_TBkIozgsQ9R4ksn9-5WnE,4772
496
+ orionis-0.460.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
497
+ orionis-0.460.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
498
+ orionis-0.460.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
499
+ orionis-0.460.0.dist-info/RECORD,,