Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #106 from matrixise/enable_disable_breakpoint

Enable/disable a breakpoint with a shortcut
  • Loading branch information...
commit 2f838f781361d75bb0985e6b30134ce4ae8259a1 2 parents 407b491 + 8830eba
@inducer authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 pudb/debugger.py
View
13 pudb/debugger.py
@@ -109,6 +109,7 @@ def newfunc(*fargs, **fkeywords):
enter - edit breakpoint
d - delete breakpoint
+ e - enable/disable breakpoint
License:
--------
@@ -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()
@@ -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))
Please sign in to comment.
Something went wrong with that request. Please try again.