In case it might be useful to someone in a more informal form than a diff, here are the extracted changes as lines of code.
---------------------------------------
#
# Two pieces which allow the monitor to trigger reloading breakpoints.
#
In monitor.py In Monitor add a function
def reload_breakpoints(self, file):
if not self.pdb_obj:
return
# command defined and patched into place in sitecustomize.py
self.pdb_obj.reload_spyder_breakpoints( file )
and, in Monitor.__init__ register it
"reload_breakpoints":self.reload_breakpoints,
sitecustomize.py In SpyderPdb, add in the function for the monitor to use.
def reload_spyder_breakpoints(self, filename):
# TODO, fix this so that it just adds/removes the diffs, not all bps
from spyderlib.config import CONF
filename = self.canonic(filename)
self.clear_all_file_breaks( filename )
# load in new ones
CONF.load_from_ini()
if CONF.get('run', 'breakpoints/enabled', True):
breakpoints = CONF.get('run','breakpoints', {})
for fname, data in breakpoints.iteritems():
fname = self.canonic(fname)
if filename == fname: # add it
for linenumber, condition in data:
self.set_break(fname, linenumber, cond=condition)
#
# And three pieces which set it up so that the editor will trigger the loading
#
plugins/editor.py In Editor.save_breakpoints, add a final line
self.emit(SIGNAL("reload_spyder_breakpoints(QString)"), filename)
externalconsole.py In ExternalConsole.register_plugin, add a new registration
self.connect(self.main.editor,
SIGNAL("reload_spyder_breakpoints(QString)"),
self.reload_spyder_breakpoints)
and in ExternalConsole add the appropriate function
def reload_spyder_breakpoints(self, filename):
# ? Basically, works when the debugger is the top external console
# BTW, could do shellwidget.shell.ask_monitor(...)
# but the style seems to be to let the shell take care off
# asking the monitor.
shellwidget = self.tabwidget.currentWidget()
if shellwidget is not None:
shellwidget.shell.reload_breakpoints( filename )
pythonshell.py In ExtPythonShellWidget, add the function to ask the Monitor
def reload_breakpoints(self, file):
return self.ask_monitor("reload_breakpoints(r'%s')" % file)