import PyShell
from WindowList import ListedToplevel
from TreeWidget import TreeNode, TreeItem, ScrolledCanvas
+from configHandler import idleConf
class ClassBrowser:
self.settitle()
top.focus_set()
# create scrolled canvas
- sc = ScrolledCanvas(top, bg="white", highlightthickness=0, takefocus=1)
+ theme = idleConf.GetOption('main','Theme','name')
+ background = idleConf.GetHighlight(theme, 'normal')['background']
+ sc = ScrolledCanvas(top, bg=background, highlightthickness=0, takefocus=1)
sc.frame.pack(expand=1, fill="both")
item = self.rootnode()
self.node = node = TreeNode(sc.canvas, None, item)
import time
import re
import keyword
+import __builtin__
from Tkinter import *
from Delegator import Delegator
from configHandler import idleConf
def make_pat():
kw = r"\b" + any("KEYWORD", keyword.kwlist) + r"\b"
+ builtinlist = [str(name) for name in dir(__builtin__)
+ if not name.startswith('_')]
+ builtin = r"([^\\.]\b|^)" + any("BUILTIN", builtinlist) + r"\b"
comment = any("COMMENT", [r"#[^\n]*"])
sqstring = r"(\b[rR])?'[^'\\\n]*(\\.[^'\\\n]*)*'?"
dqstring = r'(\b[rR])?"[^"\\\n]*(\\.[^"\\\n]*)*"?'
sq3string = r"(\b[rR])?'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?"
dq3string = r'(\b[rR])?"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?'
string = any("STRING", [sq3string, dq3string, sqstring, dqstring])
- return kw + "|" + comment + "|" + string + "|" + any("SYNC", [r"\n"])
+ return kw + "|" + builtin + "|" + comment + "|" + string + "|" + any("SYNC", [r"\n"])
prog = re.compile(make_pat(), re.S)
idprog = re.compile(r"\s+(\w+)", re.S)
self.tagdefs = {
"COMMENT": idleConf.GetHighlight(theme, "comment"),
"KEYWORD": idleConf.GetHighlight(theme, "keyword"),
+ "BUILTIN": idleConf.GetHighlight(theme, "builtin"),
"STRING": idleConf.GetHighlight(theme, "string"),
"DEFINITION": idleConf.GetHighlight(theme, "definition"),
"SYNC": {'background':None,'foreground':None},
"hit": idleConf.GetHighlight(theme, "hit"),
}
- if DEBUG: print 'tagdefs',tagdefs
+ if DEBUG: print 'tagdefs',self.tagdefs
def insert(self, index, chars, tags=None):
index = self.index(index)
if self.color:
self.color = self.ColorDelegator()
self.per.insertfilter(self.color)
+ theme = idleConf.GetOption('main','Theme','name')
+ self.text.config(idleConf.GetHighlight(theme, "normal"))
def ResetFont(self):
"Update the text widgets' font if it is changed"
*Release date: XX-XXX-2004*
+- Add a highlight theme for builtin keywords. Python Patch 805830 Nigel Rowe
+
- rpc.py:SocketIO - Large modules were generating large pickles when downloaded
to the execution server. The return of the OK response from the subprocess
initialization was interfering and causing the sending socket to be not
item = RemoteObjectBrowser.StubObjectTreeItem(self.rpcclt, oid)
from TreeWidget import ScrolledCanvas, TreeNode
top = Toplevel(self.tkconsole.root)
- sc = ScrolledCanvas(top, bg="white", highlightthickness=0)
+ theme = idleConf.GetOption('main','Theme','name')
+ background = idleConf.GetHighlight(theme, 'normal')['background']
+ sc = ScrolledCanvas(top, bg=background, highlightthickness=0)
sc.frame.pack(expand=1, fill="both")
node = TreeNode(sc.canvas, None, item)
node.expand()
import imp
import ZoomHeight
+from configHandler import idleConf
ICONDIR = "Icons"
except AttributeError:
# padding carefully selected (on Windows) to match Entry widget:
self.label = Label(self.canvas, text=text, bd=0, padx=2, pady=2)
+ theme = idleConf.GetOption('main','Theme','name')
if self.selected:
- self.label.configure(fg="white", bg="darkblue")
+ self.label.configure(idleConf.GetHighlight(theme, 'hilite'))
else:
- self.label.configure(fg="black", bg="white")
+ self.label.configure(idleConf.GetHighlight(theme, 'normal'))
id = self.canvas.create_window(textx, texty,
anchor="nw", window=self.label)
self.label.bind("<1>", self.select_or_edit)
normal-background= #ffffff
keyword-foreground= #ff7700
keyword-background= #ffffff
+builtin-foreground= #ca00ca
+builtin-background= #ffffff
comment-foreground= #dd0000
comment-background= #ffffff
string-foreground= #00aa00
normal-background= #ffffff
keyword-foreground= #ff7700
keyword-background= #ffffff
+builtin-foreground= #ca00ca
+builtin-background= #ffffff
comment-foreground= #dd0000
comment-background= #ffffff
string-foreground= #00aa00
self.themeElements={'Normal Text':('normal','00'),
'Python Keywords':('keyword','01'),
'Python Definitions':('definition','02'),
- 'Python Comments':('comment','03'),
- 'Python Strings':('string','04'),
- 'Selected Text':('hilite','05'),
- 'Found Text':('hit','06'),
- 'Cursor':('cursor','07'),
- 'Error Text':('error','08'),
- 'Shell Normal Text':('console','09'),
- 'Shell Stdout Text':('stdout','10'),
- 'Shell Stderr Text':('stderr','11')}
+ 'Python Builtins':('builtin', '03'),
+ 'Python Comments':('comment','04'),
+ 'Python Strings':('string','05'),
+ 'Selected Text':('hilite','06'),
+ 'Found Text':('hit','07'),
+ 'Cursor':('cursor','08'),
+ 'Error Text':('error','09'),
+ 'Shell Normal Text':('console','10'),
+ 'Shell Stdout Text':('stdout','11'),
+ 'Shell Stderr Text':('stderr','12'),
+ }
self.ResetChangedItems() #load initial values in changed items dict
self.CreateWidgets()
self.resizable(height=FALSE,width=FALSE)
(' ','normal'),('func','definition'),('(param):','normal'),
('\n ','normal'),('"""string"""','string'),('\n var0 = ','normal'),
("'string'",'string'),('\n var1 = ','normal'),("'selected'",'hilite'),
- ('\n var2 = ','normal'),("'found'",'hit'),('\n\n','normal'),
+ ('\n var2 = ','normal'),("'found'",'hit'),
+ ('\n var3 = ','normal'),('list', 'builtin'), ('(','normal'),
+ ('None', 'builtin'),(')\n\n','normal'),
(' error ','error'),(' ','normal'),('cursor |','cursor'),
('\n ','normal'),('shell','console'),(' ','normal'),('stdout','stdout'),
(' ','normal'),('stderr','stderr'),('\n','normal'))
'normal-background':'#ffffff',
'keyword-foreground':'#000000',
'keyword-background':'#ffffff',
+ 'builtin-foreground':'#000000',
+ 'builtin-background':'#ffffff',
'comment-foreground':'#000000',
'comment-background':'#ffffff',
'string-foreground':'#000000',