Skip to content

Commit

Permalink
Merge pull request #106 from matrixise/enable_disable_breakpoint
Browse files Browse the repository at this point in the history
Enable/disable a breakpoint with a shortcut
  • Loading branch information
inducer committed Feb 18, 2014
2 parents 407b491 + 8830eba commit 2f838f7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pudb/debugger.py
Expand Up @@ -109,6 +109,7 @@ def newfunc(*fargs, **fkeywords):
enter - edit breakpoint
d - delete breakpoint
e - enable/disable breakpoint
License:
--------
Expand Down Expand Up @@ -893,6 +894,17 @@ def delete_breakpoint(w, size, key):
else:
self.update_breakpoints()

def enable_disable_breakpoint(w, size, key):
bp_entry, pos = self.bp_list._w.get_focus()

if bp_entry is None:
return

bp = self._get_bp_list()[pos]
bp.enabled = not bp.enabled

self.update_breakpoints()

def examine_breakpoint(w, size, key):
bp_entry, pos = self.bp_list._w.get_focus()

Expand Down Expand Up @@ -967,6 +979,7 @@ def examine_breakpoint(w, size, key):
self.bp_list.listen("enter", examine_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("[", partial(change_rhs_box, 'breakpoints', 2, -1))
self.bp_list.listen("]", partial(change_rhs_box, 'breakpoints', 2, 1))
Expand Down

0 comments on commit 2f838f7

Please sign in to comment.