Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
9930061c
Kaydet (Commit)
9930061c
authored
Kas 04, 2001
tarafından
Steven M. Gava
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
further config system work
üst
c99213f9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
17 deletions
+56
-17
PyShell.py
Lib/idlelib/PyShell.py
+9
-8
config-highlight.def
Lib/idlelib/config-highlight.def
+2
-2
configDialog.py
Lib/idlelib/configDialog.py
+35
-6
configHandler.py
Lib/idlelib/configHandler.py
+10
-1
No files found.
Lib/idlelib/PyShell.py
Dosyayı görüntüle @
9930061c
...
...
@@ -43,6 +43,7 @@ from ColorDelegator import ColorDelegator
from
UndoDelegator
import
UndoDelegator
from
OutputWindow
import
OutputWindow
,
OnDemandOutputWindow
from
IdleConf
import
idleconf
from
configHandler
import
idleConf
import
idlever
# We need to patch linecache.checkcache, because we don't want it
...
...
@@ -141,15 +142,15 @@ class ModifiedColorDelegator(ColorDelegator):
ColorDelegator
.
recolorize_main
(
self
)
tagdefs
=
ColorDelegator
.
tagdefs
.
copy
()
cconf
=
idleconf
.
getsection
(
'Colors'
)
theme
=
idleConf
.
GetOption
(
'main'
,
'Theme'
,
'name'
)
tagdefs
.
update
({
"stdin"
:
cconf
.
getcolor
(
"stdin"
),
"stdout"
:
cconf
.
getcolor
(
"stdout"
),
"stderr"
:
cconf
.
getcolor
(
"stderr"
),
"console"
:
cconf
.
getcolor
(
"console"
),
"ERROR"
:
cconf
.
getcolor
(
"ERROR"
),
None
:
cconf
.
getcolor
(
"normal"
),
"stdin"
:
idleConf
.
GetHighlight
(
theme
,
"stdin"
),
"stdout"
:
idleConf
.
GetHighlight
(
theme
,
"stdout"
),
"stderr"
:
idleConf
.
GetHighlight
(
theme
,
"stderr"
),
"console"
:
idleConf
.
GetHighlight
(
theme
,
"console"
),
"ERROR"
:
idleConf
.
GetHighlight
(
theme
,
"error"
),
None
:
idleConf
.
GetHighlight
(
theme
,
"normal"
),
})
...
...
Lib/idlelib/config-highlight.def
Dosyayı görüntüle @
9930061c
...
...
@@ -21,7 +21,7 @@ break-fontStyle= normal
hit-background= #000000
hit-foreground= #ffffff
hit-fontStyle= normal
cursor-
backg
round= black
cursor-
fore
round= black
error-background= #ff7777
#shell window
stdout-foreground= blue
...
...
@@ -48,7 +48,7 @@ hilite-background= #006868
break-foreground= #ff7777
hit-background= #000000
hit-foreground= #ffffff
cursor-
back
ground= black
cursor-
fore
ground= black
error-background= #ff7777
#shell window
stdout-foreground= blue
...
...
Lib/idlelib/configDialog.py
Dosyayı görüntüle @
9930061c
...
...
@@ -320,10 +320,11 @@ class ConfigDialog(Toplevel):
(
'#to choose items'
,
'comment'
),(
'
\n
'
,
'normal'
),(
'def'
,
'keyword'
),
(
' '
,
'normal'
),(
'func'
,
'definition'
),(
'(param):'
,
'normal'
),
(
'
\n
'
,
'normal'
),(
'"""string"""'
,
'string'
),(
'
\n
var0 = '
,
'normal'
),
(
"'string'"
,
'string'
),(
'
\n
var1 = '
,
'normal'
),(
"'selected'"
,
'selected'
),(
'
\n
var2 = '
,
'normal'
),
(
"'found'"
,
'found'
),(
'
\n\n
'
,
'normal'
),(
' error '
,
'error'
),
(
'cursor |'
,
'cursor'
),(
'
\n
'
,
'normal'
),(
'shell'
,
'shfg'
),(
' '
,
'normal'
),(
'stdout'
,
'shstdout'
),(
' '
,
'normal'
),
(
'stderr'
,
'shstderr'
))
(
"'string'"
,
'string'
),(
'
\n
var1 = '
,
'normal'
),(
"'selected'"
,
'selected'
),
(
'
\n
var2 = '
,
'normal'
),(
"'found'"
,
'found'
),(
'
\n\n
'
,
'normal'
),
(
' error '
,
'error'
),(
' '
,
'normal'
),(
'cursor |'
,
'cursor'
),
(
'
\n
'
,
'normal'
),(
'shell'
,
'shfg'
),(
' '
,
'normal'
),(
'stdout'
,
'shstdout'
),
(
' '
,
'normal'
),(
'stderr'
,
'shstderr'
),(
'
\n
'
,
'normal'
))
for
txTa
in
textAndTags
:
text
.
insert
(
END
,
txTa
[
0
],
txTa
[
1
])
for
element
in
self
.
themeElements
.
keys
():
...
...
@@ -535,8 +536,36 @@ class ConfigDialog(Toplevel):
return
frame
def
PaintThemeSample
(
self
):
pass
if
self
.
themeBuiltin
.
get
:
#a default theme
theme
=
self
.
builtinTheme
.
get
()
else
:
#a user theme
theme
=
self
.
customTheme
.
get
()
colours
=
idleConf
.
GetHighlight
(
theme
,
'normal'
)
#normalBg=colours['background']
apply
(
self
.
textHighlightSample
.
tag_config
,(
'normal'
,),
colours
)
colours
=
idleConf
.
GetHighlight
(
theme
,
'keyword'
)
apply
(
self
.
textHighlightSample
.
tag_config
,(
'keyword'
,),
colours
)
colours
=
idleConf
.
GetHighlight
(
theme
,
'comment'
)
apply
(
self
.
textHighlightSample
.
tag_config
,(
'comment'
,),
colours
)
colours
=
idleConf
.
GetHighlight
(
theme
,
'definition'
)
apply
(
self
.
textHighlightSample
.
tag_config
,(
'definition'
,),
colours
)
colours
=
idleConf
.
GetHighlight
(
theme
,
'string'
)
apply
(
self
.
textHighlightSample
.
tag_config
,(
'string'
,),
colours
)
colours
=
idleConf
.
GetHighlight
(
theme
,
'hilite'
)
apply
(
self
.
textHighlightSample
.
tag_config
,(
'selected'
,),
colours
)
colours
=
idleConf
.
GetHighlight
(
theme
,
'hit'
)
apply
(
self
.
textHighlightSample
.
tag_config
,(
'found'
,),
colours
)
colours
=
idleConf
.
GetHighlight
(
theme
,
'cursor'
)
apply
(
self
.
textHighlightSample
.
tag_config
,(
'cursor'
,),
colours
)
colours
=
idleConf
.
GetHighlight
(
theme
,
'error'
)
apply
(
self
.
textHighlightSample
.
tag_config
,(
'error'
,),
colours
)
colours
=
idleConf
.
GetHighlight
(
theme
,
'console'
)
apply
(
self
.
textHighlightSample
.
tag_config
,(
'shfg'
,),
colours
)
colours
=
idleConf
.
GetHighlight
(
theme
,
'stdout'
)
apply
(
self
.
textHighlightSample
.
tag_config
,(
'shstdout'
,),
colours
)
colours
=
idleConf
.
GetHighlight
(
theme
,
'stderr'
)
apply
(
self
.
textHighlightSample
.
tag_config
,(
'shstderr'
,),
colours
)
def
LoadFontCfg
(
self
):
##base editor font selection list
fonts
=
list
(
tkFont
.
families
(
self
))
...
...
Lib/idlelib/configHandler.py
Dosyayı görüntüle @
9930061c
...
...
@@ -5,7 +5,7 @@
##
##---------------------------------------------------------------------------##
"""
Provides access to configuration information
Provides access to
stored idle
configuration information
"""
import
os
...
...
@@ -153,8 +153,17 @@ class IdleConf:
return
cfgParser
.
sections
()
def
GetHighlight
(
self
,
theme
,
element
):
#get some fallback defaults
defaultFg
=
self
.
GetOption
(
'highlight'
,
theme
,
'normal'
+
"-foreground"
,
default
=
'#000000'
)
defaultBg
=
self
.
GetOption
(
'highlight'
,
theme
,
'normal'
+
"-background"
,
default
=
'#ffffff'
)
#try for requested element colours
fore
=
self
.
GetOption
(
'highlight'
,
theme
,
element
+
"-foreground"
)
back
=
self
.
GetOption
(
'highlight'
,
theme
,
element
+
"-background"
)
#fall back if required
if
not
fore
:
fore
=
defaultFg
if
not
back
:
back
=
defaultBg
return
{
"foreground"
:
fore
,
"background"
:
back
}
...
...
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