mirror of
https://github.com/python/cpython.git
synced 2025-09-10 18:58:35 +00:00
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.
This commit is contained in:
parent
583abb8027
commit
e81f28b630
6 changed files with 51 additions and 86 deletions
|
@ -16,6 +16,7 @@ from EditorWindow import EditorWindow, fixwordbreaks
|
|||
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 @@ class ModifiedColorDelegator(ColorDelegator):
|
|||
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"),
|
||||
})
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue