diff --git a/mathicsscript/__main__.py b/mathicsscript/__main__.py index 1ba232a..c408cc4 100755 --- a/mathicsscript/__main__.py +++ b/mathicsscript/__main__.py @@ -1,6 +1,17 @@ #!/usr/bin/env python3 # Copyright (C) 2025 Rocky Bernstein -# -*- coding: utf-8 -*- +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import os import os.path as osp diff --git a/mathicsscript/completion.py b/mathicsscript/completion.py index eb9d439..91d0f4f 100644 --- a/mathicsscript/completion.py +++ b/mathicsscript/completion.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2021-2022, 2024 Rocky Bernstein +# Copyright (C) 2021-2022, 2024-2025 Rocky Bernstein # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or @@ -67,6 +67,7 @@ class InterruptCompleter(Completer): COMMANDS = [ "abort", "continue", + "debugger", "exit", "inspect", "show", diff --git a/mathicsscript/interrupt.py b/mathicsscript/interrupt.py index 7193564..2ca38dc 100644 --- a/mathicsscript/interrupt.py +++ b/mathicsscript/interrupt.py @@ -1,3 +1,16 @@ +# Copyright (C) 2025 Rocky Bernstein +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . """ mathicsscript Interrupt routines. @@ -108,6 +121,8 @@ def Mathics3_interrupt_handler( elif user_input in ("continue", "c"): print_fn("continuing") break + elif user_input in ("debugger", "d"): + breakpoint() elif user_input in ("exit", "quit"): print_fn("Mathics3 exited because of an interrupt.") sys.exit(3) @@ -138,6 +153,7 @@ def Mathics3_interrupt_handler( """Your options are: abort (or a) to abort current calculation continue (or c) to continue + debugger (or d) to to enter a Python debugger exit (or quit) to exit Mathics3 inspect (or i) to enter an interactive dialog show (or s) to show current operation (and then continue) diff --git a/mathicsscript/termshell_gnu.py b/mathicsscript/termshell_gnu.py index 8eb9511..ee5e378 100644 --- a/mathicsscript/termshell_gnu.py +++ b/mathicsscript/termshell_gnu.py @@ -120,7 +120,7 @@ def complete_interrupt_command(self, text, state): # Only complete from this fixed set completions = [ w - for w in ["abort", "continue", "exit", "inspect", "show"] + for w in ["abort", "continue", "debugger", "exit", "inspect", "show"] if w.startswith(text) ] try: