rgwfuncs 0.0.69__tar.gz → 0.0.70__tar.gz
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.
- {rgwfuncs-0.0.69/src/rgwfuncs.egg-info → rgwfuncs-0.0.70}/PKG-INFO +1 -1
- {rgwfuncs-0.0.69 → rgwfuncs-0.0.70}/pyproject.toml +1 -1
- {rgwfuncs-0.0.69 → rgwfuncs-0.0.70}/setup.cfg +1 -1
- {rgwfuncs-0.0.69 → rgwfuncs-0.0.70}/src/rgwfuncs/interactive_shell_lib.py +7 -7
- {rgwfuncs-0.0.69 → rgwfuncs-0.0.70/src/rgwfuncs.egg-info}/PKG-INFO +1 -1
- {rgwfuncs-0.0.69 → rgwfuncs-0.0.70}/LICENSE +0 -0
- {rgwfuncs-0.0.69 → rgwfuncs-0.0.70}/README.md +0 -0
- {rgwfuncs-0.0.69 → rgwfuncs-0.0.70}/src/rgwfuncs/__init__.py +0 -0
- {rgwfuncs-0.0.69 → rgwfuncs-0.0.70}/src/rgwfuncs/algebra_lib.py +0 -0
- {rgwfuncs-0.0.69 → rgwfuncs-0.0.70}/src/rgwfuncs/df_lib.py +0 -0
- {rgwfuncs-0.0.69 → rgwfuncs-0.0.70}/src/rgwfuncs/docs_lib.py +0 -0
- {rgwfuncs-0.0.69 → rgwfuncs-0.0.70}/src/rgwfuncs/str_lib.py +0 -0
- {rgwfuncs-0.0.69 → rgwfuncs-0.0.70}/src/rgwfuncs.egg-info/SOURCES.txt +0 -0
- {rgwfuncs-0.0.69 → rgwfuncs-0.0.70}/src/rgwfuncs.egg-info/dependency_links.txt +0 -0
- {rgwfuncs-0.0.69 → rgwfuncs-0.0.70}/src/rgwfuncs.egg-info/entry_points.txt +0 -0
- {rgwfuncs-0.0.69 → rgwfuncs-0.0.70}/src/rgwfuncs.egg-info/requires.txt +0 -0
- {rgwfuncs-0.0.69 → rgwfuncs-0.0.70}/src/rgwfuncs.egg-info/top_level.txt +0 -0
@@ -11,7 +11,6 @@ from .algebra_lib import * # noqa: F401, F403, E402
|
|
11
11
|
from .str_lib import * # noqa: F401, F403, E402
|
12
12
|
from .docs_lib import * # noqa: F401, F403, E402
|
13
13
|
|
14
|
-
|
15
14
|
def interactive_shell(local_vars: Dict[str, Any], shell_color: str = '\033[37m') -> None:
|
16
15
|
"""
|
17
16
|
Launches an interactive prompt for inspecting and modifying local variables, making all methods
|
@@ -34,13 +33,12 @@ def interactive_shell(local_vars: Dict[str, Any], shell_color: str = '\033[37m')
|
|
34
33
|
print(f"{shell_color}Warning: Could not load history file: {e}\033[0m")
|
35
34
|
atexit.register(readline.write_history_file, HISTORY_FILE)
|
36
35
|
|
37
|
-
|
38
36
|
def colorize_output(text: str, shell_color: str) -> str:
|
39
|
-
"""Apply shell color to text if it doesn’t already contain ANSI codes."""
|
40
|
-
if
|
37
|
+
"""Apply shell color to text only if it doesn’t already contain ANSI codes, preserving existing codes."""
|
38
|
+
# Check if the text contains any ANSI escape sequences
|
39
|
+
if '\033[' not in text and '\x1b[' not in text:
|
41
40
|
return f"{shell_color}{text}\033[0m"
|
42
|
-
return text
|
43
|
-
|
41
|
+
return text # Return unchanged if it already has ANSI codes
|
44
42
|
|
45
43
|
if not isinstance(local_vars, dict):
|
46
44
|
raise TypeError("local_vars must be a dictionary")
|
@@ -63,7 +61,9 @@ def interactive_shell(local_vars: Dict[str, Any], shell_color: str = '\033[37m')
|
|
63
61
|
|
64
62
|
# Define a pure function to wrap stdout.write
|
65
63
|
def colored_write(text: str) -> None:
|
66
|
-
|
64
|
+
# Pass text through colorize_output to handle coloring
|
65
|
+
colored_text = colorize_output(text, shell_color)
|
66
|
+
original_write(colored_text)
|
67
67
|
|
68
68
|
# Temporarily replace stdout.write
|
69
69
|
sys.stdout.write = colored_write
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|