rgwfuncs 0.0.81__py3-none-any.whl → 0.0.82__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.
@@ -27,32 +27,34 @@ class BlueStdout:
27
27
 
28
28
  def write(self, s):
29
29
  # If the written text exactly matches one of our prompt strings,
30
- # assume it should be displayed as-is (the prompt will be white).
30
+ # assume it should be displayed as-is.
31
31
  if s == sys.ps1 or s == sys.ps2:
32
32
  self.wrapped.write(s)
33
33
  return
34
34
 
35
- # Process the text line by line so that each new line gets the blue color.
36
- # (We only want to color “output”, not the prompt.)
35
+ # Process text, coloring new lines with blue.
37
36
  lines = s.split('\n')
38
37
  for i, line in enumerate(lines):
39
- # Only prepend blue if we are at a new line.
40
38
  if self.at_line_start and line:
41
39
  self.wrapped.write(BLUE + line)
42
40
  else:
43
41
  self.wrapped.write(line)
44
- # If this is not the last line, then the newline was in the string.
45
42
  if i < len(lines) - 1:
46
- self.wrapped.write('\n' + RESET) # reset after newline
43
+ self.wrapped.write('\n' + RESET)
47
44
  self.at_line_start = True
48
45
  else:
49
- # If the last chunk is non-empty, we are in the middle of a line.
50
46
  self.at_line_start = (line == "")
51
- # Note: Do not flush automatically here.
52
-
47
+
53
48
  def flush(self):
54
49
  self.wrapped.flush()
55
50
 
51
+ def isatty(self):
52
+ return self.wrapped.isatty()
53
+
54
+ def __getattr__(self, attr):
55
+ # Delegate attribute access to the wrapped object.
56
+ return getattr(self.wrapped, attr)
57
+
56
58
  def interactive_shell(local_vars: Dict[str, Any]) -> None:
57
59
  """
58
60
  Launches an interactive prompt for inspecting and modifying local variables,
@@ -77,14 +79,13 @@ def interactive_shell(local_vars: Dict[str, Any]) -> None:
77
79
  if not isinstance(local_vars, dict):
78
80
  raise TypeError("local_vars must be a dictionary")
79
81
 
80
- # Set up readline history and completion
82
+ # Set up readline history and completion.
81
83
  setup_readline()
82
84
 
83
- # Make imported functions available in the REPL
85
+ # Make imported functions available in the REPL.
84
86
  local_vars.update(globals())
85
87
 
86
- # Set up custom prompts.
87
- # The prompt text itself is printed in white.
88
+ # Set up custom prompts (displayed in white).
88
89
  sys.ps1 = WHITE + ">>> " + RESET
89
90
  sys.ps2 = WHITE + "... " + RESET
90
91
 
@@ -94,7 +95,7 @@ def interactive_shell(local_vars: Dict[str, Any]) -> None:
94
95
  # Create an interactive console with the provided locals.
95
96
  console = code.InteractiveConsole(locals=local_vars)
96
97
 
97
- # Custom banner and exit message
98
+ # Custom banner and exit message.
98
99
  banner = ("Welcome to the rgwfuncs interactive shell.\n"
99
100
  "Use up/down arrows for command history.\n"
100
101
  "Type 'exit()' or Ctrl+D to quit.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rgwfuncs
3
- Version: 0.0.81
3
+ Version: 0.0.82
4
4
  Summary: A functional programming paradigm for mathematical modelling and data science
5
5
  Home-page: https://github.com/ryangerardwilson/rgwfunc
6
6
  Author: Ryan Gerard Wilson
@@ -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=0XW9QY88z2_hNOwY49K8KinqSCvCTtuOeryCTysLcEM,3729
5
+ rgwfuncs/interactive_shell_lib.py,sha256=fbZJvN2HmRxNCW-8nfmpLBhVkgJ-TMtrrczKwLIUykI,3492
6
6
  rgwfuncs/str_lib.py,sha256=rtAdRlnSJIu3JhI-tA_A0wCiPK2m-zn5RoGpBxv_g-4,2228
7
- rgwfuncs-0.0.81.dist-info/LICENSE,sha256=jLvt20gcUZYB8UOvyBvyKQ1qhYYhD__qP7ZDx2lPFkU,1062
8
- rgwfuncs-0.0.81.dist-info/METADATA,sha256=avh7CV9-GnXlR1nK0jK1g1akypILcus-vx5UU0hibm8,60288
9
- rgwfuncs-0.0.81.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
10
- rgwfuncs-0.0.81.dist-info/entry_points.txt,sha256=j-c5IOPIQ0252EaOV6j6STio56sbXl2C4ym_fQ0lXx0,43
11
- rgwfuncs-0.0.81.dist-info/top_level.txt,sha256=aGuVIzWsKiV1f2gCb6mynx0zx5ma0B1EwPGFKVEMTi4,9
12
- rgwfuncs-0.0.81.dist-info/RECORD,,
7
+ rgwfuncs-0.0.82.dist-info/LICENSE,sha256=jLvt20gcUZYB8UOvyBvyKQ1qhYYhD__qP7ZDx2lPFkU,1062
8
+ rgwfuncs-0.0.82.dist-info/METADATA,sha256=miNL402pXn_kxoj-XvU1CaVyygcpQnvjcEQ5RiguoG8,60288
9
+ rgwfuncs-0.0.82.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
10
+ rgwfuncs-0.0.82.dist-info/entry_points.txt,sha256=j-c5IOPIQ0252EaOV6j6STio56sbXl2C4ym_fQ0lXx0,43
11
+ rgwfuncs-0.0.82.dist-info/top_level.txt,sha256=aGuVIzWsKiV1f2gCb6mynx0zx5ma0B1EwPGFKVEMTi4,9
12
+ rgwfuncs-0.0.82.dist-info/RECORD,,