migrate to use of IdleConf and config files to set options
idle.py:
Load the config files before anything else happens
XXX Need to define standard way to get files relative to the
IDLE install dir
PyShell.py:
ColorDelegator.py:
Get color defns out of IdleConf instead of IdlePrefs
EditorWindow.py:
Replace hard-coded font & window size with config options
Get extension names via IdleConf.getextensions
extend.py:
Obsolete. Extensions defined in config file.
ParenMatch.py:
Use config file for extension options.
Revise comment about parser requirements.
Simplify logic on find returning None.
diff --git a/Tools/idle/PyShell.py b/Tools/idle/PyShell.py
index 8c93f4d..1e2f1ae 100644
--- a/Tools/idle/PyShell.py
+++ b/Tools/idle/PyShell.py
@@ -16,6 +16,7 @@
from FileList import FileList
from ColorDelegator import ColorDelegator
from OutputWindow import OutputWindow
+from IdleConf import IdleConf
import idlever
# We need to patch linecache.checkcache, because we don't want it
@@ -114,21 +115,15 @@
ColorDelegator.recolorize_main(self)
tagdefs = ColorDelegator.tagdefs.copy()
- cprefs = ColorDelegator.cprefs
+ cconf = IdleConf.getsection('Colors')
tagdefs.update({
- "stdin": {"foreground": cprefs.CStdIn[0],
- "background": cprefs.CStdIn[1]},
- "stdout": {"foreground": cprefs.CStdOut[0],
- "background": cprefs.CStdOut[1]},
- "stderr": {"foreground": cprefs.CStdErr[0],
- "background": cprefs.CStdErr[1]},
- "console": {"foreground": cprefs.CConsole[0],
- "background": cprefs.CConsole[1]},
- "ERROR": {"background": cprefs.CError[0],
- "background": cprefs.CError[1]},
- None: {"foreground": cprefs.CNormal[0],
- "background": cprefs.CNormal[1]},
+ "stdin": cconf.getcolor("stdin"),
+ "stdout": cconf.getcolor("stdout"),
+ "stderr": cconf.getcolor("stderr"),
+ "console": cconf.getcolor("console"),
+ "ERROR": cconf.getcolor("ERROR"),
+ None: cconf.getcolor("normal"),
})