11# -*- coding: utf-8 -*-
2- # Copyright (C) 2009, 2013, 2015, 2017 Rocky Bernstein
2+ # Copyright (C) 2009, 2013, 2015, 2017, 2020 Rocky Bernstein
33#
4- # This program is free software; you can redistribute it and/or modify
5- # it under the terms of the GNU General Public License as published by
6- # the Free Software Foundation; either version 2 of the License, or
7- # (at your option) any later version.
4+ # This program is free software: you can redistribute it and/or modify
5+ # it under the terms of the GNU General Public License as published by
6+ # the Free Software Foundation, either version 3 of the License, or
7+ # (at your option) any later version.
88#
9- # This program is distributed in the hope that it will be useful,
10- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12- # GNU General Public License for more details.
9+ # This program is distributed in the hope that it will be useful,
10+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+ # GNU General Public License for more details.
1313#
14- # You should have received a copy of the GNU General Public License
15- # along with this program; if not, write to the Free Software
16- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17- # 02110-1301 USA.
18-
19- import os
14+ # You should have received a copy of the GNU General Public License
15+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
2016
2117# Our local modules
22- from trepan .processor .command import base_cmd as Mbase_cmd
23- from trepan .processor import complete as Mcomplete
18+ from trepan .processor .command . base_cmd import DebuggerCommand
19+ from trepan .processor . complete import complete_bpnumber
2420
2521
26- class EnableCommand (Mbase_cmd . DebuggerCommand ):
22+ class EnableCommand (DebuggerCommand ):
2723 """**enable** *bpnumber* [*bpnumber* ...]
2824
2925Enables the breakpoints given as a space separated list of breakpoint
@@ -34,37 +30,36 @@ class EnableCommand(Mbase_cmd.DebuggerCommand):
3430`disable`
3531"""
3632
37- aliases = ('en' ,)
38- category = 'breakpoints'
39- min_args = 0
40- max_args = None
41- name = os .path .basename (__file__ ).split ('.' )[0 ]
42- need_stack = False
43- short_help = 'Enable some breakpoints'
33+ aliases = ("en" ,)
34+ short_help = "Enable some breakpoints"
35+
36+ complete = complete_bpnumber
4437
45- complete = Mcomplete . complete_bpnumber
38+ DebuggerCommand . setup ( locals (), category = "breakpoints" )
4639
4740 def run (self , args ):
4841 if len (args ) == 1 :
4942 self .msg (self .core .bpmgr .en_disable_all_breakpoints (do_enable = True ))
5043 return
51- # if args[1] == 'display':
52- # self.display_enable(args[2:], 0)
53- # return
44+ # if args[1] == 'display':
45+ # self.display_enable(args[2:], 0)
46+ # return
5447 for i in args [1 :]:
55- success , msg = \
56- self .core .bpmgr .en_disable_breakpoint_by_number (i , do_enable = True )
48+ success , msg = self .core .bpmgr .en_disable_breakpoint_by_number (
49+ i , do_enable = True
50+ )
5751 if not success :
5852 self .errmsg (msg )
5953 else :
60- self .msg (' Breakpoint %s enabled.' % i )
54+ self .msg (" Breakpoint %s enabled." % i )
6155 pass
6256 pass
6357 return
6458
6559
66- if __name__ == '__main__' :
67- from trepan import debugger as Mdebugger
68- d = Mdebugger .Trepan ()
60+ if __name__ == "__main__" :
61+ from trepan .debugger import Trepan
62+
63+ d = Trepan ()
6964 command = EnableCommand (d .core .processor )
7065 pass
0 commit comments