]> granicus.if.org Git - python/commitdiff
rename the global IdleConfParser object from IdleConf to idleconf
authorJeremy Hylton <jeremy@alum.mit.edu>
Tue, 7 Mar 2000 17:55:32 +0000 (17:55 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Tue, 7 Mar 2000 17:55:32 +0000 (17:55 +0000)
standard usage is now from IdleConf import idleconf

replace : with = in config.txt

Tools/idle/ColorDelegator.py
Tools/idle/IdleConf.py
Tools/idle/ParenMatch.py
Tools/idle/PyShell.py
Tools/idle/config.txt

index 212afa5ed89e9f9648c4d523991b7b223c0dc19a..77edfe85854091eead9219a4518910302166b37e 100644 (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"),
index 807f183a3bd9ce11bc1c148689a623f254b3ba0d..36cad5110808656f4f5281157cea4fb9ccba31e6 100644 (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()
+
index 9f9e2ea06b4d1f75f340dd1a95798718b1a61b64..a607e49a0ed51e579672bc58217925e6273f21a5 100644 (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')
index 6a4712ef6a80e1b2ea7bcb1277134d74330620e4..6e2673833ac789408778b5ed85dbd9cf1ada9152 100644 (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"),
index 545ac3c0f4e4806f37fab63e4885ddb9999972c3..c1d96c1fd0f91f31adbd0198afce10233f1ee291 100644 (file)
 # 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