Skip to content

Commit bc3cc15

Browse files
committed
Upgrade more modules
1 parent c58a36c commit bc3cc15

File tree

10 files changed

+180
-179
lines changed

10 files changed

+180
-179
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ install:
6464

6565
# Upgrade to the latest version of pip to avoid it displaying warnings
6666
# about it being out of date.
67-
- "pip install --disable-pip-version-check --user --upgrade pip"
67+
- "%CMD_IN_ENV% pip install --disable-pip-version-check --user --upgrade pip"
6868

6969
# Install the build dependencies of the project. If some dependencies contain
7070
# compiled extensions and are not provided as pre-built wheel packages,
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (C) 2008-2009, 2013-2015, 2018, 2020 Rocky Bernstein <rocky@gnu.org>
12
# This program is free software: you can redistribute it and/or modify
23
# it under the terms of the GNU General Public License as published by
34
# the Free Software Foundation, either version 3 of the License, or
@@ -10,25 +11,27 @@
1011
#
1112
# You should have received a copy of the GNU General Public License
1213
# along with this program. If not, see <http://www.gnu.org/licenses/>.
13-
# """ Copyright (C) 2008-2009, 2013-2015, 2018 Rocky Bernstein <rocky@gnu.org> """
1414

1515
import glob, os
16+
import os.path as osp
1617

1718
# FIXME: Is it really helpful to "privatize" variable names below?
1819
# The below names are not part of the standard pre-defined names like
1920
# __name__ or __file__ are.
2021

2122
# Get the name of our directory.
22-
__command_dir__ = os.path.dirname(__file__)
23+
__command_dir__ = osp.dirname(__file__)
2324

2425
# A glob pattern that will get all *.py files but not __init__.py
25-
__py_files__ = glob.glob(os.path.join(__command_dir__, '[a-z]*.py'))
26+
__py_files__ = glob.glob(osp.join(__command_dir__, "[a-z]*.py"))
2627

2728
# Take the basename of the filename and drop off '.py'. That minus the
2829
# files in exclude_files and that becomes the list of modules that
2930
# commands.py will use to import
30-
exclude_files = ['mock.py']
31-
__modules__ = [ os.path.basename(filename[0:-3]) for
32-
filename in __py_files__
33-
if os.path.basename(filename) not in exclude_files]
34-
__all__ = __modules__ + exclude_files
31+
exclude_files = ["mock.py"]
32+
__modules__ = [
33+
osp.basename(filename[0:-3])
34+
for filename in __py_files__
35+
if osp.basename(filename) not in exclude_files
36+
]
37+
__all__ = __modules__ + exclude_files

trepan/processor/command/backtrace.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ def run(self, args):
123123

124124
if __name__ == "__main__":
125125
from trepan.processor import cmdproc
126-
from trepan import debugger
126+
from trepan.debugger import Trepan
127127

128-
d = debugger.Debugger()
128+
d = Trepan()
129129
cp = d.core.processor
130130
command = BacktraceCommand(cp)
131131
command.run(["backtrace", "wrong", "number", "of", "args"])

trepan/processor/command/break.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# Our local modules
1818
from trepan.processor.command.base_cmd import DebuggerCommand
19-
from trepan.processor import cmdbreak as Mcmdbreak
19+
from trepan.processor.cmdbreak import parse_break_cmd, set_break
2020
from trepan.processor.complete import complete_break_linenumber
2121

2222

@@ -73,9 +73,9 @@ class BreakCommand(DebuggerCommand):
7373
def run(self, args):
7474
force = True if args[0][-1] == "!" else False
7575

76-
(func, filename, lineno, condition) = Mcmdbreak.parse_break_cmd(self.proc, args)
76+
(func, filename, lineno, condition) = parse_break_cmd(self.proc, args)
7777
if not (func == None and filename == None):
78-
Mcmdbreak.set_break(
78+
set_break(
7979
self, func, filename, lineno, condition, False, args, force=force
8080
)
8181
return
@@ -85,12 +85,12 @@ def run(self, args):
8585

8686
def doit(cmd, a):
8787
cmd.current_command = " ".join(a)
88-
print(Mcmdbreak.parse_break_cmd(cmd.proc, a))
88+
print(parse_break_cmd(cmd.proc, a))
8989

9090
import sys
91-
from trepan import debugger as Mdebugger
91+
from trepan.debugger import Trepan
9292

93-
d = Mdebugger.Trepan()
93+
d = Trepan()
9494
command = BreakCommand(d.core.processor)
9595
command.proc.frame = sys._getframe()
9696
command.proc.setup()

trepan/processor/command/delete.py

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright (C) 2009, 2013, 2015, 2017 Rocky Bernstein
2+
# Copyright (C) 2009, 2013, 2015, 2017, 2020 Rocky Bernstein
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
@@ -14,14 +14,12 @@
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-
import os
18-
1917
# Our local modules
20-
from trepan.processor.command import base_cmd as Mbase_cmd
21-
from trepan.processor import complete as Mcomplete
18+
from trepan.processor.command.base_cmd import DebuggerCommand
19+
from trepan.processor.complete import complete_bpnumber
2220

2321

24-
class DeleteCommand(Mbase_cmd.DebuggerCommand):
22+
class DeleteCommand(DebuggerCommand):
2523
"""**delete** [*bpnumber* [*bpnumber*...]]
2624
2725
Delete some breakpoints.
@@ -34,20 +32,18 @@ class DeleteCommand(Mbase_cmd.DebuggerCommand):
3432
---------
3533
`clear`
3634
"""
37-
category = 'breakpoints'
38-
aliases = ('delete!',)
39-
min_args = 0
40-
max_args = None
41-
name = os.path.basename(__file__).split('.')[0]
42-
need_stack = False
43-
short_help = 'Delete some breakpoints or auto-display expressions'
4435

45-
complete = Mcomplete.complete_bpnumber
36+
aliases = ("delete!",)
37+
short_help = "Delete some breakpoints or auto-display expressions"
38+
39+
complete = complete_bpnumber
40+
41+
DebuggerCommand.setup(locals(), category="breakpoints")
4642

4743
def run(self, args):
4844
if len(args) <= 1:
49-
if '!' != args[0][-1]:
50-
confirmed = self.confirm('Delete all breakpoints', False)
45+
if "!" != args[0][-1]:
46+
confirmed = self.confirm("Delete all breakpoints", False)
5147
else:
5248
confirmed = True
5349

@@ -56,22 +52,23 @@ def run(self, args):
5652
return
5753

5854
for arg in args[1:]:
59-
i = self.proc.get_int(arg, min_value=1, default=None,
60-
cmdname='delete')
61-
if i is None: continue
55+
i = self.proc.get_int(arg, min_value=1, default=None, cmdname="delete")
56+
if i is None:
57+
continue
6258

6359
success, msg = self.core.bpmgr.delete_breakpoint_by_number(i)
6460
if not success:
6561
self.errmsg(msg)
6662
else:
67-
self.msg('Deleted breakpoint %d' % i)
63+
self.msg("Deleted breakpoint %d" % i)
6864
pass
6965
pass
7066
return
7167

7268

73-
if __name__ == '__main__':
74-
from trepan import debugger as Mdebugger
75-
d = Mdebugger.Trepan()
69+
if __name__ == "__main__":
70+
from trepan.debugger import Trepan
71+
72+
d = Trepan()
7673
command = DeleteCommand(d.core.processor)
7774
pass
Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright (C) 2009, 2013-2015, 2017 Rocky Bernstein
2+
# Copyright (C) 2009, 2013-2015, 2017, 2020 Rocky Bernstein
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
@@ -14,13 +14,12 @@
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-
import os
18-
1917
# Our local modules
20-
from trepan.processor.command import base_cmd as Mbase_cmd
21-
from trepan.processor import complete as Mcomplete
18+
from trepan.processor.command.base_cmd import DebuggerCommand
19+
from trepan.processor.complete import complete_bpnumber
20+
2221

23-
class DisableCommand(Mbase_cmd.DebuggerCommand):
22+
class DisableCommand(DebuggerCommand):
2423
"""**disable** *bpnumber* [*bpnumber* ...]
2524
2625
Disables the breakpoints given as a space separated list of breakpoint
@@ -31,36 +30,35 @@ class DisableCommand(Mbase_cmd.DebuggerCommand):
3130
`enable`
3231
"""
3332

34-
category = 'breakpoints'
35-
min_args = 0
36-
max_args = None
37-
name = os.path.basename(__file__).split('.')[0]
38-
need_stack = False
39-
short_help = 'Disable some breakpoints'
33+
short_help = "Disable some breakpoints"
4034

41-
complete = Mcomplete.complete_bpnumber
35+
complete = complete_bpnumber
36+
37+
DebuggerCommand.setup(locals(), category="breakpoints")
4238

4339
def run(self, args):
4440
if len(args) == 1:
4541
self.msg(self.core.bpmgr.en_disable_all_breakpoints(do_enable=False))
4642
return
47-
# if args[1] == 'display':
48-
# self.display_enable(args[2:], 0)
49-
# return
43+
# if args[1] == 'display':
44+
# self.display_enable(args[2:], 0)
45+
# return
5046
for i in args[1:]:
51-
success, msg = self.core \
52-
.bpmgr.en_disable_breakpoint_by_number(int(i), False)
47+
success, msg = self.core.bpmgr.en_disable_breakpoint_by_number(
48+
int(i), False
49+
)
5350
if not success:
5451
self.errmsg(msg)
5552
else:
56-
self.msg('Breakpoint %s disabled.' % i)
53+
self.msg("Breakpoint %s disabled." % i)
5754
pass
5855
pass
5956
return
6057

6158

62-
if __name__ == '__main__':
63-
from trepan import debugger as Mdebugger
64-
d = Mdebugger.Trepan()
59+
if __name__ == "__main__":
60+
from trepan.debugger import Trepan
61+
62+
d = Trepan()
6563
command = DisableCommand(d.core.processor)
6664
pass

trepan/processor/command/enable.py

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,25 @@
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
2925
Enables 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

Comments
 (0)