[Idle-dev] CVS: idle Debugger.py,1.7,1.8 EditorWindow.py,1.24,1.25 PyShell.py,1.17,1.18 RemoteDebugger.py,1.3,1.4
Kurt B. Kaiser
kbk@users.sourceforge.net
Mon, 24 Jun 2002 10:03:39 -0700
Update of /cvsroot/idlefork/idle
In directory usw-pr-cvs1:/tmp/cvs-serv4715
Modified Files:
Debugger.py EditorWindow.py PyShell.py RemoteDebugger.py
Log Message:
Clear associated breakpoints when closing an edit window.
M Debugger.py : Added clear_file_breaks()
M EditorWindow.py : Clear breaks when closed, commments->docstrings,
comment out some debugging print statements
M PyShell.py : comments->docstrings ; clarify extending EditorWindow
methods.
M RemoteDebugger.py: Add clear_all_file_breaks() functionality,
clarify some comments.
Index: Debugger.py
===================================================================
RCS file: /cvsroot/idlefork/idle/Debugger.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** Debugger.py 20 Jun 2002 04:01:47 -0000 1.7
--- Debugger.py 24 Jun 2002 17:03:35 -0000 1.8
***************
*** 321,336 ****
def clear_breakpoint_here(self, edit):
! text = edit.text
! filename = edit.io.filename
! if not filename:
! text.bell()
! return
! lineno = int(float(text.index("insert")))
! msg = self.idb.clear_break(filename, lineno)
! if msg:
! text.bell()
! return
! text.tag_remove("BREAK", "insert linestart",\
! "insert lineend +1char")
!
--- 321,346 ----
def clear_breakpoint_here(self, edit):
! text = edit.text
! filename = edit.io.filename
! if not filename:
! text.bell()
! return
! lineno = int(float(text.index("insert")))
! msg = self.idb.clear_break(filename, lineno)
! if msg:
! text.bell()
! return
! text.tag_remove("BREAK", "insert linestart",\
! "insert lineend +1char")
+ def clear_file_breaks(self, edit):
+ text = edit.text
+ filename = edit.io.filename
+ if not filename:
+ text.bell()
+ return
+ msg = self.idb.clear_all_file_breaks(filename)
+ if msg:
+ text.bell()
+ return
+ text.tag_delete("BREAK")
Index: EditorWindow.py
===================================================================
RCS file: /cvsroot/idlefork/idle/EditorWindow.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** EditorWindow.py 12 Jun 2002 03:28:57 -0000 1.24
--- EditorWindow.py 24 Jun 2002 17:03:37 -0000 1.25
***************
*** 491,496 ****
def ResetColorizer(self):
! #this function is called from configDialog.py
! #to update the colour theme if it is changed
if self.color:
self.color = self.ColorDelegator()
--- 491,496 ----
def ResetColorizer(self):
! "Update the colour theme if it is changed"
! # Called from configDialog.py
if self.color:
self.color = self.ColorDelegator()
***************
*** 498,503 ****
def ResetFont(self):
! #this function is called from configDialog.py
! #to update the text widgets' font if it is changed
fontWeight='normal'
if idleConf.GetOption('main','EditorWindow','font-bold',type='bool'):
--- 498,503 ----
def ResetFont(self):
! "Update the text widgets' font if it is changed"
! # Called from configDialog.py
fontWeight='normal'
if idleConf.GetOption('main','EditorWindow','font-bold',type='bool'):
***************
*** 508,513 ****
def ResetKeybindings(self):
! #this function is called from configDialog.py
! #to update the keybindings if they are changed
self.Bindings.default_keydefs=idleConf.GetCurrentKeySet()
keydefs = self.Bindings.default_keydefs
--- 508,513 ----
def ResetKeybindings(self):
! "Update the keybindings if they are changed"
! # Called from configDialog.py
self.Bindings.default_keydefs=idleConf.GetCurrentKeySet()
keydefs = self.Bindings.default_keydefs
***************
*** 541,545 ****
def ResetExtraHelpMenu(self):
! #load or update the Extra Help menu if required
menuList=idleConf.GetAllExtraHelpSourcesList()
helpMenu=self.menudict['help']
--- 541,545 ----
def ResetExtraHelpMenu(self):
! "Load or update the Extra Help menu if required"
menuList=idleConf.GetAllExtraHelpSourcesList()
helpMenu=self.menudict['help']
***************
*** 565,569 ****
def UpdateRecentFilesList(self,newFile=None):
! #load or update the recent files list, and menu if required
rfList=[]
if os.path.exists(self.recentFilesPath):
--- 565,569 ----
def UpdateRecentFilesList(self,newFile=None):
! "Load or update the recent files list, and menu if required"
rfList=[]
if os.path.exists(self.recentFilesPath):
***************
*** 579,584 ****
rfList.insert(0,newFile)
rfList=self.__CleanRecentFiles(rfList)
! print self.top.instanceDict
! print self
if rfList:
for instance in self.top.instanceDict.keys():
--- 579,585 ----
rfList.insert(0,newFile)
rfList=self.__CleanRecentFiles(rfList)
! #print self.flist.inversedict
! #print self.top.instanceDict
! #print self
if rfList:
for instance in self.top.instanceDict.keys():
***************
*** 696,703 ****
def _close(self):
! print self.io.filename
if self.io.filename:
self.UpdateRecentFilesList(newFile=self.io.filename)
!
WindowList.unregister_callback(self.postwindowsmenu)
if self.close_hook:
--- 697,706 ----
def _close(self):
! #print self.io.filename
if self.io.filename:
self.UpdateRecentFilesList(newFile=self.io.filename)
! shell = self.flist.pyshell
! if shell and shell.interp.debugger:
! shell.interp.debugger.clear_file_breaks(self)
WindowList.unregister_callback(self.postwindowsmenu)
if self.close_hook:
***************
*** 757,761 ****
if hasattr(ins, methodname):
self.text.bind(vevent, getattr(ins, methodname))
-
if hasattr(ins, "menudefs"):
self.fill_menus(ins.menudefs, keydefs)
--- 760,763 ----
***************
*** 772,777 ****
def fill_menus(self, defs=None, keydefs=None):
! # Fill the menus. Menus that are absent or None in
! # self.menudict are ignored.
if defs is None:
defs = self.Bindings.menudefs
--- 774,781 ----
def fill_menus(self, defs=None, keydefs=None):
! """Add appropriate entries to the menus and submenus
!
! Menus that are absent or None in self.menudict are ignored.
! """
if defs is None:
defs = self.Bindings.menudefs
Index: PyShell.py
===================================================================
RCS file: /cvsroot/idlefork/idle/PyShell.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** PyShell.py 20 Jun 2002 04:01:47 -0000 1.17
--- PyShell.py 24 Jun 2002 17:03:37 -0000 1.18
***************
*** 120,125 ****
class PyShellFileList(FileList):
!
! # File list when a shell is present
EditorWindow = PyShellEditorWindow
--- 120,124 ----
class PyShellFileList(FileList):
! "Extend base class: file list when a shell is present"
EditorWindow = PyShellEditorWindow
***************
*** 137,142 ****
class ModifiedColorDelegator(ColorDelegator):
!
! # Colorizer for the shell window itself
def __init__(self):
--- 136,140 ----
class ModifiedColorDelegator(ColorDelegator):
! "Extend base class: colorizer for the shell window itself"
def __init__(self):
***************
*** 162,167 ****
class ModifiedUndoDelegator(UndoDelegator):
!
! # Forbid insert/delete before the I/O mark
def insert(self, index, chars, tags=None):
--- 160,164 ----
class ModifiedUndoDelegator(UndoDelegator):
! "Extend base class: forbid insert/delete before the I/O mark"
def insert(self, index, chars, tags=None):
***************
*** 284,293 ****
def execsource(self, source):
! # Like runsource() but assumes complete exec source
filename = self.stuffsource(source)
self.execfile(filename, source)
def execfile(self, filename, source=None):
! # Execute an existing file
if source is None:
source = open(filename, "r").read()
--- 281,290 ----
def execsource(self, source):
! "Like runsource() but assumes complete exec source"
filename = self.stuffsource(source)
self.execfile(filename, source)
def execfile(self, filename, source=None):
! "Execute an existing file"
if source is None:
source = open(filename, "r").read()
***************
*** 301,305 ****
def runsource(self, source):
! # Extend base class to stuff the source in the line cache first
filename = self.stuffsource(source)
self.more = 0
--- 298,302 ----
def runsource(self, source):
! "Extend base class method: Stuff the source in the line cache first"
filename = self.stuffsource(source)
self.more = 0
***************
*** 314,318 ****
def stuffsource(self, source):
! # Stuff source in the filename cache
filename = "<pyshell#%d>" % self.gid
self.gid = self.gid + 1
--- 311,315 ----
def stuffsource(self, source):
! "Stuff source in the filename cache"
filename = "<pyshell#%d>" % self.gid
self.gid = self.gid + 1
***************
*** 322,327 ****
def showsyntaxerror(self, filename=None):
! # Extend base class to color the offending position
! # (instead of printing it and pointing at it with a caret)
text = self.tkconsole.text
stuff = self.unpackerror()
--- 319,328 ----
def showsyntaxerror(self, filename=None):
! """Extend base class method: Add Colorizing
!
! Color the offending position instead of printing it and pointing at it
! with a caret.
!
! """
text = self.tkconsole.text
stuff = self.unpackerror()
***************
*** 358,362 ****
def showtraceback(self):
! # Extend base class method to reset output properly
self.tkconsole.resetoutput()
self.checklinecache()
--- 359,363 ----
def showtraceback(self):
! "Extend base class method to reset output properly"
self.tkconsole.resetoutput()
self.checklinecache()
***************
*** 380,384 ****
def runcommand(self, code):
! # This runs the code without invoking the debugger.
# The code better not raise an exception!
if self.tkconsole.executing:
--- 381,385 ----
def runcommand(self, code):
! "Run the code without invoking the debugger"
# The code better not raise an exception!
if self.tkconsole.executing:
***************
*** 396,400 ****
def runcode(self, code):
! # Override base class method
if self.tkconsole.executing:
tkMessageBox.showerror(
--- 397,401 ----
def runcode(self, code):
! "Override base class method"
if self.tkconsole.executing:
tkMessageBox.showerror(
***************
*** 404,408 ****
master=self.tkconsole.text)
return
!
self.checklinecache()
if self.save_warnings_filters is not None:
--- 405,409 ----
master=self.tkconsole.text)
return
! #
self.checklinecache()
if self.save_warnings_filters is not None:
***************
*** 415,419 ****
(code,), {})
return
!
try:
self.tkconsole.beginexecuting()
--- 416,420 ----
(code,), {})
return
! #
try:
self.tkconsole.beginexecuting()
***************
*** 434,443 ****
except:
self.showtraceback()
!
finally:
self.tkconsole.endexecuting()
def write(self, s):
! # Override base class write
self.tkconsole.console.write(s)
--- 435,444 ----
except:
self.showtraceback()
! #
finally:
self.tkconsole.endexecuting()
def write(self, s):
! "Override base class method"
self.tkconsole.console.write(s)
***************
*** 566,570 ****
def endexecuting(self):
! # Helper for ModifiedInterpreter
##sys.settrace(None)
##self._cancel_check = None
--- 567,571 ----
def endexecuting(self):
! "Helper for ModifiedInterpreter"
##sys.settrace(None)
##self._cancel_check = None
***************
*** 574,578 ****
def close(self):
! # Extend base class method
if self.executing:
# XXX Need to ask a question here
--- 575,579 ----
def close(self):
! "Extend EditorWindow.close()"
if self.executing:
# XXX Need to ask a question here
***************
*** 587,593 ****
self.top.quit()
return "cancel"
! return OutputWindow.close(self)
def _close(self):
self.close_debugger()
self.interp.kill_subprocess()
--- 588,595 ----
self.top.quit()
return "cancel"
! return EditorWindow.close(self)
def _close(self):
+ "Extend EditorWindow._close(), shut down debugger and execution server"
self.close_debugger()
self.interp.kill_subprocess()
***************
*** 602,609 ****
self.flist.pyshell = None
self.history = None
! OutputWindow._close(self) # Really EditorWindow._close
def ispythonsource(self, filename):
! # Override this so EditorWindow never removes the colorizer
return 1
--- 604,611 ----
self.flist.pyshell = None
self.history = None
! EditorWindow._close(self)
def ispythonsource(self, filename):
! "Override EditorWindow method: never remove the colorizer"
return 1
***************
*** 782,788 ****
line = line[:i]
more = self.interp.runsource(line)
- # XXX This was causing extra prompt with shell KBK
- # if not more:
- # self.showprompt()
def cancel_check(self, frame, what, args,
--- 784,787 ----
Index: RemoteDebugger.py
===================================================================
RCS file: /cvsroot/idlefork/idle/RemoteDebugger.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** RemoteDebugger.py 20 Jun 2002 04:01:47 -0000 1.3
--- RemoteDebugger.py 24 Jun 2002 17:03:37 -0000 1.4
***************
*** 102,105 ****
--- 102,108 ----
msg = self.idb.clear_break(filename, lineno)
+ def clear_all_file_breaks(self, filename):
+ msg = self.idb.clear_all_file_breaks(filename)
+
#----------called by a FrameProxy----------
***************
*** 149,160 ****
value = dict[key]
value = repr(value)
- # try:
- # # Test for picklability
- # import cPickle
- # pklstr = cPickle.dumps(value)
- # except:
- # print >>sys.__stderr__, "** dict_item pickle failed: ", value
- # raise
- # #value = None
return value
--- 152,155 ----
***************
*** 166,172 ****
Start the subprocess side of the split debugger and set up that side of the
! RPC link by instantiating the GUIProxy, Idle debugger, and IdbAdapter
objects and linking them together. Register the IdbAdapter to handle RPC
! requests from the split Debugger GUI via the IdbProxy.
"""
--- 161,167 ----
Start the subprocess side of the split debugger and set up that side of the
! RPC link by instantiating the GUIProxy, Idb debugger, and IdbAdapter
objects and linking them together. Register the IdbAdapter to handle RPC
! requests from the split debugger GUI via the IdbProxy.
"""
***************
*** 317,320 ****
--- 312,319 ----
msg = self.call("clear_break", filename, lineno)
+ def clear_all_file_breaks(self, filename):
+ msg = self.call("clear_all_file_breaks", filename)
+
+
def start_remote_debugger(conn, pyshell):
"""Start the subprocess debugger, initialize the debugger GUI and RPC link
***************
*** 322,326 ****
Request the RPCServer start the Python subprocess debugger and link. Set
up the Idle side of the split debugger by instantiating the IdbProxy,
! Debugger GUI, and Debugger GUIAdapter objects and linking them together.
Register the GUIAdapter to handle debugger GUI interaction requests coming
--- 321,325 ----
Request the RPCServer start the Python subprocess debugger and link. Set
up the Idle side of the split debugger by instantiating the IdbProxy,
! debugger GUI, and debugger GUIAdapter objects and linking them together.
Register the GUIAdapter to handle debugger GUI interaction requests coming