File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ class Trepan:
6363 Class for a top-level object.
6464 """
6565
66- def __init__ (self , opts = None ):
66+ def __init__ (self , opts = dict () ):
6767 """Create a debugger object. But depending on the value of
6868 key 'start' inside hash 'opts', we may or may not initially
6969 start debugging.
Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
2- # Copyright (C) 2013, 2020, 2023 Rocky Bernstein <rocky@gnu.org>
2+ # Copyright (C) 2013, 2020, 2023-2024 Rocky Bernstein <rocky@gnu.org>
33#
44# This program is free software: you can redistribute it and/or modify
55# it under the terms of the GNU General Public License as published by
1313#
1414# You should have received a copy of the GNU General Public License
1515# along with this program. If not, see <http://www.gnu.org/licenses/>.
16- """Command completion routines."""
16+
17+ # FIXME: add correspoding prompt_toolkit completion routines
18+ """Command completion routines. GNU Readline/libedit only for now..."""
1719
1820import re
1921
Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
2- # Copyright (C) 2015 Rocky Bernstein <rocky@gnu.org>
2+ # Copyright (C) 2015, 2024 Rocky Bernstein <rocky@gnu.org>
33#
44# This program is free software: you can redistribute it and/or modify
55# it under the terms of the GNU General Public License as published by
1616
1717# Our local modules
1818from trepan .processor .command import base_subcmd as Mbase_subcmd
19- from trepan .lib import complete as Mcomplete
19+ from trepan .lib . complete import complete_token
2020
2121
2222class InfoBuiltins (Mbase_subcmd .DebuggerSubcommand ):
@@ -31,7 +31,7 @@ class InfoBuiltins(Mbase_subcmd.DebuggerSubcommand):
3131
3232 def complete (self , prefix ):
3333 completions = sorted (["*" ] + self .proc .curframe .f_builtins .keys ())
34- return Mcomplete . complete_token (completions , prefix )
34+ return complete_token (completions , prefix )
3535
3636 def run (self , args ):
3737 if not self .proc .curframe :
Original file line number Diff line number Diff line change 1414# You should have received a copy of the GNU General Public License
1515# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17- from trepan .lib import complete as Mcomplete
17+ from trepan .lib . complete import complete_token
1818from trepan .processor import frame as Mframe
1919
2020# Our local modules
@@ -54,7 +54,8 @@ def complete(self, prefix):
5454 low , high = Mframe .frame_low_high (proc_obj , None )
5555 ary = [str (low + i ) for i in range (high - low + 1 )]
5656 # FIXME: add in Thread names
57- return Mcomplete .complete_token (ary , prefix )
57+ return complete_token (ary , prefix )
58+
5859
5960 def run (self , args ):
6061 proc = self .proc
Original file line number Diff line number Diff line change 2222import pyficache
2323
2424from trepan import misc as Mmisc
25- from trepan .lib import complete as Mcomplete
25+ from trepan .lib . complete import complete_token
2626from trepan .lib .file import file_list
2727
2828# Our local modules
@@ -34,9 +34,11 @@ class InfoFiles(DebuggerSubcommand):
3434 need_stack = False
3535 short_help = "Show information about an imported or loaded Python file"
3636
37+
3738 def complete (self , prefix ):
3839 completions = sorted (["." ] + file_list ())
39- return Mcomplete .complete_token (completions , prefix )
40+ return complete_token (completions , prefix )
41+
4042
4143 def run (self , args ):
4244 """**info files** [*filename* [**all** | **brkpts** | **sha1** | **size**]]
Original file line number Diff line number Diff line change 2222# Our local modules
2323from trepan .processor .command import base_subcmd as Mbase_subcmd
2424from trepan .lib import pp as Mpp
25- from trepan .lib import complete as Mcomplete
25+ from trepan .lib . complete import complete_token
2626
2727# when the "with" statement is used, there
2828# can be get variables having names
@@ -53,7 +53,7 @@ class InfoLocals(Mbase_subcmd.DebuggerSubcommand):
5353
5454 def complete (self , prefix ):
5555 completions = sorted (["*" ] + self .proc .curframe .f_locals .keys ())
56- return Mcomplete . complete_token (completions , prefix )
56+ return complete_token (completions , prefix )
5757
5858 def run (self , args ):
5959 if not self .proc .curframe :
Original file line number Diff line number Diff line change 1818
1919# Our local modules
2020from trepan .processor .command import base_subcmd as Mbase_subcmd
21- from trepan .lib import complete as Mcomplete
21+ from trepan .lib . complete import complete_token
2222
2323
2424class InfoMacro (Mbase_subcmd .DebuggerSubcommand ):
@@ -39,7 +39,8 @@ class InfoMacro(Mbase_subcmd.DebuggerSubcommand):
3939
4040 def complete (self , prefix ):
4141 m = sorted (list (self .proc .macros .keys ()) + ["*" ])
42- return Mcomplete .complete_token (m , prefix )
42+ return complete_token (m , prefix )
43+
4344
4445 def run (self , args ):
4546 if len (args ) > 0 :
Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
2- # Copyright (C) 2009, 2015, 2023 Rocky Bernstein <rocky@gnu.org>
2+ # Copyright (C) 2009, 2015, 2023-2024 Rocky Bernstein <rocky@gnu.org>
33#
44# This program is free software: you can redistribute it and/or modify
55# it under the terms of the GNU General Public License as published by
1616
1717# Our local modules
1818from trepan .processor .command import base_subcmd as Mbase_subcmd
19- from trepan .lib import complete as Mcomplete
19+ from trepan .lib . complete import complete_token
2020
2121
2222class InfoSignals (Mbase_subcmd .DebuggerSubcommand ):
@@ -45,7 +45,8 @@ class InfoSignals(Mbase_subcmd.DebuggerSubcommand):
4545
4646 def complete (self , prefix ):
4747 completions = sorted (["*" ] + self .debugger .sigmgr .siglist )
48- return Mcomplete .complete_token (completions , prefix )
48+ return complete_token (completions , prefix )
49+
4950
5051 def run (self , args ):
5152 if len (args ) > 0 and args [0 ] == "*" :
Original file line number Diff line number Diff line change 1212#
1313# You should have received a copy of the GNU General Public License
1414# along with this program. If not, see <http://www.gnu.org/licenses/>.
15-
1615from trepan .lib .complete import complete_token
1716
1817# Our local modules
Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
2- # Copyright (C) 2013-2015, 2020 Rocky Bernstein <rocky@gnu.org>
2+ # Copyright (C) 2013-2015, 2020, 2024 Rocky Bernstein <rocky@gnu.org>
33#
44# This program is free software: you can redistribute it and/or modify
55# it under the terms of the GNU General Public License as published by
1313#
1414# You should have received a copy of the GNU General Public License
1515# along with this program. If not, see <http://www.gnu.org/licenses/>.
16- "CommandProcessor completion routines"
16+ "CommandProcessor GNU-readline/libedit completion routines"
1717import pyficache
1818
1919import trepan .lib .complete as Mcomplete
20-
21-
2220def complete_token_filtered (aliases , prefix , expanded ):
2321
2422 """Find all starting matches in dictionary *aliases* that start
You can’t perform that action at this time.
0 commit comments