Commit 4ed7905e authored by Jeremy Hylton's avatar Jeremy Hylton

rename the global IdleConfParser object from IdleConf to idleconf

standard usage is now from IdleConf import idleconf

replace : with = in config.txt
parent 390e7bd7
...@@ -4,7 +4,7 @@ import re ...@@ -4,7 +4,7 @@ import re
import keyword import keyword
from Tkinter import * from Tkinter import *
from Delegator import Delegator from Delegator import Delegator
from IdleConf import IdleConf from IdleConf import idleconf
#$ event <<toggle-auto-coloring>> #$ event <<toggle-auto-coloring>>
#$ win <Control-slash> #$ win <Control-slash>
...@@ -51,7 +51,7 @@ class ColorDelegator(Delegator): ...@@ -51,7 +51,7 @@ class ColorDelegator(Delegator):
apply(self.tag_configure, (tag,), cnf) apply(self.tag_configure, (tag,), cnf)
self.tag_raise('sel') self.tag_raise('sel')
cconf = IdleConf.getsection('Colors') cconf = idleconf.getsection('Colors')
tagdefs = { tagdefs = {
"COMMENT": cconf.getcolor("comment"), "COMMENT": cconf.getcolor("comment"),
......
...@@ -44,8 +44,8 @@ class IdleConfParser(ConfigParser): ...@@ -44,8 +44,8 @@ class IdleConfParser(ConfigParser):
return exts return exts
def reload(self): def reload(self):
global IdleConf global idleconf
IdleConf = IdleConfParser() idleconf = IdleConfParser()
load(_dir) # _dir is a global holding the last directory loaded load(_dir) # _dir is a global holding the last directory loaded
class SectionConfigParser: class SectionConfigParser:
...@@ -106,16 +106,8 @@ def load(dir): ...@@ -106,16 +106,8 @@ def load(dir):
except KeyError: except KeyError:
homedir = os.getcwd() homedir = os.getcwd()
for file in (os.path.join(dir, "config.txt"), idleconf.read((os.path.join(dir, "config.txt"), genplatfile, platfile,
genplatfile, os.path.join(homedir, ".idle")))
platfile,
os.path.join(homedir, ".idle"), idleconf = IdleConfParser()
):
try:
f = open(file)
except IOError:
continue
IdleConf.readfp(f)
f.close()
IdleConf = IdleConfParser()
...@@ -14,7 +14,7 @@ import string ...@@ -14,7 +14,7 @@ import string
import PyParse import PyParse
from AutoIndent import AutoIndent, index2line from AutoIndent import AutoIndent, index2line
from IdleConf import IdleConf from IdleConf import idleconf
class ParenMatch: class ParenMatch:
"""Highlight matching parentheses """Highlight matching parentheses
...@@ -56,8 +56,8 @@ class ParenMatch: ...@@ -56,8 +56,8 @@ class ParenMatch:
windows_keydefs = {} windows_keydefs = {}
unix_keydefs = {} unix_keydefs = {}
iconf = IdleConf.getsection('ParenMatch') iconf = idleconf.getsection('ParenMatch')
STYLE = iconf.get('style') STYLE = iconf.getdef('style', 'default')
FLASH_DELAY = iconf.getint('flash-delay') FLASH_DELAY = iconf.getint('flash-delay')
HILITE_CONFIG = iconf.getcolor('hilite') HILITE_CONFIG = iconf.getcolor('hilite')
BELL = iconf.getboolean('bell') BELL = iconf.getboolean('bell')
......
...@@ -16,7 +16,7 @@ from EditorWindow import EditorWindow, fixwordbreaks ...@@ -16,7 +16,7 @@ from EditorWindow import EditorWindow, fixwordbreaks
from FileList import FileList from FileList import FileList
from ColorDelegator import ColorDelegator from ColorDelegator import ColorDelegator
from OutputWindow import OutputWindow from OutputWindow import OutputWindow
from IdleConf import IdleConf from IdleConf import idleconf
import idlever import idlever
# We need to patch linecache.checkcache, because we don't want it # We need to patch linecache.checkcache, because we don't want it
...@@ -115,7 +115,7 @@ class ModifiedColorDelegator(ColorDelegator): ...@@ -115,7 +115,7 @@ class ModifiedColorDelegator(ColorDelegator):
ColorDelegator.recolorize_main(self) ColorDelegator.recolorize_main(self)
tagdefs = ColorDelegator.tagdefs.copy() tagdefs = ColorDelegator.tagdefs.copy()
cconf = IdleConf.getsection('Colors') cconf = idleconf.getsection('Colors')
tagdefs.update({ tagdefs.update({
"stdin": cconf.getcolor("stdin"), "stdin": cconf.getcolor("stdin"),
......
...@@ -18,28 +18,28 @@ ...@@ -18,28 +18,28 @@
# enable option with the value 0. # enable option with the value 0.
[EditorWindow] [EditorWindow]
width: 80 width= 80
height: 24 height= 24
# fonts defined in config-[win/unix].txt # fonts defined in config-[win/unix].txt
[Colors] [Colors]
normal-foreground: black normal-foreground= black
normal-background: white normal-background= white
# These color types are not explicitly defined: sync, todo, stdin # These color types are not explicitly defined= sync, todo, stdin
keyword-foreground: #ff7700 keyword-foreground= #ff7700
comment-foreground: #dd0000 comment-foreground= #dd0000
string-foreground: #00aa00 string-foreground= #00aa00
definition-foreground: #0000ff definition-foreground= #0000ff
hilite-foreground: #000068 hilite-foreground= #000068
hilite-background: #006868 hilite-background= #006868
break-foreground: #ff7777 break-foreground= #ff7777
hit-foreground: #ffffff hit-foreground= #ffffff
hit-background: #000000 hit-background= #000000
stdout-foreground: blue stdout-foreground= blue
stderr-foreground: red stderr-foreground= red
console-foreground: #770000 console-foreground= #770000
error-background: #ff7777 error-background= #ff7777
cursor-background: black cursor-background= black
[SearchBinding] [SearchBinding]
...@@ -56,9 +56,9 @@ cursor-background: black ...@@ -56,9 +56,9 @@ cursor-background: black
[CallTips] [CallTips]
[ParenMatch] [ParenMatch]
enable: 0 ; ParenMatch conflicts with CallTips enable= 0
style: expression style= expression
flash-delay: 500 flash-delay= 500
bell: 1 bell= 1
hilite-foreground: black hilite-foreground= black
hilite-background: #43cd80 ; SeaGreen3 hilite-background= #43cd80
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment