[issue22083] Refactor PyShell's breakpoint related methods

Terry J. Reedy report at bugs.python.org
Wed Aug 6 07:41:56 CEST 2014


Terry J. Reedy added the comment:

The _here methods are the event handlers for the right click context menu options. Set_breakpoint, as a separate method, is only needed in the restore_file_breaks (from breakpoint file) method. I gather that you are thinking of using set/clear_breakpoint when a line number is clicked.

You have elsewhere suggested a different refactoring - replacing set and clear with toggle. That seems plausible as a good idea.  If text will have no breakpoints set after 
   self.text.update() # this enables setting "BREAK" tags to be visible
in restore_file_breaks(), there would be no problem. If not, toggle would need a force_set option. We need to know when the circumstances of when restore_file_breaks is called.

The bell is both undependable and uniformative. If breakpoints are not allowed for unnamed files, the context menu items should be grayed out (if possible, as done, for instance, for 'cut' when there is no selectionj).  If a line numbers is clicked for unnamed, we should display a message box explaining.

----------
stage:  -> needs patch
type:  -> enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22083>
_______________________________________


More information about the Python-bugs-list mailing list