Skip to content

Commit

Permalink
Get ready for release 1.2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed May 27, 2023
1 parent 360f243 commit 4f43a01
Show file tree
Hide file tree
Showing 39 changed files with 116 additions and 84 deletions.
16 changes: 16 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
1.2.9 2023-05-27
================

Commands that are useful in remote envionments and docker:

* Add "set tempdir" to set location of TEMPDIR (useful docker)
* Add "set/show substitute"

Other changes:

* Blacken, and isort, codespell, and lint many files
* ignore ignored signal
* specialize decompiler to decompyle for 3.7 and 3.8
* fix incorrect tagging in install doc and update decompilation info
* Squelch traceback on break in unparsable file

1.2.8 2021-11-05
================

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
|TravisCI| |CircleCI| |Pypi Installs| |license| |Supported Python Versions|
|CircleCI| |Pypi Installs| |license| |Supported Python Versions|

|packagestatus|

Expand Down
8 changes: 4 additions & 4 deletions __pkginfo__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (C) 2013, 2015-2018, 2020-2021 Rocky Bernstein <[email protected]>
# Copyright (C) 2013, 2015-2018, 2020-2021, 2023 Rocky Bernstein
# <[email protected]>
#
# 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
Expand All @@ -21,6 +22,7 @@
# less elegant than having it here with reduced code, albeit there
# still is some room for improvement.

import os.path as osp
import sys

decompiler = "uncompyle6 >= 3.8.0"
Expand All @@ -42,7 +44,7 @@
# 3.4 | pip | 19.1.1 |

# Things that change more often go here.
copyright = """Copyright (C) 2013, 2015-2021 Rocky Bernstein <[email protected]>."""
copyright = """Copyright (C) 2013, 2015-2021, 2023 Rocky Bernstein <[email protected]>."""
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
Expand Down Expand Up @@ -93,8 +95,6 @@
py_modules = []
short_desc = "GDB-like Python Debugger in the Trepan family"

import os.path as osp


def get_srcdir():
filename = osp.normcase(osp.dirname(osp.abspath(__file__)))
Expand Down
1 change: 1 addition & 0 deletions admin-tools/check-newer-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ for version in $PYVERSIONS; do
if ! pyenv local $version ; then
exit $?
fi
python --version
make clean && pip install -e .
if ! make check; then
exit $?
Expand Down
2 changes: 1 addition & 1 deletion admin-tools/pyenv-newer-versions
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ if [[ $0 == ${BASH_SOURCE[0]} ]] ; then
exit 1
fi

export PYVERSIONS='3.6.15 pypy3.6-7.3.1 3.7.16 pypy3.7-7.3.9 pypy3.8-7.3.10 pypy3.9-7.3.10 pyston-2.3.5 3.8.16 3.9.16 3.10.9'
export PYVERSIONS='3.6.15 pypy3.6-7.3.1 3.7.16 pypy3.7-7.3.9 pypy3.8-7.3.10 pypy3.9-7.3.10 pyston-2.3.5 3.8.16 3.9.16 3.10.10'
1 change: 1 addition & 0 deletions admin-tools/setup-python-3.2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ if [[ $0 == $bs ]] ; then
fi

mydir=$(dirname $bs)
fulldir=$(readlink -f $mydir)
(cd $fulldir/.. && checkout_version python-spark master && checkout_version python-uncompyle6)
cd $owd
rm -v */.python-version || true
Expand Down
4 changes: 2 additions & 2 deletions trepan/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
import sys

from trepan import debugger as Mdebugger
from trepan.post_mortem import post_mortem_excepthook, uncaught_exception
from trepan.debugger import Trepan
from trepan.post_mortem import post_mortem_excepthook, uncaught_exception


def debugger_on_post_mortem():
"""Call debugger on an exeception that terminates a program"""
"""Call debugger on an exception that terminates a program"""
sys.excepthook = post_mortem_excepthook
return

Expand Down
16 changes: 10 additions & 6 deletions trepan/bwcli.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,20 @@
""" The hairy command-line interface to the debugger.
"""
import os.path as osp
import pyficache
import sys

from optparse import OptionParser

import pyficache

# Our local modules
from trepan import clifns as Mclifns
from trepan import debugger as Mdebugger, exception as Mexcept, misc as Mmisc
from trepan.lib.file import readable
from trepan import (
clifns as Mclifns,
debugger as Mdebugger,
exception as Mexcept,
misc as Mmisc,
)
from trepan.interfaces.bullwinkle import BWInterface
from trepan.lib.file import readable

# The name of the debugger we are currently going by.
__title__ = "trepan"
Expand All @@ -40,7 +44,7 @@ def process_options(debugger_name, pkg_version, sys_argv, option_list=None):
another main program and want to extend the existing set of debugger
options.
The options dicionary from opt_parser is return. sys_argv is
The options dictionary from opt_parser is return. sys_argv is
also updated."""
usage_str = """%prog [debugger-options] [python-script [script-options...]]
Expand Down
8 changes: 4 additions & 4 deletions trepan/bwprocessor/command/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (C) 2008, 2009, 2013 Rocky Bernstein <[email protected]>
# 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
Expand All @@ -10,12 +11,11 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# """ Copyright (C) 2008, 2009, 2013 Rocky Bernstein <[email protected]> """
__import__("pkg_resources").declare_namespace(__name__)

import glob
import os

__import__("pkg_resources").declare_namespace(__name__)

# FIXME: Is it really helpful to "privatize" variable names below?
# The below names are not part of the standard pre-defined names like
# __name__ or __file__ are.
Expand All @@ -27,7 +27,7 @@
__py_files__ = glob.glob(os.path.join(__command_dir__, "[a-z]*.py"))

# Take the basename of the filename and drop off '.py'. That minus the
# files in exclude_files and tha becomes the list of modules that
# files in exclude_files and that becomes the list of modules that
# commands.py will use to import
exclude_files = ["mock.py"]
__modules__ = [
Expand Down
6 changes: 3 additions & 3 deletions trepan/bwprocessor/command/base_cmd.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2010, 2012-2013, 2015 Rocky Bernstein
# Copyright (C) 2009-2010, 2012-2013, 2015, 2013 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
Expand All @@ -20,7 +20,7 @@
and storing it as a list of known debugger commands.
"""

NotImplementedMessage = "This method must be overriden in a subclass"
NotImplementedMessage = "This method must be overridden in a subclass"

__all__ = ["DebuggerCommand"]

Expand Down Expand Up @@ -54,7 +54,7 @@ def __init__(self, proc):
# an assignment of method names like self.msg = self.debugger.intf.msg,
# because we want to allow the interface (intf) to change
# dynamically. That is, the value of self.debugger may change
# in the course of the program and if we made such an method assignemnt
# in the course of the program and if we made such an method assignment
# we wouldn't pick up that change in our self.msg
def errmsg(self, msg, opts={}):
"""Convenience short-hand for self.debugger.intf.errmsg"""
Expand Down
4 changes: 2 additions & 2 deletions trepan/bwprocessor/msg.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Rocky Bernstein <[email protected]>
# Copyright (C) 2015, 2023 Rocky Bernstein <[email protected]>
""" Common I/O routines"""


# Note for errmsg, msg, and msg_nocr we don't want to simply make
# an assignment of method names like self.msg = self.debugger.intf.msg,
# because we want to allow the interface (intf) to change
# dynamically. That is, the value of self.debugger may change
# in the course of the program and if we made such an method assignemnt
# in the course of the program and if we made such an method assignment
# we wouldn't pick up that change in our self.msg
def errmsg(proc_obj, message, opts={}):
response = proc_obj.response
Expand Down
2 changes: 1 addition & 1 deletion trepan/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def process_options(pkg_version, sys_argv, option_list=None):
another main program and want to extend the existing set of debugger
options.
The options dicionary from opt_parser is return. sys_argv is
The options dictionary from opt_parser is return. sys_argv is
also updated."""
usage_str = """%prog [debugger-options]]
Expand Down
2 changes: 1 addition & 1 deletion trepan/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def run_call(self, func, start_opts=None, *args, **kwds):
See also `run_eval' if what you want to run is an eval'able
expression have that result returned and `run' if you want to
debug a statment via exec.
debug a statement via exec.
"""
res = None
self.core.start(opts=start_opts)
Expand Down
8 changes: 5 additions & 3 deletions trepan/inout/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2009, 2014-2015, 2020 Rocky Bernstein <[email protected]>
#
# Copyright (C) 2009, 2014-2015, 2020, 2023 Rocky Bernstein
# <[email protected]>
#
# 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
Expand All @@ -14,14 +16,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""classes to support communication to and from the debugger. This
communcation might be to/from another process or another computer.
communication might be to/from another process or another computer.
And reading may be from a debugger command script.
For example, we'd like to support Sockets, and serial lines and file
reading, as well a readline-type input. Encryption and Authentication
methods might decorate some of the communication channels.
Some ideas originiated as part of Matt Fleming's 2006 Google Summer of
Some ideas originated as part of Matt Fleming's 2006 Google Summer of
Code project.
"""

Expand Down
2 changes: 1 addition & 1 deletion trepan/inout/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def readline_importable() -> bool:
class DebuggerUserInput(Mbase.DebuggerInputBase):
"""Debugger input connected to what we think of as a end-user input
as opposed to a relay mechanism to another process. Input could be
interative terminal, but it might be file input."""
interactive terminal, but it might be file input."""

def __init__(self, inp=None, opts=None):
self.input = inp or sys.stdin
Expand Down
2 changes: 1 addition & 1 deletion trepan/inout/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

class DebuggerUserOutput(DebuggerInOutBase):
"""Debugger output shown directly to what we think of as end-user
ouptut as opposed to a relay mechanism to another process. Output
output as opposed to a relay mechanism to another process. Output
could be an interactive terminal, but it might also be file output"""

def __init__(self, out=None, opts=None):
Expand Down
8 changes: 5 additions & 3 deletions trepan/inout/stringarray.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2009, 2013-2014 Rocky Bernstein <[email protected]>
#
# Copyright (C) 2009, 2013-2014, 2023 Rocky Bernstein
# <[email protected]>
#
# 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
Expand All @@ -22,7 +24,7 @@

class StringArrayInput(Mbase.DebuggerInputBase):
"""Simulate I/O using an array of strings. Sort of like StringIO, but
even simplier."""
even simpler."""

def __init__(self, inp=[], opts=None):
self.input = inp
Expand Down Expand Up @@ -60,7 +62,7 @@ def readline(self, use_raw=None, prompt=""):

class StringArrayOutput(Mbase.DebuggerInOutBase):
"""Simulate I/O using an array of strings. Sort of like StringIO, but
even simplier."""
even simpler."""

def __init__(self, out=[], opts=None):
self.flush_after_write = False # For compatibility
Expand Down
6 changes: 4 additions & 2 deletions trepan/interface.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2010, 2013, 2015, 2018 Rocky Bernstein <[email protected]>
#
# Copyright (C) 2010, 2013, 2015, 2018, 2023 Rocky Bernstein
# <[email protected]>
#
# 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
Expand All @@ -17,7 +19,7 @@

import sys

NotImplementedMessage = "This method must be overriden in a subclass"
NotImplementedMessage = "This method must be overridden in a subclass"

__all__ = ["TrepanInterface"]

Expand Down
10 changes: 6 additions & 4 deletions trepan/interfaces/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2009, 2013-2014, 2017 Rocky Bernstein <[email protected]>
#
# Copyright (C) 2009, 2013-2014, 2017, 2023 Rocky Bernstein
# <[email protected]>
#
# 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
Expand All @@ -14,12 +16,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Module for client (i.e. user to communication-device) interaction.
The debugged program is at the other end of the communcation."""
The debugged program is at the other end of the communication."""

from trepan.inout import fifoclient as Mfifoclient, tcpclient as Mtcpclient

# Our local modules
from trepan.interfaces import user as Muser
from trepan.inout import tcpclient as Mtcpclient, fifoclient as Mfifoclient


DEFAULT_INIT_CONNECTION_OPTS = {"IO": "TCP"}

Expand Down
6 changes: 3 additions & 3 deletions trepan/interfaces/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# Our local modules
from trepan import interface as Minterface, misc as Mmisc
from trepan.inout import scriptin as Mscriptin, output as Moutput
from trepan.inout import output as Moutput, scriptin as Mscriptin


class ScriptInterface(Minterface.TrepanInterface):
Expand Down Expand Up @@ -82,7 +82,7 @@ def finalize(self, last_wishes=None):

def read_command(self, prompt=""):
"""Script interface to read a command. `prompt' is a parameter for
compatibilty and is ignored."""
compatibility and is ignored."""
self.input_lineno += 1
line = self.readline()
if self.verbose:
Expand All @@ -95,7 +95,7 @@ def read_command(self, prompt=""):
# Could decide make this look for interactive input?
def readline(self, prompt=""):
"""Script interface to read a line. `prompt' is a parameter for
compatibilty and is ignored."""
compatibility and is ignored."""
return self.input.readline()


Expand Down
4 changes: 2 additions & 2 deletions trepan/interfaces/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# Our local modules
from trepan import interface as Minterface
from trepan.inout import tcpserver as Mtcpserver, fifoserver as Mfifoserver
from trepan.inout import fifoserver as Mfifoserver, tcpserver as Mtcpserver
from trepan.interfaces import comcodes as Mcomcodes

DEFAULT_INIT_CONNECTION_OPTS = {"IO": "TCP", "PORT": 1955}
Expand All @@ -45,7 +45,7 @@ def __init__(self, inout=None, out=None, connection_opts={}):
self.inout = Mtcpserver.TCPServer(opts=opts)
pass
pass
# For Compatability
# For Compatibility
self.output = self.inout
self.input = self.inout
self.interactive = True # Or at least so we think initially
Expand Down
Loading

0 comments on commit 4f43a01

Please sign in to comment.