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
9f25e67d
Kaydet (Commit)
9f25e67d
authored
Şub 11, 2002
tarafından
Steven M. Gava
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
base GetHighlight on GetThemeDict for better defaults
üst
46fa7bf8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
20 deletions
+9
-20
configDialog.py
Lib/idlelib/configDialog.py
+0
-2
configHandler.py
Lib/idlelib/configHandler.py
+9
-18
No files found.
Lib/idlelib/configDialog.py
Dosyayı görüntüle @
9f25e67d
...
...
@@ -518,7 +518,6 @@ class ConfigDialog(Toplevel):
self
.
changedItems
=
{
'main'
:{},
'highlight'
:{},
'keys'
:{},
'extensions'
:{}}
def
AddChangedItem
(
self
,
type
,
section
,
item
,
value
):
print
type
,
section
,
item
,
value
value
=
str
(
value
)
#make sure we use a string
if
not
self
.
changedItems
[
type
]
.
has_key
(
section
):
self
.
changedItems
[
type
][
section
]
=
{}
...
...
@@ -679,7 +678,6 @@ class ConfigDialog(Toplevel):
theme
=
self
.
customTheme
.
get
()
themeElement
=
sampleElement
+
'-'
+
plane
self
.
AddChangedItem
(
'highlight'
,
theme
,
themeElement
,
newColour
)
print
self
.
changedItems
[
'highlight'
][
theme
]
def
GetNewThemeName
(
self
,
message
):
usedNames
=
idleConf
.
GetSectionList
(
'user'
,
'highlight'
)
...
...
Lib/idlelib/configHandler.py
Dosyayı görüntüle @
9f25e67d
...
...
@@ -238,21 +238,15 @@ class IdleConf:
containing fg and bg colours (appropriate for passing to Tkinter in,
e.g., a tag_config call), otherwise fg or bg colour only as specified.
"""
#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
=
None
if
element
==
'cursor'
:
#there is no config value for cursor bg
back
=
None
if
self
.
defaultCfg
[
'highlight'
]
.
has_section
(
theme
):
themeDict
=
self
.
GetThemeDict
(
'default'
,
theme
)
else
:
themeDict
=
self
.
GetThemeDict
(
'user'
,
theme
)
fore
=
themeDict
[
element
+
'-foreground'
]
if
element
==
'cursor'
:
#there is no config value for cursor bg
back
=
themeDict
[
'normal-background'
]
else
:
back
=
self
.
GetOption
(
'highlight'
,
theme
,
element
+
"-background"
)
#fall back if required
if
not
fore
:
fore
=
defaultFg
if
not
back
:
back
=
defaultBg
back
=
themeDict
[
element
+
'-background'
]
highlight
=
{
"foreground"
:
fore
,
"background"
:
back
}
if
not
fgBg
:
#return dict of both colours
return
highlight
...
...
@@ -263,7 +257,7 @@ class IdleConf:
return
highlight
[
"background"
]
else
:
raise
'Invalid fgBg specified'
def
GetThemeDict
(
self
,
type
,
themeName
):
"""
type - string, 'default' or 'user' theme type
...
...
@@ -311,8 +305,6 @@ class IdleConf:
'console-foreground'
:
'#000000'
,
'console-background'
:
'#ffffff'
}
for
element
in
theme
.
keys
():
print
'themeName:'
,
themeName
,
'theme exists:'
,
cfgParser
.
has_section
(
themeName
)
if
not
cfgParser
.
has_option
(
themeName
,
element
):
#we are going to return a default, print warning
warning
=
(
'
\n
Warning: configHandler.py - IdleConf.GetThemeDict'
+
...
...
@@ -385,7 +377,6 @@ class IdleConf:
for
event
in
self
.
GetExtensionKeys
(
extn
)
.
keys
():
if
event
==
vEvent
:
extName
=
extn
print
extName
return
extName
def
GetExtensionKeys
(
self
,
extensionName
):
...
...
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