From 6b3edf051009ec94f65efb2817f6344cf0531480 Mon Sep 17 00:00:00 2001 From: Jeremy Hylton Date: Tue, 7 Mar 2000 17:55:32 +0000 Subject: rename the global IdleConfParser object from IdleConf to idleconf standard usage is now from IdleConf import idleconf replace : with = in config.txt --- Tools/idle/ColorDelegator.py | 4 ++-- Tools/idle/IdleConf.py | 24 +++++++-------------- Tools/idle/ParenMatch.py | 6 +++--- Tools/idle/PyShell.py | 4 ++-- Tools/idle/config.txt | 50 ++++++++++++++++++++++---------------------- 5 files changed, 40 insertions(+), 48 deletions(-) diff --git a/Tools/idle/ColorDelegator.py b/Tools/idle/ColorDelegator.py index 212afa5..77edfe8 100644 --- a/Tools/idle/ColorDelegator.py +++ b/Tools/idle/ColorDelegator.py @@ -4,7 +4,7 @@ import re import keyword from Tkinter import * from Delegator import Delegator -from IdleConf import IdleConf +from IdleConf import idleconf #$ event <> #$ win @@ -51,7 +51,7 @@ class ColorDelegator(Delegator): apply(self.tag_configure, (tag,), cnf) self.tag_raise('sel') - cconf = IdleConf.getsection('Colors') + cconf = idleconf.getsection('Colors') tagdefs = { "COMMENT": cconf.getcolor("comment"), diff --git a/Tools/idle/IdleConf.py b/Tools/idle/IdleConf.py index 807f183..36cad51 100644 --- a/Tools/idle/IdleConf.py +++ b/Tools/idle/IdleConf.py @@ -44,8 +44,8 @@ class IdleConfParser(ConfigParser): return exts def reload(self): - global IdleConf - IdleConf = IdleConfParser() + global idleconf + idleconf = IdleConfParser() load(_dir) # _dir is a global holding the last directory loaded class SectionConfigParser: @@ -105,17 +105,9 @@ def load(dir): homedir = os.environ['HOME'] except KeyError: homedir = os.getcwd() - - for file in (os.path.join(dir, "config.txt"), - genplatfile, - platfile, - os.path.join(homedir, ".idle"), - ): - try: - f = open(file) - except IOError: - continue - IdleConf.readfp(f) - f.close() - -IdleConf = IdleConfParser() + + idleconf.read((os.path.join(dir, "config.txt"), genplatfile, platfile, + os.path.join(homedir, ".idle"))) + +idleconf = IdleConfParser() + diff --git a/Tools/idle/ParenMatch.py b/Tools/idle/ParenMatch.py index 9f9e2ea..a607e49 100644 --- a/Tools/idle/ParenMatch.py +++ b/Tools/idle/ParenMatch.py @@ -14,7 +14,7 @@ import string import PyParse from AutoIndent import AutoIndent, index2line -from IdleConf import IdleConf +from IdleConf import idleconf class ParenMatch: """Highlight matching parentheses @@ -56,8 +56,8 @@ class ParenMatch: windows_keydefs = {} unix_keydefs = {} - iconf = IdleConf.getsection('ParenMatch') - STYLE = iconf.get('style') + iconf = idleconf.getsection('ParenMatch') + STYLE = iconf.getdef('style', 'default') FLASH_DELAY = iconf.getint('flash-delay') HILITE_CONFIG = iconf.getcolor('hilite') BELL = iconf.getboolean('bell') diff --git a/Tools/idle/PyShell.py b/Tools/idle/PyShell.py index 6a4712e..6e26738 100644 --- a/Tools/idle/PyShell.py +++ b/Tools/idle/PyShell.py @@ -16,7 +16,7 @@ from EditorWindow import EditorWindow, fixwordbreaks from FileList import FileList from ColorDelegator import ColorDelegator from OutputWindow import OutputWindow -from IdleConf import IdleConf +from IdleConf import idleconf import idlever # We need to patch linecache.checkcache, because we don't want it @@ -115,7 +115,7 @@ class ModifiedColorDelegator(ColorDelegator): ColorDelegator.recolorize_main(self) tagdefs = ColorDelegator.tagdefs.copy() - cconf = IdleConf.getsection('Colors') + cconf = idleconf.getsection('Colors') tagdefs.update({ "stdin": cconf.getcolor("stdin"), diff --git a/Tools/idle/config.txt b/Tools/idle/config.txt index 545ac3c..c1d96c1 100644 --- a/Tools/idle/config.txt +++ b/Tools/idle/config.txt @@ -18,28 +18,28 @@ # enable option with the value 0. [EditorWindow] -width: 80 -height: 24 +width= 80 +height= 24 # fonts defined in config-[win/unix].txt [Colors] -normal-foreground: black -normal-background: white -# These color types are not explicitly defined: sync, todo, stdin -keyword-foreground: #ff7700 -comment-foreground: #dd0000 -string-foreground: #00aa00 -definition-foreground: #0000ff -hilite-foreground: #000068 -hilite-background: #006868 -break-foreground: #ff7777 -hit-foreground: #ffffff -hit-background: #000000 -stdout-foreground: blue -stderr-foreground: red -console-foreground: #770000 -error-background: #ff7777 -cursor-background: black +normal-foreground= black +normal-background= white +# These color types are not explicitly defined= sync, todo, stdin +keyword-foreground= #ff7700 +comment-foreground= #dd0000 +string-foreground= #00aa00 +definition-foreground= #0000ff +hilite-foreground= #000068 +hilite-background= #006868 +break-foreground= #ff7777 +hit-foreground= #ffffff +hit-background= #000000 +stdout-foreground= blue +stderr-foreground= red +console-foreground= #770000 +error-background= #ff7777 +cursor-background= black [SearchBinding] @@ -56,9 +56,9 @@ cursor-background: black [CallTips] [ParenMatch] -enable: 0 ; ParenMatch conflicts with CallTips -style: expression -flash-delay: 500 -bell: 1 -hilite-foreground: black -hilite-background: #43cd80 ; SeaGreen3 +enable= 0 +style= expression +flash-delay= 500 +bell= 1 +hilite-foreground= black +hilite-background= #43cd80 -- cgit v0.12