rename the global IdleConfParser object from IdleConf to idleconf

standard usage is now from IdleConf import idleconf

replace : with = in config.txt
This commit is contained in:
Jeremy Hylton 2000-03-07 17:55:32 +00:00
parent ba23bed340
commit 6b3edf0510
5 changed files with 39 additions and 47 deletions

View File

@ -4,7 +4,7 @@ import re
import keyword
from Tkinter import *
from Delegator import Delegator
from IdleConf import IdleConf
from IdleConf import idleconf
#$ event <<toggle-auto-coloring>>
#$ win <Control-slash>
@ -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"),

View File

@ -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()

View File

@ -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')

View File

@ -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"),

View File

@ -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