Hello community, here is the log from the commit of package python-pudb for openSUSE:Factory checked in at 2020-03-19 19:51:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pudb (Old) and /work/SRC/openSUSE:Factory/.python-pudb.new.3160 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pudb" Thu Mar 19 19:51:37 2020 rev:5 rq:786390 version:2019.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pudb/python-pudb.changes 2019-08-15 12:29:57.310461517 +0200 +++ /work/SRC/openSUSE:Factory/.python-pudb.new.3160/python-pudb.changes 2020-03-19 19:54:22.456277837 +0100 @@ -1,0 +2,8 @@ +Thu Mar 19 09:40:04 UTC 2020 - Marketa Calabkova <[email protected]> + +- Update to version 2019.2 + * Show the value of numpy scalars when using the safe stringifier + * Support Py3.8 + * Bug fixes + +------------------------------------------------------------------- Old: ---- pudb-2019.1.tar.gz New: ---- pudb-2019.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pudb.spec ++++++ --- /var/tmp/diff_new_pack.cj0ClL/_old 2020-03-19 19:54:22.980277855 +0100 +++ /var/tmp/diff_new_pack.cj0ClL/_new 2020-03-19 19:54:22.980277855 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-pudb # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -21,7 +21,7 @@ %define py_maj_ver %(c=%{python}) %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pudb -Version: 2019.1 +Version: 2019.2 Release: 0 Summary: A full-screen, console-based Python debugger License: MIT ++++++ pudb-2019.1.tar.gz -> pudb-2019.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pudb-2019.1/PKG-INFO new/pudb-2019.2/PKG-INFO --- old/pudb-2019.1/PKG-INFO 2019-04-25 22:41:48.000000000 +0200 +++ new/pudb-2019.2/PKG-INFO 2019-11-21 01:38:14.000000000 +0100 @@ -1,18 +1,23 @@ Metadata-Version: 1.1 Name: pudb -Version: 2019.1 +Version: 2019.2 Summary: A full-screen, console-based Python debugger Home-page: https://github.com/inducer/pudb Author: Andreas Kloeckner Author-email: [email protected] License: UNKNOWN -Description: .. image:: https://travis-ci.org/inducer/pudb.svg?branch=master - :target: https://travis-ci.org/inducer/pudb +Description: PuDB: a console-based visual debugger for Python + ================================================ - .. image:: https://codecov.io/gh/inducer/pudb/branch/master/graph/badge.svg - :target: https://codecov.io/gh/inducer/pudb - - PuDB is a full-screen, console-based visual debugger for Python. + .. image:: https://gitlab.tiker.net/inducer/pudb/badges/master/pipeline.svg + :alt: Gitlab Build Status + :target: https://gitlab.tiker.net/inducer/pudb/commits/master + .. image:: https://dev.azure.com/ak-spam/inducer/_apis/build/status/inducer.pudb?branchName=master + :alt: Azure Build Status + :target: https://dev.azure.com/ak-spam/inducer/_build/latest?definitionId=18&branchName=master + .. image:: https://badge.fury.io/py/pudb.png + :alt: Python Package Index Release Page + :target: https://pypi.org/project/pudb/ Its goal is to provide all the niceties of modern GUI-based debuggers in a more lightweight and keyboard-friendly package. PuDB allows you to debug code @@ -55,7 +60,7 @@ * IPython integration (see `wiki <http://wiki.tiker.net/PuDB>`_) - * Should work with Python 2.6 and newer, including Python 3. + * Should work with Python 2.7 and newer, including Python 3. Links ----- @@ -89,7 +94,6 @@ Classifier: Operating System :: Unix Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pudb-2019.1/README.rst new/pudb-2019.2/README.rst --- old/pudb-2019.1/README.rst 2018-10-02 06:28:12.000000000 +0200 +++ new/pudb-2019.2/README.rst 2019-09-09 21:55:51.000000000 +0200 @@ -1,10 +1,15 @@ -.. image:: https://travis-ci.org/inducer/pudb.svg?branch=master - :target: https://travis-ci.org/inducer/pudb +PuDB: a console-based visual debugger for Python +================================================ -.. image:: https://codecov.io/gh/inducer/pudb/branch/master/graph/badge.svg - :target: https://codecov.io/gh/inducer/pudb - -PuDB is a full-screen, console-based visual debugger for Python. +.. image:: https://gitlab.tiker.net/inducer/pudb/badges/master/pipeline.svg + :alt: Gitlab Build Status + :target: https://gitlab.tiker.net/inducer/pudb/commits/master +.. image:: https://dev.azure.com/ak-spam/inducer/_apis/build/status/inducer.pudb?branchName=master + :alt: Azure Build Status + :target: https://dev.azure.com/ak-spam/inducer/_build/latest?definitionId=18&branchName=master +.. image:: https://badge.fury.io/py/pudb.png + :alt: Python Package Index Release Page + :target: https://pypi.org/project/pudb/ Its goal is to provide all the niceties of modern GUI-based debuggers in a more lightweight and keyboard-friendly package. PuDB allows you to debug code @@ -47,7 +52,7 @@ * IPython integration (see `wiki <http://wiki.tiker.net/PuDB>`_) -* Should work with Python 2.6 and newer, including Python 3. +* Should work with Python 2.7 and newer, including Python 3. Links ----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pudb-2019.1/pudb/__init__.py new/pudb-2019.2/pudb/__init__.py --- old/pudb-2019.1/pudb/__init__.py 2019-04-25 22:34:36.000000000 +0200 +++ new/pudb-2019.2/pudb/__init__.py 2019-11-21 01:31:22.000000000 +0100 @@ -26,7 +26,7 @@ """ -NUM_VERSION = (2019, 1) +NUM_VERSION = (2019, 2) VERSION = ".".join(str(nv) for nv in NUM_VERSION) __version__ = VERSION @@ -80,8 +80,16 @@ import os import sys if sys.version_info[0] == 2: + import fcntl + import termios + import struct tty_file = open(tty_path, 'r+b', buffering=0) - term_size = None + try: + s = struct.unpack('hh', fcntl.ioctl( + tty_file.fileno(), termios.TIOCGWINSZ, '1234')) + term_size = (s[1], s[0]) + except Exception: + term_size = None else: tty_file = io.TextIOWrapper(open(tty_path, 'r+b', buffering=0)) term_size = os.get_terminal_size(tty_file.fileno()) @@ -94,7 +102,6 @@ tty_path = _tty_override() if tty_path and ('stdin' not in kwargs or 'stdout' not in kwargs): tty_file, term_size = _open_tty(tty_path) - kwargs.setdefault('stdin', tty_file) kwargs.setdefault('stdout', tty_file) kwargs.setdefault('term_size', term_size) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pudb-2019.1/pudb/debugger.py new/pudb-2019.2/pudb/debugger.py --- old/pudb-2019.1/pudb/debugger.py 2019-04-25 22:39:06.000000000 +0200 +++ new/pudb-2019.2/pudb/debugger.py 2019-11-21 01:36:34.000000000 +0100 @@ -44,12 +44,11 @@ CONFIG = load_config() save_config(CONFIG) -HELP_TEXT = r"""\ -Welcome to PuDB, the Python Urwid debugger. -------------------------------------------- - -(This help screen is scrollable. Hit Page Down to see more.) +HELP_HEADER = r""" +Key Assignments: Use Arrow Down/Up or Page Down/Up to scroll. +""" +HELP_MAIN = r""" Keys: Ctrl-p - edit preferences @@ -59,14 +58,13 @@ r/f - finish current function t - run to cursor e - show traceback [post-mortem or in exception state] + b - set/clear breakpoint H - move to current line (bottom of stack) u - move up one stack frame d - move down one stack frame o - show console/output screen - - b - toggle breakpoint m - open module j/k - up/down @@ -86,7 +84,6 @@ q - quit Ctrl-c - when in continue mode, break back to PuDB - Ctrl-l - redraw screen Shell-related: @@ -99,14 +96,16 @@ Ctrl-v - insert newline Ctrl-n/p - browse command line history Tab - yes, there is (simple) tab completion +""" +HELP_SIDE = r""" Sidebar-related (active in sidebar): +/- - grow/shrink sidebar _/= - minimize/maximize sidebar [/] - grow/shrink relative size of active sidebar box Keys in variables list: - \/space - expand/collapse + \/enter/space - expand/collapse t/r/s/c - show type/repr/str/custom for this variable h - toggle highlighting @ - toggle repetition at top @@ -114,18 +113,19 @@ m - toggle method visibility w - toggle line wrapping n/insert - add new watch expression - enter - edit options (also to delete) + e - edit options (also to delete) Keys in stack list: - enter - jump to frame -Keys in breakpoints view: - - enter - edit breakpoint +Keys in breakpoints list: + enter - jump to breakpoint + b - toggle breakpoint d - delete breakpoint - e - enable/disable breakpoint + e - edit breakpoint +""" +HELP_LICENSE = r""" License: -------- @@ -701,10 +701,12 @@ self.cmdline_sigwrap = SignalWrap( urwid.AttrMap(self.cmdline_pile, None, "focused sidebar") ) - + self.cmdline_on = not CONFIG["hide_cmdline_win"] + self.cmdline_weight = 1 self.lhs_col = urwid.Pile([ ("weight", 5, self.source_attr), - ("weight", 1, self.cmdline_sigwrap), + ("weight", self.cmdline_weight if self.cmdline_on else 0, + self.cmdline_sigwrap), ]) # }}} @@ -760,7 +762,7 @@ def change_rhs_box(name, index, direction, w, size, key): from pudb.settings import save_config - _, weight = self.rhs_col.item_types[index] + weight = self.rhs_col.item_types[index][1] if direction < 0: if weight > 1/5: @@ -785,7 +787,7 @@ iinfo = self.get_frame_var_info(read_only=False) \ .get_inspect_info(var.id_path, read_only=False) - if key == "\\" or key == ' ': + if key == "enter" or key == "\\" or key == ' ': iinfo.show_detail = not iinfo.show_detail elif key == "t": iinfo.display_type = "type" @@ -936,6 +938,9 @@ fvi.watches.append(we) self.update_var_view() + def helpside(w, size, key): + help(HELP_HEADER + HELP_SIDE + HELP_MAIN + HELP_LICENSE) + self.var_list.listen("\\", change_var_state) self.var_list.listen(" ", change_var_state) self.var_list.listen("t", change_var_state) @@ -947,7 +952,8 @@ self.var_list.listen("*", change_var_state) self.var_list.listen("w", change_var_state) self.var_list.listen("m", change_var_state) - self.var_list.listen("enter", edit_inspector_detail) + self.var_list.listen("enter", change_var_state) + self.var_list.listen("e", edit_inspector_detail) self.var_list.listen("n", insert_watch) self.var_list.listen("insert", insert_watch) @@ -956,6 +962,8 @@ self.var_list.listen("j", self.rhs_scroll_down) self.var_list.listen("k", self.rhs_scroll_up) + self.var_list.listen("f1", helpside) + self.var_list.listen("?", helpside) # }}} @@ -984,6 +992,8 @@ self.stack_list.listen("j", self.rhs_scroll_down) self.stack_list.listen("k", self.rhs_scroll_up) + self.stack_list.listen("f1", helpside) + self.stack_list.listen("?", helpside) # }}} @@ -1099,16 +1109,28 @@ else: self.update_breakpoints() - self.bp_list.listen("enter", examine_breakpoint) + def show_breakpoint(w, size, key): + bp_entry, pos = self.bp_list._w.get_focus() + + if bp_entry is not None: + bp = self._get_bp_list()[pos] + self.show_line(bp.line, + FileSourceCodeProvider(self.debugger, bp.file)) + + self.bp_list.listen("enter", show_breakpoint) self.bp_list.listen("d", delete_breakpoint) self.bp_list.listen("s", save_breakpoints) - self.bp_list.listen("e", enable_disable_breakpoint) + self.bp_list.listen("e", examine_breakpoint) + self.bp_list.listen("b", enable_disable_breakpoint) + self.bp_list.listen("H", move_stack_top) self.bp_list.listen("[", partial(change_rhs_box, 'breakpoints', 2, -1)) self.bp_list.listen("]", partial(change_rhs_box, 'breakpoints', 2, 1)) self.bp_list.listen("j", self.rhs_scroll_down) self.bp_list.listen("k", self.rhs_scroll_up) + self.bp_list.listen("f1", helpside) + self.bp_list.listen("?", helpside) # }}} # {{{ source listeners @@ -1433,6 +1455,9 @@ self.debugger.set_frame_index( self.translate_ui_stack_index(pos)) + def helpmain(w, size, key): + help(HELP_HEADER + HELP_MAIN + HELP_SIDE + HELP_LICENSE) + self.source_sigwrap.listen("n", next) self.source_sigwrap.listen("s", step) self.source_sigwrap.listen("f", finish) @@ -1465,6 +1490,8 @@ self.source_sigwrap.listen("H", move_stack_top) self.source_sigwrap.listen("u", move_stack_up) self.source_sigwrap.listen("d", move_stack_down) + self.source_sigwrap.listen("f1", helpmain) + self.source_sigwrap.listen("?", helpmain) # }}} @@ -1668,8 +1695,14 @@ def toggle_cmdline_focus(w, size, key): self.columns.set_focus(self.lhs_col) if self.lhs_col.get_focus() is self.cmdline_sigwrap: - self.lhs_col.set_focus(self.source_attr) + if CONFIG["hide_cmdline_win"]: + self.set_cmdline_state(False) + self.lhs_col.set_focus(self.search_controller.search_AttrMap + if self.search_controller.search_box else + self.source_attr) else: + if CONFIG["hide_cmdline_win"]: + self.set_cmdline_state(True) self.cmdline_pile.set_focus(self.cmdline_edit_bar) self.lhs_col.set_focus(self.cmdline_sigwrap) @@ -1688,30 +1721,29 @@ self.top.listen("ctrl x", toggle_cmdline_focus) # {{{ command line sizing + def set_cmdline_default_size(weight): + self.cmdline_weight = weight + self.set_cmdline_size() def max_cmdline(w, size, key): - self.lhs_col.item_types[-1] = "weight", 5 - self.lhs_col._invalidate() + set_cmdline_default_size(5) def min_cmdline(w, size, key): - self.lhs_col.item_types[-1] = "weight", 1/2 - self.lhs_col._invalidate() + set_cmdline_default_size(1/2) def grow_cmdline(w, size, key): - _, weight = self.lhs_col.item_types[-1] + weight = self.cmdline_weight if weight < 5: weight *= 1.25 - self.lhs_col.item_types[-1] = "weight", weight - self.lhs_col._invalidate() + set_cmdline_default_size(weight) def shrink_cmdline(w, size, key): - _, weight = self.lhs_col.item_types[-1] + weight = self.cmdline_weight if weight > 1/2: weight /= 1.25 - self.lhs_col.item_types[-1] = "weight", weight - self.lhs_col._invalidate() + set_cmdline_default_size(weight) self.cmdline_sigwrap.listen("=", max_cmdline) self.cmdline_sigwrap.listen("+", grow_cmdline) @@ -1747,7 +1779,7 @@ def grow_sidebar(w, size, key): from pudb.settings import save_config - _, weight = self.columns.column_types[1] + weight = self.columns.column_types[1][1] if weight < 5: weight *= 1.25 @@ -1759,7 +1791,7 @@ def shrink_sidebar(w, size, key): from pudb.settings import save_config - _, weight = self.columns.column_types[1] + weight = self.columns.column_types[1][1] if weight > 1/5: weight /= 1.25 @@ -1881,8 +1913,8 @@ def redraw_screen(w, size, key): self.screen.clear() - def help(w, size, key): - self.message(HELP_TEXT, title="PuDB Help") + def help(pages): + self.message(pages, title="PuDB - The Python Urwid Debugger") self.top.listen("o", show_output) self.top.listen("ctrl r", reload_breakpoints) @@ -1897,8 +1929,6 @@ self.top.listen("q", quit) self.top.listen("ctrl p", do_edit_config) self.top.listen("ctrl l", redraw_screen) - self.top.listen("f1", help) - self.top.listen("?", help) # }}} @@ -1961,13 +1991,27 @@ # }}} # {{{ UI helpers + def reset_cmdline_size(self): + self.lhs_col.item_types[-1] = "weight", \ + self.cmdline_weight if self.cmdline_on else 0 + + def set_cmdline_size(self, weight=None): + if weight is None: + weight = self.cmdline_weight + + self.lhs_col.item_types[-1] = "weight", weight + self.lhs_col._invalidate() + + def set_cmdline_state(self, state_on): + if state_on != self.cmdline_on: + self.cmdline_on = state_on + self.set_cmdline_size(None if state_on else 0) + def rhs_scroll_down(self, w, size, key): - if key == 'j' and CONFIG['jk_sidebar_scroll']: - w.keypress(size, "down") + w.keypress(size, "down") def rhs_scroll_up(self, w, size, key): - if key == 'k' and CONFIG['jk_sidebar_scroll']: - w.keypress(size, "up") + w.keypress(size, "up") def translate_ui_stack_index(self, index): # note: self-inverse @@ -2163,7 +2207,7 @@ self.message("Package 'pygments' not found. " "Syntax highlighting disabled.") - WELCOME_LEVEL = "e035" # noqa + WELCOME_LEVEL = "e036" # noqa if CONFIG["seen_welcome"] < WELCOME_LEVEL: CONFIG["seen_welcome"] = WELCOME_LEVEL from pudb import VERSION @@ -2180,9 +2224,18 @@ "(invoked by hitting '?' after this message) should get you " "on your way.\n" + "\nChanges in version 2019.2:\n\n" + "- Auto-hide the command line (Mark Blakeney)\n" + "- Improve help and add jump to breakpoint (Mark Blakeney)\n" + "- Drop Py2.6 support\n" + "- Show callable attributes in var view\n" + "- Allow scrolling sidebar with j/k\n" + "- Fix setting breakpoints in Py3.8 (Aaron Meurer)\n" + "\nChanges in version 2019.1:\n\n" "- Allow 'space' as a key to expand variables (Enrico Troeger)\n" - "- Have a persistent setting on variable visibility (Enrico Troeger)\n" + "- Have a persistent setting on variable visibility \n" + " (Enrico Troeger)\n" "- Enable/partially automate opening the debugger in another \n" " terminal (Anton Barkovsky)\n" "- Make sidebar scrollable with j/k (Clayton Craft)\n" @@ -2490,6 +2543,9 @@ self.stack_walker[:] = frame_uis + def update_cmdline_win(self): + self.set_cmdline_state(not CONFIG["hide_cmdline_win"]) + # }}} # vim: foldmethod=marker:expandtab:softtabstop=4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pudb-2019.1/pudb/lowlevel.py new/pudb-2019.2/pudb/lowlevel.py --- old/pudb-2019.1/pudb/lowlevel.py 2018-10-26 16:32:27.000000000 +0200 +++ new/pudb-2019.2/pudb/lowlevel.py 2019-11-21 01:23:23.000000000 +0100 @@ -35,8 +35,18 @@ lineno = code.co_firstlineno yield lineno if PY3: - for c in code.co_lnotab[1::2]: - lineno += c + # See https://github.com/python/cpython/blob/master/Objects/lnotab_notes.txt + import sys + use_36_line_incr = sys.version_info >= (3, 6) + + for line_incr in code.co_lnotab[1::2]: + # This showed up between the v3.5 and v3.6 cycles: + # https://github.com/python/cpython/blob/v3.5.0/Objects/lnotab_notes.txt + # https://github.com/python/cpython/blob/v3.6.0/Objects/lnotab_notes.txt + # Gate the check on 3.6-or-newer. + if line_incr >= 0x80 and use_36_line_incr: + line_incr -= 0x100 + lineno += line_incr yield lineno else: for c in code.co_lnotab[1::2]: @@ -44,11 +54,8 @@ yield lineno -def get_executable_lines_for_file(filename): - # inspired by rpdb2 - - from linecache import getlines - codes = [compile("".join(getlines(filename)), filename, "exec", dont_inherit=1)] +def get_executable_lines_for_codes_recursive(codes): + codes = codes[:] from types import CodeType @@ -64,6 +71,15 @@ return execable_lines +def get_executable_lines_for_file(filename): + # inspired by rpdb2 + + from linecache import getlines + codes = [compile("".join(getlines(filename)), filename, "exec", dont_inherit=1)] + + return get_executable_lines_for_codes_recursive(codes) + + def get_breakpoint_invalid_reason(filename, lineno): # simple logic stolen from pdb import linecache diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pudb-2019.1/pudb/settings.py new/pudb-2019.2/pudb/settings.py --- old/pudb-2019.1/pudb/settings.py 2019-03-12 07:18:45.000000000 +0100 +++ new/pudb-2019.2/pudb/settings.py 2019-07-23 01:45:52.000000000 +0200 @@ -112,7 +112,7 @@ conf_dict.setdefault("prompt_on_quit", True) - conf_dict.setdefault("jk_sidebar_scroll", False) + conf_dict.setdefault("hide_cmdline_win", False) def normalize_bool_inplace(name): try: @@ -126,7 +126,7 @@ normalize_bool_inplace("line_numbers") normalize_bool_inplace("wrap_variables") normalize_bool_inplace("prompt_on_quit") - normalize_bool_inplace("jk_sidebar_scroll") + normalize_bool_inplace("hide_cmdline_win") return conf_dict @@ -167,8 +167,8 @@ def _update_prompt_on_quit(): pass - def _update_jk_sidebar_scroll(): - pass + def _update_hide_cmdline_win(): + ui.update_cmdline_win() def _update_current_stack_frame(): ui.update_stack() @@ -208,10 +208,10 @@ conf_dict.update(new_conf_dict) _update_prompt_on_quit() - elif option == "jk_sidebar_scroll": - new_conf_dict["jk_sidebar_scroll"] = not check_box.get_state() + elif option == "hide_cmdline_win": + new_conf_dict["hide_cmdline_win"] = not check_box.get_state() conf_dict.update(new_conf_dict) - _update_jk_sidebar_scroll() + _update_hide_cmdline_win() elif option == "current_stack_frame": # only activate if the new state of the radio button is 'on' @@ -255,10 +255,10 @@ bool(conf_dict["prompt_on_quit"]), on_state_change=_update_config, user_data=("prompt_on_quit", None)) - cb_jk_sidebar_scroll = urwid.CheckBox("Use j/k keys for scrolling in " - "sidebar", - bool(conf_dict["jk_sidebar_scroll"]), on_state_change=_update_config, - user_data=("jk_sidebar_scroll", None)) + hide_cmdline_win = urwid.CheckBox("Hide command line (Ctrl-X) window " + "when not in use", + bool(conf_dict["hide_cmdline_win"]), on_state_change=_update_config, + user_data=("hide_cmdline_win", None)) # {{{ shells @@ -423,14 +423,10 @@ lb_contents = ( [heading] - + [urwid.AttrMap(urwid.Text("Line Numbers:\n"), "group head")] + + [urwid.AttrMap(urwid.Text("General:\n"), "group head")] + [cb_line_numbers] - - + [urwid.AttrMap(urwid.Text("\nPrompt on quit:\n"), "group head")] + [cb_prompt_on_quit] - - + [urwid.AttrMap(urwid.Text("\nKeys:\n"), "group head")] - + [cb_jk_sidebar_scroll] + + [hide_cmdline_win] + [urwid.AttrMap(urwid.Text("\nShell:\n"), "group head")] + [shell_info] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pudb-2019.1/pudb/ui_tools.py new/pudb-2019.2/pudb/ui_tools.py --- old/pudb-2019.1/pudb/ui_tools.py 2018-05-24 13:33:32.000000000 +0200 +++ new/pudb-2019.2/pudb/ui_tools.py 2019-10-17 20:18:17.000000000 +0200 @@ -6,8 +6,9 @@ # generic urwid helpers ------------------------------------------------------- def text_width(txt): - """ - Return the width of the text in the terminal + """Return the width of the text in the terminal. + + :arg txt: A Unicode text object. Use this instead of len() whenever txt could contain double- or zero-width Unicode characters. @@ -237,13 +238,10 @@ lhs_col.item_types.insert( 0, ("flow", None)) lhs_col.widget_list.insert(0, self.search_AttrMap) + self.ui.reset_cmdline_size() - self.ui.columns.set_focus(lhs_col) - lhs_col.set_focus(self.search_AttrMap) - else: - self.ui.columns.set_focus(lhs_col) - lhs_col.set_focus(self.search_AttrMap) - #self.search_box.restart_search() + self.ui.columns.set_focus(lhs_col) + lhs_col.set_focus(self.search_AttrMap) def perform_search(self, dir, s=None, start=None, update_search_start=False): self.cancel_highlight() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pudb-2019.1/pudb/var_view.py new/pudb-2019.2/pudb/var_view.py --- old/pudb-2019.1/pudb/var_view.py 2019-01-23 16:29:46.000000000 +0100 +++ new/pudb-2019.2/pudb/var_view.py 2019-11-21 00:21:20.000000000 +0100 @@ -31,6 +31,7 @@ # {{{ constants and imports import urwid +import inspect try: import numpy @@ -39,13 +40,14 @@ HAVE_NUMPY = 0 from pudb.py3compat import PY3, execfile, raw_input, xrange, \ - integer_types, string_types + integer_types, string_types, text_type if PY3: ELLIPSIS = '…' else: ELLIPSIS = unicode('…', 'utf-8') # noqa: F821 from pudb.ui_tools import text_width + # }}} @@ -261,11 +263,14 @@ def type_stringifier(value): if HAVE_NUMPY and isinstance(value, numpy.ndarray): - return "ndarray %s %s" % (value.dtype, value.shape) + return text_type("ndarray %s %s") % (value.dtype, value.shape) + + elif HAVE_NUMPY and isinstance(value, numpy.number): + return text_type("%s (%s)" % (value, value.dtype)) elif isinstance(value, STR_SAFE_TYPES): try: - return str(value) + return text_type(value) except Exception: pass @@ -278,21 +283,31 @@ pass else: if isinstance(result, string_types): - return result + return text_type(result) elif type(value) in [set, frozenset, list, tuple, dict]: - return "%s (%s)" % (type(value).__name__, len(value)) + return text_type("%s (%s)") % (type(value).__name__, len(value)) - return type(value).__name__ + return text_type(type(value).__name__) def get_stringifier(iinfo): + """Return a function that turns an object into a Unicode text object.""" + if iinfo.display_type == "type": return type_stringifier elif iinfo.display_type == "repr": - return repr + if PY3: + return repr + else: + return lambda value: repr(value).decode("utf-8") elif iinfo.display_type == "str": - return str + if PY3: + return str + else: + return lambda value: ( + value.decode("utf-8") if isinstance(value, bytes) + else text_type(value)) else: try: if not custom_stringifier_dict: # Only execfile once @@ -303,17 +318,18 @@ from traceback import print_exc print_exc() raw_input("Hit enter:") - return lambda value: "ERROR: Invalid custom stringifier file." + return lambda value: text_type("ERROR: Invalid custom stringifier file.") else: if "pudb_stringifier" not in custom_stringifier_dict: print("%s does not contain a function named pudb_stringifier at " "the module level." % iinfo.display_type) raw_input("Hit enter:") - return lambda value: ("ERROR: Invalid custom stringifier file: " - "pudb_stringifer not defined.") + return lambda value: text_type( + "ERROR: Invalid custom stringifier file: " + "pudb_stringifer not defined.") else: return (lambda value: - str(custom_stringifier_dict["pudb_stringifier"](value))) + text_type(custom_stringifier_dict["pudb_stringifier"](value))) # {{{ tree walking @@ -450,7 +466,7 @@ try: attr_value = getattr(value, key) - if callable(attr_value) and not iinfo.show_methods: + if inspect.ismethod(attr_value) and not iinfo.show_methods: cnt_omitted_methods += 1 continue except Exception: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pudb-2019.1/pudb.egg-info/PKG-INFO new/pudb-2019.2/pudb.egg-info/PKG-INFO --- old/pudb-2019.1/pudb.egg-info/PKG-INFO 2019-04-25 22:41:48.000000000 +0200 +++ new/pudb-2019.2/pudb.egg-info/PKG-INFO 2019-11-21 01:38:14.000000000 +0100 @@ -1,18 +1,23 @@ Metadata-Version: 1.1 Name: pudb -Version: 2019.1 +Version: 2019.2 Summary: A full-screen, console-based Python debugger Home-page: https://github.com/inducer/pudb Author: Andreas Kloeckner Author-email: [email protected] License: UNKNOWN -Description: .. image:: https://travis-ci.org/inducer/pudb.svg?branch=master - :target: https://travis-ci.org/inducer/pudb +Description: PuDB: a console-based visual debugger for Python + ================================================ - .. image:: https://codecov.io/gh/inducer/pudb/branch/master/graph/badge.svg - :target: https://codecov.io/gh/inducer/pudb - - PuDB is a full-screen, console-based visual debugger for Python. + .. image:: https://gitlab.tiker.net/inducer/pudb/badges/master/pipeline.svg + :alt: Gitlab Build Status + :target: https://gitlab.tiker.net/inducer/pudb/commits/master + .. image:: https://dev.azure.com/ak-spam/inducer/_apis/build/status/inducer.pudb?branchName=master + :alt: Azure Build Status + :target: https://dev.azure.com/ak-spam/inducer/_build/latest?definitionId=18&branchName=master + .. image:: https://badge.fury.io/py/pudb.png + :alt: Python Package Index Release Page + :target: https://pypi.org/project/pudb/ Its goal is to provide all the niceties of modern GUI-based debuggers in a more lightweight and keyboard-friendly package. PuDB allows you to debug code @@ -55,7 +60,7 @@ * IPython integration (see `wiki <http://wiki.tiker.net/PuDB>`_) - * Should work with Python 2.6 and newer, including Python 3. + * Should work with Python 2.7 and newer, including Python 3. Links ----- @@ -89,7 +94,6 @@ Classifier: Operating System :: Unix Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pudb-2019.1/pudb.egg-info/SOURCES.txt new/pudb-2019.2/pudb.egg-info/SOURCES.txt --- old/pudb-2019.1/pudb.egg-info/SOURCES.txt 2019-04-25 22:41:48.000000000 +0200 +++ new/pudb-2019.2/pudb.egg-info/SOURCES.txt 2019-11-21 01:38:14.000000000 +0100 @@ -32,4 +32,5 @@ test/test_lowlevel.py test/test_make_canvas.py test/test_settings.py -test/test_source_code_providers.py \ No newline at end of file +test/test_source_code_providers.py +test/test_var_view.py \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pudb-2019.1/setup.py new/pudb-2019.2/setup.py --- old/pudb-2019.1/setup.py 2016-06-27 17:29:16.000000000 +0200 +++ new/pudb-2019.2/setup.py 2019-05-30 18:32:05.000000000 +0200 @@ -41,7 +41,6 @@ "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pudb-2019.1/test/test_lowlevel.py new/pudb-2019.2/test/test_lowlevel.py --- old/pudb-2019.1/test/test_lowlevel.py 2018-10-02 06:28:53.000000000 +0200 +++ new/pudb-2019.2/test/test_lowlevel.py 2019-11-21 01:23:23.000000000 +0100 @@ -32,3 +32,78 @@ assert unicode_lines == list(decode_lines(iter(lines))) else: assert [l.decode('utf-8') for l in lines] == list(decode_lines(iter(lines))) + + +# {{{ remove common indentation + +def _remove_common_indentation(code, require_leading_newline=True): + if "\n" not in code: + return code + + if require_leading_newline and not code.startswith("\n"): + return code + + lines = code.split("\n") + while lines[0].strip() == "": + lines.pop(0) + while lines[-1].strip() == "": + lines.pop(-1) + + if lines: + base_indent = 0 + while lines[0][base_indent] in " \t": + base_indent += 1 + + for line in lines[1:]: + if line[:base_indent].strip(): + raise ValueError("inconsistent indentation") + + return "\n".join(line[base_indent:] for line in lines) + +# }}} + + +def test_executable_lines(): + def get_exec_lines(src): + code = compile( + _remove_common_indentation(test_code), + "<tmp>", "exec") + from pudb.lowlevel import get_executable_lines_for_codes_recursive + return get_executable_lines_for_codes_recursive([code]) + + test_code = """ + def main(): + import pudb; pu.db + conf = ''. \\ + replace('', '') + + conf_tpl = '' # <-- imposible to set breakpoint here + + main() + """ + + assert get_exec_lines(test_code) == set([1, 2, 3, 4, 6, 8]) + + test_code = "a = 3*5\n" + 333 * "\n" + "b = 15" + if PY3: + assert get_exec_lines(test_code) == set([ + 1, + 128, # bogus, + 255, # bogus, + 335 + ]) + else: + assert get_exec_lines(test_code) == set([ + 1, + 256, # bogus, + 335 + ]) + + +if __name__ == "__main__": + import sys + if len(sys.argv) > 1: + exec(sys.argv[1]) + else: + from pytest import main + main([__file__]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pudb-2019.1/test/test_var_view.py new/pudb-2019.2/test/test_var_view.py --- old/pudb-2019.1/test/test_var_view.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pudb-2019.2/test/test_var_view.py 2019-05-30 18:32:05.000000000 +0200 @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +from pudb.py3compat import text_type + + +class A: + pass + + +class A2(object): + pass + + +def test_get_stringifier(): + from pudb.var_view import InspectInfo, get_stringifier + + try: + import numpy as np + except ImportError: + numpy_values = [] + else: + numpy_values = [np.float32(5), np.zeros(5)] + + for value in [ + A, A2, A(), A2(), u"lól".encode('utf8'), u"lól", + 1233123, [u"lól".encode('utf8'), u"lól"], + ] + numpy_values: + for display_type in ["type", "repr", "str"]: + iinfo = InspectInfo() + iinfo.display_type = display_type + + strifier = get_stringifier(iinfo) + + s = strifier(value) + assert isinstance(s, text_type)
