rgwfuncs 0.0.77__py3-none-any.whl → 0.0.78__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.
- rgwfuncs/interactive_shell_lib.py +11 -10
- {rgwfuncs-0.0.77.dist-info → rgwfuncs-0.0.78.dist-info}/METADATA +1 -1
- {rgwfuncs-0.0.77.dist-info → rgwfuncs-0.0.78.dist-info}/RECORD +7 -7
- {rgwfuncs-0.0.77.dist-info → rgwfuncs-0.0.78.dist-info}/LICENSE +0 -0
- {rgwfuncs-0.0.77.dist-info → rgwfuncs-0.0.78.dist-info}/WHEEL +0 -0
- {rgwfuncs-0.0.77.dist-info → rgwfuncs-0.0.78.dist-info}/entry_points.txt +0 -0
- {rgwfuncs-0.0.77.dist-info → rgwfuncs-0.0.78.dist-info}/top_level.txt +0 -0
@@ -1,24 +1,21 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
import code
|
3
|
-
import readline
|
4
|
-
import rlcompleter # noqa: F401
|
5
|
-
import sys
|
6
1
|
import os
|
7
2
|
import atexit
|
3
|
+
import code
|
4
|
+
import readline # Assuming this is imported elsewhere in your module
|
8
5
|
from typing import Dict, Any
|
9
6
|
from .df_lib import * # noqa: F401, F403, E402
|
10
7
|
from .algebra_lib import * # noqa: F401, F403, E402
|
11
8
|
from .str_lib import * # noqa: F401, F403, E402
|
12
9
|
from .docs_lib import * # noqa: F401, F403, E402
|
13
10
|
|
14
|
-
def interactive_shell(local_vars: Dict[str, Any], shell_color: str = '\033[
|
11
|
+
def interactive_shell(local_vars: Dict[str, Any], shell_color: str = '\033[97m') -> None:
|
15
12
|
"""
|
16
13
|
Launches an interactive prompt for inspecting and modifying local variables, making all methods
|
17
14
|
in the rgwfuncs library available by default. Persists command history across sessions.
|
18
15
|
|
19
16
|
Parameters:
|
20
17
|
local_vars (dict): Dictionary of local variables to be available in the interactive shell.
|
21
|
-
shell_color (str): ANSI color code for shell output (default:
|
18
|
+
shell_color (str): ANSI color code for shell output (default: bright white '\033[97m').
|
22
19
|
"""
|
23
20
|
|
24
21
|
def setup_readline(shell_color: str = '\033[97m') -> None:
|
@@ -30,7 +27,7 @@ def interactive_shell(local_vars: Dict[str, Any], shell_color: str = '\033[94m')
|
|
30
27
|
try:
|
31
28
|
readline.read_history_file(HISTORY_FILE)
|
32
29
|
except Exception as e:
|
33
|
-
print(f"{shell_color}Warning: Could not load history file: {e}\033[
|
30
|
+
print(f"{shell_color}Warning: Could not load history file: {e}\033[0m")
|
34
31
|
atexit.register(readline.write_history_file, HISTORY_FILE)
|
35
32
|
|
36
33
|
if not isinstance(local_vars, dict):
|
@@ -45,9 +42,13 @@ def interactive_shell(local_vars: Dict[str, Any], shell_color: str = '\033[94m')
|
|
45
42
|
# Create interactive console with local context
|
46
43
|
console = code.InteractiveConsole(locals=local_vars)
|
47
44
|
|
45
|
+
# Set the prompt to white explicitly
|
46
|
+
import sys
|
47
|
+
sys.ps1 = f"\033[97m>>> " # White prompt
|
48
|
+
|
48
49
|
# Start interactive session with a custom banner and exit message
|
49
|
-
banner = f"{shell_color}Welcome to the rgwfuncs interactive shell.\nUse up/down arrows for command history.\nType 'exit()' or Ctrl+D to quit
|
50
|
-
exitmsg = f"{shell_color}Goodbye
|
50
|
+
banner = f"{shell_color}Welcome to the rgwfuncs interactive shell.\nUse up/down arrows for command history.\nType 'exit()' or Ctrl+D to quit.\033[0m"
|
51
|
+
exitmsg = f"{shell_color}Goodbye.\033[0m"
|
51
52
|
|
52
53
|
# Run the interactive session without modifying sys.stdout
|
53
54
|
console.interact(banner=banner, exitmsg=exitmsg)
|
@@ -2,11 +2,11 @@ rgwfuncs/__init__.py,sha256=LSn54Tlyskcb6Wab_wUpPLB6UGMe5LdrB3GU88mDEbU,1712
|
|
2
2
|
rgwfuncs/algebra_lib.py,sha256=rKFITfpWfgdBswnbMUuS41XgndEt-jUVz2ObO_ik7eM,42234
|
3
3
|
rgwfuncs/df_lib.py,sha256=r6T-MwyDq9NAPW1Xf6NzSy7ZFicIKdemR-UKu6TZt5g,71111
|
4
4
|
rgwfuncs/docs_lib.py,sha256=y3wSAOPO3qsA4HZ7xAtW8HimM8w-c8hjcEzMRLJ96ao,1960
|
5
|
-
rgwfuncs/interactive_shell_lib.py,sha256=
|
5
|
+
rgwfuncs/interactive_shell_lib.py,sha256=VkhhFRD2dMof9rk_LzW9qO3hcoN9H7CmXD5SRZx0vO0,2316
|
6
6
|
rgwfuncs/str_lib.py,sha256=rtAdRlnSJIu3JhI-tA_A0wCiPK2m-zn5RoGpBxv_g-4,2228
|
7
|
-
rgwfuncs-0.0.
|
8
|
-
rgwfuncs-0.0.
|
9
|
-
rgwfuncs-0.0.
|
10
|
-
rgwfuncs-0.0.
|
11
|
-
rgwfuncs-0.0.
|
12
|
-
rgwfuncs-0.0.
|
7
|
+
rgwfuncs-0.0.78.dist-info/LICENSE,sha256=jLvt20gcUZYB8UOvyBvyKQ1qhYYhD__qP7ZDx2lPFkU,1062
|
8
|
+
rgwfuncs-0.0.78.dist-info/METADATA,sha256=-AkEFWXGxxs3hSb_-CAPXKoTsYNsvWdLssecL69lPaM,60288
|
9
|
+
rgwfuncs-0.0.78.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
10
|
+
rgwfuncs-0.0.78.dist-info/entry_points.txt,sha256=j-c5IOPIQ0252EaOV6j6STio56sbXl2C4ym_fQ0lXx0,43
|
11
|
+
rgwfuncs-0.0.78.dist-info/top_level.txt,sha256=aGuVIzWsKiV1f2gCb6mynx0zx5ma0B1EwPGFKVEMTi4,9
|
12
|
+
rgwfuncs-0.0.78.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|