orionis 0.645.0__py3-none-any.whl → 0.647.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.
@@ -12,7 +12,9 @@ class IDumper(ABC):
12
12
  expand_all: bool = True,
13
13
  max_depth: int | None = None,
14
14
  module_path: str = None,
15
- line_number: int = None
15
+ line_number: int = None,
16
+ redirect_output: int = False,
17
+ insert_line: bool = False
16
18
  ) -> None:
17
19
  """
18
20
  Dump the provided variables to the console and terminate execution.
@@ -39,6 +41,10 @@ class IDumper(ABC):
39
41
  The path of the module from which the method is called (default is None).
40
42
  line_number : int or None, optional
41
43
  The line number in the source code where the method is called (default is None).
44
+ redirect_output : int, optional
45
+ Whether to redirect the output (default is False).
46
+ insert_line : bool, optional
47
+ Whether to insert a separating line before the dump output (default is False).
42
48
 
43
49
  Returns
44
50
  -------
@@ -56,7 +62,9 @@ class IDumper(ABC):
56
62
  expand_all: bool = True,
57
63
  max_depth: int | None = None,
58
64
  module_path: str = None,
59
- line_number: int = None
65
+ line_number: int = None,
66
+ redirect_output: int = False,
67
+ insert_line: bool = False
60
68
  ) -> None:
61
69
  """
62
70
  Dump the provided variables to the console for debugging purposes.
@@ -83,6 +91,10 @@ class IDumper(ABC):
83
91
  The path of the module from which the dump is called (default is None).
84
92
  line_number : int or None, optional
85
93
  The line number in the source code where the dump is called (default is None).
94
+ redirect_output : int, optional
95
+ Whether to redirect the output (default is False).
96
+ insert_line : bool, optional
97
+ Whether to insert a separating line before the dump output (default is False).
86
98
 
87
99
  Returns
88
100
  -------
@@ -35,6 +35,7 @@ class Dumper(IDumper):
35
35
  max_depth: int | None = None,
36
36
  module_path: str = None,
37
37
  line_number: int = None,
38
+ redirect_output: int = False,
38
39
  insert_line: bool = False
39
40
  ) -> None:
40
41
  """
@@ -62,6 +63,8 @@ class Dumper(IDumper):
62
63
  The path of the module from which the method is called (default is None).
63
64
  line_number : int or None, optional
64
65
  The line number in the source code where the method is called (default is None).
66
+ redirect_output : int, optional
67
+ Whether to redirect the output (default is False).
65
68
  insert_line : bool, optional
66
69
  Whether to insert a separating line before the dump output (default is False).
67
70
 
@@ -83,7 +86,7 @@ class Dumper(IDumper):
83
86
  module_path=module_path,
84
87
  line_number=line_number,
85
88
  force_exit=True,
86
- redirect_output=True,
89
+ redirect_output=redirect_output,
87
90
  insert_line=insert_line
88
91
  )
89
92
 
@@ -96,6 +99,7 @@ class Dumper(IDumper):
96
99
  max_depth: int | None = None,
97
100
  module_path: str = None,
98
101
  line_number: int = None,
102
+ redirect_output: int = False,
99
103
  insert_line: bool = False
100
104
  ) -> None:
101
105
  """
@@ -123,6 +127,8 @@ class Dumper(IDumper):
123
127
  The path of the module from which the dump is called (default is None).
124
128
  line_number : int or None, optional
125
129
  The line number in the source code where the dump is called (default is None).
130
+ redirect_output : int, optional
131
+ Whether to redirect the output (default is False).
126
132
  insert_line : bool, optional
127
133
  Whether to insert a separating line before the dump output (default is False).
128
134
 
@@ -144,6 +150,6 @@ class Dumper(IDumper):
144
150
  module_path=module_path,
145
151
  line_number=line_number,
146
152
  force_exit=False,
147
- redirect_output=True,
153
+ redirect_output=redirect_output,
148
154
  insert_line=insert_line
149
155
  )
@@ -615,25 +615,44 @@ class Console(IConsole):
615
615
  print()
616
616
 
617
617
  # Create a custom Rich theme for styling the dump output
618
- custom_theme = Theme({
619
- "dump.index": "bold bright_blue",
620
- "dump.type": "bold green",
621
- "dump.rule": "bright_black",
622
- })
623
- console = RichConsole(theme=custom_theme, record=True)
618
+ console = RichConsole(
619
+ theme=Theme({
620
+ "dump.index": "bold bright_blue",
621
+ "dump.type": "bold green",
622
+ "dump.rule": "bright_black",
623
+ }),
624
+ record=True
625
+ )
624
626
  width = console.size.width
625
627
 
626
- # Retrieve caller frame information for header display
627
- frame = inspect.currentframe()
628
- if not frame or not frame.f_back:
629
- return None
630
- caller = inspect.getframeinfo(frame.f_back)
631
- file_name = os.path.relpath(caller.filename, os.getcwd())
632
- line = line_number or caller.lineno
633
- module = module_path or os.path.splitext(file_name)[0].replace(os.sep, ".")
628
+ # If no module_path or line_number provided, get from caller
629
+ if not module_path or not line_number:
630
+
631
+ # Use inspect to get the caller's frame information
632
+ caller_frame = inspect.currentframe()
633
+
634
+ # If the frame is available, navigate back to the caller's frame
635
+ if caller_frame is not None:
636
+
637
+ # Go back two frames to get the caller of the dump method
638
+ caller_frame = caller_frame.f_back.f_back
639
+
640
+ # If caller_frame is still valid, extract module and line number
641
+ if caller_frame is not None:
642
+
643
+ # If module_path or line_number not provided, get from caller
644
+ if not module_path:
645
+ module_path = caller_frame.f_globals.get("__name__", "unknown")
646
+ if not line_number:
647
+ line_number = caller_frame.f_lineno
648
+ else:
649
+
650
+ #fallback if frame info is unavailable
651
+ module_path = "unknown"
652
+ line_number = '?'
634
653
 
635
654
  # Print header with module and line information
636
- header = f"🐞 [white]Module([/white][bold blue]{module}[/bold blue][white]) [/white][grey70]#{line}[/grey70]"
655
+ header = f"🐞 [white]Module([/white][bold blue]{module_path}[/bold blue][white]) [/white][grey70]#{line_number}[/grey70]"
637
656
  console.print(header)
638
657
 
639
658
  # Iterate over each argument and display it in a styled panel
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.645.0"
8
+ VERSION = "0.647.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -14,9 +14,9 @@ class Dumper(Facade):
14
14
  Returns
15
15
  -------
16
16
  str
17
- The string "x-orionis.console.contracts.debug.IDebug", which is the binding key
17
+ The string "x-orionis.console.contracts.dumper.IDumper", which is the binding key
18
18
  used to identify and resolve the dumper service from the service container.
19
19
  """
20
20
 
21
21
  # Return the unique binding key for the dumper service in the container
22
- return "x-orionis.console.contracts.debug.IDebug"
22
+ return "x-orionis.console.contracts.dumper.IDumper"
@@ -1,6 +1,6 @@
1
- from orionis.console.contracts.dumper import IDebug
1
+ from orionis.console.contracts.dumper import IDumper
2
2
 
3
- class Dumper(IDebug):
3
+ class Dumper(IDumper):
4
4
  """
5
5
  A facade class that implements the IDebug interface for debugging operations.
6
6
 
@@ -1,5 +1,5 @@
1
1
  import sys
2
- from orionis.console.output.console import Console
2
+ from orionis.support.facades.console import Console
3
3
  from orionis.test.contracts.dumper import ITestDumper
4
4
 
5
5
  class TestDumper(ITestDumper):
@@ -127,7 +127,7 @@ class TestDumper(ITestDumper):
127
127
  module, line = self.__tracebackInfo()
128
128
 
129
129
  # Filter out test case instances from the arguments
130
- Console().dump(
130
+ Console.dump(
131
131
  *self.__valuesToDump(args),
132
132
  module_path=module,
133
133
  line_number=line,
@@ -161,7 +161,7 @@ class TestDumper(ITestDumper):
161
161
  module, line = self.__tracebackInfo()
162
162
 
163
163
  # Filter out test case instances from the arguments and output the rest
164
- Console().dump(
164
+ Console.dump(
165
165
  *self.__valuesToDump(args),
166
166
  module_path=module,
167
167
  line_number=line,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orionis
3
- Version: 0.645.0
3
+ Version: 0.647.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
@@ -24,7 +24,7 @@ orionis/console/contracts/base_scheduler.py,sha256=RSxEW57MoMU3pXfliIrQw9WuMk95p
24
24
  orionis/console/contracts/cli_request.py,sha256=qIV8ig8PG39LYp1acnUD8GYsNRSHncxIxGjO3B3YsUo,6755
25
25
  orionis/console/contracts/command.py,sha256=Wvm62hw2gDIPNmoEUFyhKUERjZ6wnAbI-UDY_5gJE24,3626
26
26
  orionis/console/contracts/console.py,sha256=TuoyCLInhp5ztlyJ82rBsw_1Ki3_fOnF_gtaWUxSW1M,14253
27
- orionis/console/contracts/dumper.py,sha256=qJAEVRaKyfLtxPFgO2Thk-nUYrSlNiEzxN0vDag7DwE,3918
27
+ orionis/console/contracts/dumper.py,sha256=h8ScHF31Q3oOdEe5_EyozOD8OGcLvkMG4KkJwa3ANX8,4538
28
28
  orionis/console/contracts/event.py,sha256=KQESAycPzBE3xoDTnbYLz_XXg-7dwrybYKbaJjgkCMY,119842
29
29
  orionis/console/contracts/executor.py,sha256=JAzK64_5HfIGm3_BwsUv7-ZeC2Y-3mpxOByHaXwuy9A,4278
30
30
  orionis/console/contracts/kernel.py,sha256=mh4LlhEYHh3FuGZZQ0GBhD6ZLa5YQvaNj2r01IIHI5Y,826
@@ -35,7 +35,7 @@ orionis/console/contracts/schedule_event_listener.py,sha256=h06qsBxuEMD3KLSyu0JX
35
35
  orionis/console/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
36
  orionis/console/core/reactor.py,sha256=x_bRFLBq5MiKZdlMG1gZR1GCZgFkUDnG5l_nh2YKiR8,44044
37
37
  orionis/console/debug/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
- orionis/console/debug/dumper.py,sha256=4AOo9iNRLdU9VTKrsvraQIKCzOzK5JFMqOjAix-Zrus,6245
38
+ orionis/console/debug/dumper.py,sha256=vbmP_GlrzBj0KDjiQl4iDudPRe6V0W5r5UA8i3h9_c4,6555
39
39
  orionis/console/dynamic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
40
  orionis/console/dynamic/progress_bar.py,sha256=58wne7E_QZb_uN9jjqQ_V28Ci19SVNhCQQ4zzXCiOu0,2872
41
41
  orionis/console/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -58,7 +58,7 @@ orionis/console/fluent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
58
58
  orionis/console/fluent/command.py,sha256=0jyhB45LIjDS7nkjNhkkvEXEzdOBmT49qKIooYY_DbI,8261
59
59
  orionis/console/fluent/event.py,sha256=RM6Aaz-2MYQg4RWxYdr6oBNaAjNVp9DE_tI5iwl2mAk,166672
60
60
  orionis/console/output/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
61
- orionis/console/output/console.py,sha256=5j8Cr67dZWvxBpeJS2cOXR1UpjE-rYKAD0o10olPumM,23463
61
+ orionis/console/output/console.py,sha256=8gxl0gfYyxAKt9rdkMjJU71CdTn84yvzOWbtIF3u0EE,24215
62
62
  orionis/console/output/executor.py,sha256=uQjFPOlyZLFj9pcyYPugCqxwJog0AJgK1OcmQH2ELbw,7314
63
63
  orionis/console/request/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
64
  orionis/console/request/cli_request.py,sha256=lO7088xlVK1VP-NhCIgAo7qXGzCW3nXVOJag43fUv20,13207
@@ -217,7 +217,7 @@ orionis/foundation/providers/scheduler_provider.py,sha256=IrPQJwvQVLRm5Qnz0Cxon4
217
217
  orionis/foundation/providers/testing_provider.py,sha256=eI1p2lUlxl25b5Z487O4nmqLE31CTDb4c3Q21xFadkE,1615
218
218
  orionis/foundation/providers/workers_provider.py,sha256=GdHENYV_yGyqmHJHn0DCyWmWId5xWjD48e6Zq2PGCWY,1674
219
219
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
220
- orionis/metadata/framework.py,sha256=L0N1XstaoGMEV58t5NpJ9fhvVLtM0N_tkYDqkRBzTuo,4089
220
+ orionis/metadata/framework.py,sha256=Y2FHOlAa7q84YeCOkVZmD4uHdEJx5TDeokgqxWvki5w,4089
221
221
  orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
222
222
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
223
223
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -317,8 +317,8 @@ orionis/support/facades/console.py,sha256=s0HBZ3F0KCK6D4W6EZNdDVCikTWXlhrIMQquj_
317
317
  orionis/support/facades/console.pyi,sha256=nWrYF-N5BIHbOSU7lAICb5KKrpzMX0QC7go3e54bLUA,1275
318
318
  orionis/support/facades/directory.py,sha256=85ho4t9APMULBtJ58MPl-rRit9ub48XpYWPzEjLU3_8,946
319
319
  orionis/support/facades/directory.pyi,sha256=3WnIpvLMunTgzR5un49XzAkqOKkOtkrVko34SNJVcAY,592
320
- orionis/support/facades/dumper.py,sha256=oh9L3s-526Lk7l19sRniyCeCzzv-ConqC98FO_oIXsw,900
321
- orionis/support/facades/dumper.pyi,sha256=ELzP_jY2RKHcQtjwjH56H2-P-ro9U-pSUsR_lBxlTZo,509
320
+ orionis/support/facades/dumper.py,sha256=Rv1O8UONZ4qoPNPh4j-9pBaLmnJxt0pardzZpYapXy4,904
321
+ orionis/support/facades/dumper.pyi,sha256=4yQmFu3lPwRqXdSWZ_IP8GyCihrPBKPTqA988PXmQ3Q,511
322
322
  orionis/support/facades/executor.py,sha256=276MKqXsvrW947SvSzEcl8wleAtsjxhVq_r8FcySGH4,1061
323
323
  orionis/support/facades/executor.pyi,sha256=JS0h8ddYD62o79yXL5UzeZmPWOXNasyMgXKL8ZCOkBE,547
324
324
  orionis/support/facades/inspire.py,sha256=oGPMP_mNEmQRbPx7W-TwvW_xwbn4c04rHzu_ivgVKdw,964
@@ -383,7 +383,7 @@ orionis/test/exceptions/persistence.py,sha256=8Oakaey35DpByLoGnfbwHxFKntxgWaGl49
383
383
  orionis/test/exceptions/runtime.py,sha256=h9gQ0pS8tJTmuXNG-GHky8tTqpdz-cNqkntOOlRXZJg,612
384
384
  orionis/test/exceptions/value.py,sha256=CoqYOkViU_RaKCMNpB82tgEsR3XhI1pw6YQ8sH8CJh4,588
385
385
  orionis/test/output/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
386
- orionis/test/output/dumper.py,sha256=x2VbmO1uwAVMrHTTXbxsn1-tMwUviL1zThAgSM8O5Qo,6038
386
+ orionis/test/output/dumper.py,sha256=BZlK3WZsfDiJnQupRSVkcy2linfIxGUycz4zWt3pQ_w,6035
387
387
  orionis/test/output/printer.py,sha256=3nevE9nyhMn0n8UpE-Nwsy4d1l3GE0wnBf4fAGPQxf4,29623
388
388
  orionis/test/records/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
389
389
  orionis/test/records/logs.py,sha256=Dtu5HaWa2meblgTUXVAcOFaxkSJ3YxfDRaFoc_nhMCU,22043
@@ -404,8 +404,8 @@ orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnI
404
404
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
405
405
  orionis/test/view/render.py,sha256=R55ykeRs0wDKcdTf4O1YZ8GDHTFmJ0IK6VQkbJkYUvo,5571
406
406
  orionis/test/view/report.stub,sha256=QLqqCdRoENr3ECiritRB3DO_MOjRQvgBh5jxZ3Hs1r0,28189
407
- orionis-0.645.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
408
- orionis-0.645.0.dist-info/METADATA,sha256=MXLWEwJdR0UwrfF6UR4RLdF8vXKWL6TKhhkJytiSQhc,4772
409
- orionis-0.645.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
410
- orionis-0.645.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
411
- orionis-0.645.0.dist-info/RECORD,,
407
+ orionis-0.647.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
408
+ orionis-0.647.0.dist-info/METADATA,sha256=V01955yQNPUAnQixBrnJVIjCjwXdafI2TwYRFONU3nY,4772
409
+ orionis-0.647.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
410
+ orionis-0.647.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
411
+ orionis-0.647.0.dist-info/RECORD,,