[Python-checkins] cpython (2.7): Issue #14105: Stop removing breakpoints from Idle editors.

terry.reedy python-checkins at python.org
Sat Aug 9 05:34:08 CEST 2014


http://hg.python.org/cpython/rev/76ca8569a04c
changeset: 92043:76ca8569a04c
branch: 2.7
parent: 92032:cbcb10123451
user: Terry Jan Reedy <tjreedy at udel.edu>
date: Fri Aug 08 23:33:11 2014 -0400
summary:
 Issue #14105: Stop removing breakpoints from Idle editors.
Move BREAK tag configuration to PyShellEditorWindow.
files:
 Lib/idlelib/ColorDelegator.py | 1 -
 Lib/idlelib/PyShell.py | 10 ++++++++++
 2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/Lib/idlelib/ColorDelegator.py b/Lib/idlelib/ColorDelegator.py
--- a/Lib/idlelib/ColorDelegator.py
+++ b/Lib/idlelib/ColorDelegator.py
@@ -74,7 +74,6 @@
 "DEFINITION": idleConf.GetHighlight(theme, "definition"),
 "SYNC": {'background':None,'foreground':None},
 "TODO": {'background':None,'foreground':None},
- "BREAK": idleConf.GetHighlight(theme, "break"),
 "ERROR": idleConf.GetHighlight(theme, "error"),
 # The following is used by ReplaceDialog:
 "hit": idleConf.GetHighlight(theme, "hit"),
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -143,6 +143,7 @@
 self.io.set_filename_change_hook(filename_changed_hook)
 if self.io.filename:
 self.restore_file_breaks()
+ self.color_breakpoint_text()
 
 rmenu_specs = [
 ("Cut", "<<cut>>", "rmenu_check_cut"),
@@ -152,6 +153,15 @@
 ("Clear Breakpoint", "<<clear-breakpoint-here>>", None)
 ]
 
+ def color_breakpoint_text(self, color=True):
+ "Turn colorizing of breakpoint text on or off"
+ if color:
+ theme = idleConf.GetOption('main','Theme','name')
+ cfg = idleConf.GetHighlight(theme, "break")
+ else:
+ cfg = {'foreground': '', 'background': ''}
+ self.text.tag_config('BREAK', cfg)
+
 def set_breakpoint(self, lineno):
 text = self.text
 filename = self.io.filename
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /