From 9628d66b3c319393e04da9ff677fa651a8d97ec4 Mon Sep 17 00:00:00 2001 From: mmatera Date: Thu, 9 Jan 2025 12:59:30 -0300 Subject: [PATCH 1/2] Definitions.get_ownvalue now returns a BaseElement. --- mathicsscript/__main__.py | 4 ++-- mathicsscript/termshell_prompt.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mathicsscript/__main__.py b/mathicsscript/__main__.py index 3f9a834..efd6a85 100755 --- a/mathicsscript/__main__.py +++ b/mathicsscript/__main__.py @@ -162,11 +162,11 @@ def fmt_fun(query: Any) -> Any: full_form = definitions.get_ownvalue( "Settings`$ShowFullFormInput" - ).replace.to_python() + ).to_python() style = definitions.get_ownvalue("Settings`$PygmentsStyle") fmt = identity if style: - style = style.replace.get_string_value() + style = style.get_string_value() if shell.terminal_formatter: fmt = fmt_fun diff --git a/mathicsscript/termshell_prompt.py b/mathicsscript/termshell_prompt.py index 48099f4..b3328b9 100644 --- a/mathicsscript/termshell_prompt.py +++ b/mathicsscript/termshell_prompt.py @@ -167,7 +167,7 @@ def bottom_toolbar(self): if self.definitions.get_ownvalue("Settings`$GroupAutocomplete"): app.group_autocomplete = self.definitions.get_ownvalue( "Settings`$GroupAutocomplete" - ).replace.to_python() + ).to_python() edit_mode = "Vi" if app.editing_mode == EditingMode.VI else "Emacs" return HTML( @@ -224,10 +224,10 @@ def print_result( elif self.terminal_formatter: # pygmentize show_pygments_tokens = self.definitions.get_ownvalue( "Settings`$PygmentsShowTokens" - ).replace.to_python() + ).to_python() pygments_style = self.definitions.get_ownvalue( "Settings`$PygmentsStyle" - ).replace.get_string_value() + ).get_string_value() if pygments_style != self.pygments_style: if not self.change_pygments_style(pygments_style): self.definitions.set_ownvalue( From 18d42fc02c3df2c642fa16f23a414d9dfd59c5f0 Mon Sep 17 00:00:00 2001 From: "R. Bernstein" Date: Thu, 9 Jan 2025 20:20:41 -0500 Subject: [PATCH 2/2] Changes to make --prompt={GNU,none} work again (#89) --- mathicsscript/termshell.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/mathicsscript/termshell.py b/mathicsscript/termshell.py index 6bf8e73..e6cbb1f 100644 --- a/mathicsscript/termshell.py +++ b/mathicsscript/termshell.py @@ -119,17 +119,15 @@ def __init__( self.pygments_style = style self.definitions = definitions - set_settings_value( - self.definitions, "Settings`$PygmentsShowTokens", from_python(False) + self.definitions.set_ownvalue( + "Settings`$PygmentsShowTokens", from_python(False) ) - set_settings_value( - self.definitions, "Settings`$UseUnicode", from_python(use_unicode) - ) - set_settings_value( - self.definitions, - "Settings`PygmentsStylesAvailable", - from_python(ALL_PYGMENTS_STYLES), + self.definitions.set_ownvalue("Settings`$PygmentsStyle", from_python(style)) + self.definitions.set_ownvalue("Settings`$UseUnicode", from_python(use_unicode)) + self.definitions.set_ownvalue( + "Settings`PygmentsStylesAvailable", from_python(ALL_PYGMENTS_STYLES) ) + self.definitions.add_message( "Settings`PygmentsStylesAvailable", Rule(