Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e16d94b7
Commit
e16d94b7
authored
Nov 03, 2001
by
Steven M. Gava
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more work to support new config system
parent
dedbe255
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
121 additions
and
87 deletions
+121
-87
Lib/idlelib/ColorDelegator.py
Lib/idlelib/ColorDelegator.py
+12
-10
Lib/idlelib/configDialog.py
Lib/idlelib/configDialog.py
+103
-68
Lib/idlelib/configHandler.py
Lib/idlelib/configHandler.py
+6
-9
No files found.
Lib/idlelib/ColorDelegator.py
View file @
e16d94b7
...
...
@@ -4,7 +4,7 @@ import re
import
keyword
from
Tkinter
import
*
from
Delegator
import
Delegator
from
IdleConf
import
idlec
onf
from
configHandler
import
idleC
onf
#$ event <<toggle-auto-coloring>>
#$ win <Control-slash>
...
...
@@ -53,19 +53,21 @@ class ColorDelegator(Delegator):
apply
(
self
.
tag_configure
,
(
tag
,),
cnf
)
self
.
tag_raise
(
'sel'
)
cconf
=
idleconf
.
getsection
(
'Colors
'
)
theme
=
idleConf
.
GetOption
(
'main'
,
'Theme'
,
'name
'
)
tagdefs
=
{
"COMMENT"
:
cconf
.
getcolor
(
"comment"
),
"KEYWORD"
:
cconf
.
getcolor
(
"keyword"
),
"STRING"
:
cconf
.
getcolor
(
"string"
),
"DEFINITION"
:
cconf
.
getcolor
(
"definition"
),
"SYNC"
:
cconf
.
getcolor
(
"sync"
),
"TODO"
:
cconf
.
getcolor
(
"todo"
),
"BREAK"
:
cconf
.
getcolor
(
"break"
),
"COMMENT"
:
idleConf
.
GetHighlight
(
theme
,
"comment"
),
"KEYWORD"
:
idleConf
.
GetHighlight
(
theme
,
"keyword"
),
"STRING"
:
idleConf
.
GetHighlight
(
theme
,
"string"
),
"DEFINITION"
:
idleConf
.
GetHighlight
(
theme
,
"definition"
),
"SYNC"
:
idleConf
.
GetHighlight
(
theme
,
"sync"
),
"TODO"
:
idleConf
.
GetHighlight
(
theme
,
"todo"
),
"BREAK"
:
idleConf
.
GetHighlight
(
theme
,
"break"
),
# The following is used by ReplaceDialog:
"hit"
:
cconf
.
getcolor
(
"hit"
),
"hit"
:
idleConf
.
GetHighlight
(
theme
,
"hit"
),
}
print
tagdefs
def
insert
(
self
,
index
,
chars
,
tags
=
None
):
index
=
self
.
index
(
index
)
...
...
Lib/idlelib/configDialog.py
View file @
e16d94b7
This diff is collapsed.
Click to expand it.
Lib/idlelib/configHandler.py
View file @
e16d94b7
...
...
@@ -49,14 +49,6 @@ class IdleConfParser(ConfigParser):
else
:
#return a default value
return
[]
def
GetHighlight
(
self
,
theme
,
element
):
fore
=
self
.
Get
(
theme
,
element
+
"-foreground"
)
back
=
self
.
Get
(
theme
,
element
+
"-background"
)
style
=
self
.
Ge
(
theme
,
element
+
"-fontStyle"
,
default
=
''
)
return
{
"fg"
:
fore
,
"bg"
:
back
,
"fStyle"
:
style
}
def
Load
(
self
):
"""
Load the configuration file from disk
...
...
@@ -160,7 +152,12 @@ class IdleConf:
return
cfgParser
.
sections
()
def
GetHighlight
(
self
,
theme
,
element
):
fore
=
self
.
GetOption
(
'highlight'
,
theme
,
element
+
"-foreground"
)
back
=
self
.
GetOption
(
'highlight'
,
theme
,
element
+
"-background"
)
return
{
"foreground"
:
fore
,
"background"
:
back
}
def
GetTheme
(
self
,
name
=
None
):
"""
Gets the requested theme or returns a final fallback theme in case
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment