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
41a8532f
Kaydet (Commit)
41a8532f
authored
Eki 29, 2001
tarafından
Steven M. Gava
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
more of config dialog reading from files
üst
9bd1401b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
38 deletions
+82
-38
config-main.def
Lib/idlelib/config-main.def
+2
-2
configDialog.py
Lib/idlelib/configDialog.py
+71
-29
configHandler.py
Lib/idlelib/configHandler.py
+6
-5
dynOptionMenuWidget.py
Lib/idlelib/dynOptionMenuWidget.py
+3
-2
No files found.
Lib/idlelib/config-main.def
Dosyayı görüntüle @
41a8532f
...
@@ -59,11 +59,11 @@ tab-cols= 4
...
@@ -59,11 +59,11 @@ tab-cols= 4
[Theme]
[Theme]
user= 0
user= 0
name=
"IDLE Classic New"
name=
IDLE Classic New
[Keys]
[Keys]
user= 0
user= 0
name=
"IDLE Classic - windows"
name=
IDLE Classic - windows
[RecentFiles]
[RecentFiles]
1=
1=
...
...
Lib/idlelib/configDialog.py
Dosyayı görüntüle @
41a8532f
...
@@ -131,6 +131,12 @@ class ConfigDialog(Toplevel):
...
@@ -131,6 +131,12 @@ class ConfigDialog(Toplevel):
def
SetFontSample
(
self
):
def
SetFontSample
(
self
):
self
.
editFont
.
config
(
size
=
self
.
fontSize
.
get
(),
weight
=
NORMAL
,
self
.
editFont
.
config
(
size
=
self
.
fontSize
.
get
(),
weight
=
NORMAL
,
family
=
self
.
listFontName
.
get
(
self
.
listFontName
.
curselection
()[
0
]))
family
=
self
.
listFontName
.
get
(
self
.
listFontName
.
curselection
()[
0
]))
def
SetHighlightSampleBinding
(
self
,
event
):
self
.
SetHighlightSample
()
def
SetHighlightSample
(
self
):
pass
def
CreateWidgets
(
self
):
def
CreateWidgets
(
self
):
self
.
framePages
=
Frame
(
self
)
self
.
framePages
=
Frame
(
self
)
...
@@ -287,8 +293,8 @@ class ConfigDialog(Toplevel):
...
@@ -287,8 +293,8 @@ class ConfigDialog(Toplevel):
frameFontSet
=
Frame
(
frameSet
)
frameFontSet
=
Frame
(
frameSet
)
labelCustomTitle
=
Label
(
frameCustom
,
text
=
'Set Custom Highlighting'
)
labelCustomTitle
=
Label
(
frameCustom
,
text
=
'Set Custom Highlighting'
)
labelTargetTitle
=
Label
(
self
.
frameHighlightTarget
,
text
=
'for : '
)
labelTargetTitle
=
Label
(
self
.
frameHighlightTarget
,
text
=
'for : '
)
self
.
optMenuHighlightTarget
=
OptionMenu
(
self
.
frameHighlightTarget
,
self
.
optMenuHighlightTarget
=
Dyn
OptionMenu
(
self
.
frameHighlightTarget
,
self
.
highlightTarget
,
'normal text background'
,
'test target interface item 2'
)
self
.
highlightTarget
,
None
,
command
=
None
)
buttonSetColour
=
Button
(
self
.
frameColourSet
,
text
=
'Set Colour'
,
buttonSetColour
=
Button
(
self
.
frameColourSet
,
text
=
'Set Colour'
,
command
=
self
.
GetColour
)
command
=
self
.
GetColour
)
labelFontTitle
=
Label
(
frameFontSet
,
text
=
'Set Font Style'
)
labelFontTitle
=
Label
(
frameFontSet
,
text
=
'Set Font Style'
)
...
@@ -308,19 +314,17 @@ class ConfigDialog(Toplevel):
...
@@ -308,19 +314,17 @@ class ConfigDialog(Toplevel):
# width=2,height=10)
# width=2,height=10)
labelThemeTitle
=
Label
(
frameTheme
,
text
=
'Select a Highlighting Theme'
)
labelThemeTitle
=
Label
(
frameTheme
,
text
=
'Select a Highlighting Theme'
)
labelTypeTitle
=
Label
(
frameTheme
,
text
=
'Select : '
)
labelTypeTitle
=
Label
(
frameTheme
,
text
=
'Select : '
)
radioThemeBuiltin
=
Radiobutton
(
frameTheme
,
variable
=
self
.
themeType
,
self
.
radioThemeBuiltin
=
Radiobutton
(
frameTheme
,
variable
=
self
.
themeType
,
value
=
0
,
command
=
self
.
SetThemeType
,
text
=
'a Built-in Theme'
)
value
=
0
,
command
=
self
.
SetThemeType
,
text
=
'a Built-in Theme'
)
radioThemeCustom
=
Radiobutton
(
frameTheme
,
variable
=
self
.
themeType
,
self
.
radioThemeCustom
=
Radiobutton
(
frameTheme
,
variable
=
self
.
themeType
,
value
=
1
,
command
=
self
.
SetThemeType
,
text
=
'a Custom Theme'
)
value
=
1
,
command
=
self
.
SetThemeType
,
text
=
'a Custom Theme'
)
self
.
optMenuThemeBuiltin
=
OptionMenu
(
frameTheme
,
self
.
optMenuThemeBuiltin
=
DynOptionMenu
(
frameTheme
,
self
.
builtinTheme
,
'test builtin junk'
,
'test builtin junk 2'
)
self
.
builtinTheme
,
None
,
command
=
self
.
SetHighlightSampleBinding
)
self
.
builtinTheme
.
set
(
'test builtin junk'
)
self
.
optMenuThemeCustom
=
DynOptionMenu
(
frameTheme
,
self
.
optMenuThemeCustom
=
OptionMenu
(
frameTheme
,
self
.
customTheme
,
None
,
command
=
self
.
SetHighlightSampleBinding
)
self
.
customTheme
,
'test custom junk'
,
'test custom junk 2'
)
# self.themeType.set(0)
self
.
customTheme
.
set
(
'test custom junk'
)
self
.
themeType
.
set
(
0
)
self
.
buttonDeleteCustomTheme
=
Button
(
frameTheme
,
text
=
'Delete Custom Theme'
)
self
.
buttonDeleteCustomTheme
=
Button
(
frameTheme
,
text
=
'Delete Custom Theme'
)
self
.
SetThemeType
()
#
self.SetThemeType()
##widget packing
##widget packing
#body
#body
frameCustom
.
pack
(
side
=
LEFT
,
padx
=
5
,
pady
=
10
,
expand
=
TRUE
,
fill
=
BOTH
)
frameCustom
.
pack
(
side
=
LEFT
,
padx
=
5
,
pady
=
10
,
expand
=
TRUE
,
fill
=
BOTH
)
...
@@ -344,8 +348,8 @@ class ConfigDialog(Toplevel):
...
@@ -344,8 +348,8 @@ class ConfigDialog(Toplevel):
#frameDivider.pack(side=LEFT,fill=Y,padx=5,pady=5)
#frameDivider.pack(side=LEFT,fill=Y,padx=5,pady=5)
labelThemeTitle
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
labelThemeTitle
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
labelTypeTitle
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
labelTypeTitle
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
radioThemeBuiltin
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
)
self
.
radioThemeBuiltin
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
)
radioThemeCustom
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
,
pady
=
2
)
self
.
radioThemeCustom
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
,
pady
=
2
)
self
.
optMenuThemeBuiltin
.
pack
(
side
=
TOP
,
fill
=
X
,
padx
=
5
,
pady
=
5
)
self
.
optMenuThemeBuiltin
.
pack
(
side
=
TOP
,
fill
=
X
,
padx
=
5
,
pady
=
5
)
self
.
optMenuThemeCustom
.
pack
(
side
=
TOP
,
fill
=
X
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
self
.
optMenuThemeCustom
.
pack
(
side
=
TOP
,
fill
=
X
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
self
.
buttonDeleteCustomTheme
.
pack
(
side
=
TOP
,
fill
=
X
,
padx
=
5
,
pady
=
5
)
self
.
buttonDeleteCustomTheme
.
pack
(
side
=
TOP
,
fill
=
X
,
padx
=
5
,
pady
=
5
)
...
@@ -387,19 +391,16 @@ class ConfigDialog(Toplevel):
...
@@ -387,19 +391,16 @@ class ConfigDialog(Toplevel):
#frameKeySets
#frameKeySets
labelKeysTitle
=
Label
(
frameKeySets
,
text
=
'Select a Key Set'
)
labelKeysTitle
=
Label
(
frameKeySets
,
text
=
'Select a Key Set'
)
labelTypeTitle
=
Label
(
frameKeySets
,
text
=
'Select : '
)
labelTypeTitle
=
Label
(
frameKeySets
,
text
=
'Select : '
)
radioKeysBuiltin
=
Radiobutton
(
frameKeySets
,
variable
=
self
.
keysType
,
self
.
radioKeysBuiltin
=
Radiobutton
(
frameKeySets
,
variable
=
self
.
keysType
,
value
=
0
,
command
=
self
.
SetKeysType
,
text
=
'a Built-in Key Set'
)
value
=
0
,
command
=
self
.
SetKeysType
,
text
=
'a Built-in Key Set'
)
radioKeysCustom
=
Radiobutton
(
frameKeySets
,
variable
=
self
.
keysType
,
self
.
radioKeysCustom
=
Radiobutton
(
frameKeySets
,
variable
=
self
.
keysType
,
value
=
1
,
command
=
self
.
SetKeysType
,
text
=
'a Custom Key Set'
)
value
=
1
,
command
=
self
.
SetKeysType
,
text
=
'a Custom Key Set'
)
self
.
optMenuKeysBuiltin
=
OptionMenu
(
frameKeySets
,
self
.
optMenuKeysBuiltin
=
DynOptionMenu
(
frameKeySets
,
self
.
builtinKeys
,
'test builtin junk'
,
'test builtin junk 2'
)
self
.
builtinKeys
,
None
,
command
=
None
)
self
.
builtinKeys
.
set
(
'test builtin junk'
)
self
.
optMenuKeysCustom
=
DynOptionMenu
(
frameKeySets
,
self
.
optMenuKeysCustom
=
OptionMenu
(
frameKeySets
,
self
.
customKeys
,
None
,
command
=
None
)
self
.
customKeys
,
'test custom junk'
,
'test custom junk 2'
)
self
.
customKeys
.
set
(
'test custom junk'
)
self
.
keysType
.
set
(
0
)
self
.
buttonDeleteCustomKeys
=
Button
(
frameKeySets
,
text
=
'Delete Custom Key Set'
)
self
.
buttonDeleteCustomKeys
=
Button
(
frameKeySets
,
text
=
'Delete Custom Key Set'
)
self
.
SetKeysType
()
#
self.SetKeysType()
##widget packing
##widget packing
#body
#body
frameCustom
.
pack
(
side
=
LEFT
,
padx
=
5
,
pady
=
5
,
expand
=
TRUE
,
fill
=
BOTH
)
frameCustom
.
pack
(
side
=
LEFT
,
padx
=
5
,
pady
=
5
,
expand
=
TRUE
,
fill
=
BOTH
)
...
@@ -422,8 +423,8 @@ class ConfigDialog(Toplevel):
...
@@ -422,8 +423,8 @@ class ConfigDialog(Toplevel):
#frameKeySets
#frameKeySets
labelKeysTitle
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
labelKeysTitle
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
labelTypeTitle
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
labelTypeTitle
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
radioKeysBuiltin
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
)
self
.
radioKeysBuiltin
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
)
radioKeysCustom
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
,
pady
=
2
)
self
.
radioKeysCustom
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
,
pady
=
2
)
self
.
optMenuKeysBuiltin
.
pack
(
side
=
TOP
,
fill
=
X
,
padx
=
5
,
pady
=
5
)
self
.
optMenuKeysBuiltin
.
pack
(
side
=
TOP
,
fill
=
X
,
padx
=
5
,
pady
=
5
)
self
.
optMenuKeysCustom
.
pack
(
side
=
TOP
,
fill
=
X
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
self
.
optMenuKeysCustom
.
pack
(
side
=
TOP
,
fill
=
X
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
self
.
buttonDeleteCustomKeys
.
pack
(
side
=
TOP
,
fill
=
X
,
padx
=
5
,
pady
=
5
)
self
.
buttonDeleteCustomKeys
.
pack
(
side
=
TOP
,
fill
=
X
,
padx
=
5
,
pady
=
5
)
...
@@ -539,9 +540,49 @@ class ConfigDialog(Toplevel):
...
@@ -539,9 +540,49 @@ class ConfigDialog(Toplevel):
self
.
tabCols
.
set
(
tabCols
)
self
.
tabCols
.
set
(
tabCols
)
def
LoadThemeLists
(
self
):
def
LoadThemeLists
(
self
):
##default themes
##current theme type radiobutton
pass
self
.
themeType
.
set
(
idleConf
.
GetOption
(
'main'
,
'Theme'
,
'user'
,
type
=
'int'
))
##currently set theme
currentOption
=
idleConf
.
GetOption
(
'main'
,
'Theme'
,
'name'
)
##load option menus
if
self
.
themeType
.
get
()
==
0
:
#default theme selected
itemList
=
idleConf
.
GetSectionList
(
'default'
,
'highlight'
)
self
.
optMenuThemeBuiltin
.
SetMenu
(
itemList
,
currentOption
)
itemList
=
idleConf
.
GetSectionList
(
'user'
,
'highlight'
)
if
not
itemList
:
self
.
radioThemeCustom
.
config
(
state
=
DISABLED
)
self
.
customTheme
.
set
(
'- no custom themes -'
)
else
:
self
.
optMenuThemeCustom
.
SetMenu
(
itemList
,
itemList
[
0
])
elif
self
.
themeType
.
get
()
==
1
:
#user theme selected
itemList
=
idleConf
.
GetSectionList
(
'user'
,
'highlight'
)
self
.
optMenuThemeCustom
.
SetMenu
(
itemList
,
currentOption
)
itemList
=
idleConf
.
GetSectionList
(
'default'
,
'highlight'
)
self
.
optMenuThemeBuiltin
.
SetMenu
(
itemList
,
itemList
[
0
])
self
.
SetThemeType
()
def
LoadKeyLists
(
self
):
##current keys type radiobutton
self
.
keysType
.
set
(
idleConf
.
GetOption
(
'main'
,
'Keys'
,
'user'
,
type
=
'int'
))
##currently set keys
currentOption
=
idleConf
.
GetOption
(
'main'
,
'Keys'
,
'name'
)
##load option menus
if
self
.
keysType
.
get
()
==
0
:
#default theme selected
itemList
=
idleConf
.
GetSectionList
(
'default'
,
'keys'
)
self
.
optMenuKeysBuiltin
.
SetMenu
(
itemList
,
currentOption
)
itemList
=
idleConf
.
GetSectionList
(
'user'
,
'keys'
)
if
not
itemList
:
self
.
radioKeysCustom
.
config
(
state
=
DISABLED
)
self
.
customKeys
.
set
(
'- no custom keys -'
)
else
:
self
.
optMenuKeysCustom
.
SetMenu
(
itemList
,
itemList
[
0
])
elif
self
.
keysType
.
get
()
==
1
:
#user theme selected
itemList
=
idleConf
.
GetSectionList
(
'user'
,
'keys'
)
self
.
optMenuKeysCustom
.
SetMenu
(
itemList
,
currentOption
)
itemList
=
idleConf
.
GetSectionList
(
'default'
,
'keys'
)
self
.
optMenuKeysBuiltin
.
SetMenu
(
itemList
,
itemList
[
0
])
self
.
SetKeysType
()
def
LoadConfigs
(
self
):
def
LoadConfigs
(
self
):
"""
"""
load configuration from default and user config files and populate
load configuration from default and user config files and populate
...
@@ -553,6 +594,7 @@ class ConfigDialog(Toplevel):
...
@@ -553,6 +594,7 @@ class ConfigDialog(Toplevel):
### highlighting page
### highlighting page
self
.
LoadThemeLists
()
self
.
LoadThemeLists
()
### keys page
### keys page
self
.
LoadKeyLists
()
### help page
### help page
### general page
### general page
...
...
Lib/idlelib/configHandler.py
Dosyayı görüntüle @
41a8532f
...
@@ -28,9 +28,12 @@ class IdleConfParser(ConfigParser):
...
@@ -28,9 +28,12 @@ class IdleConfParser(ConfigParser):
Get an option value for given section/option or return default.
Get an option value for given section/option or return default.
If type is specified, return as type.
If type is specified, return as type.
"""
"""
if
type
==
'bool'
:
getVal
=
self
.
getboolean
if
type
==
'bool'
:
elif
type
==
'int'
:
getVal
=
self
.
getint
getVal
=
self
.
getboolean
else
:
getVal
=
self
.
get
elif
type
==
'int'
:
getVal
=
self
.
getint
else
:
getVal
=
self
.
get
if
self
.
has_option
(
section
,
option
):
if
self
.
has_option
(
section
,
option
):
#return getVal(section, option, raw, vars)
#return getVal(section, option, raw, vars)
return
getVal
(
section
,
option
)
return
getVal
(
section
,
option
)
...
@@ -165,7 +168,6 @@ class IdleConf:
...
@@ -165,7 +168,6 @@ class IdleConf:
"""
"""
pass
pass
def
GetKeys
(
self
,
name
=
None
):
def
GetKeys
(
self
,
name
=
None
):
"""
"""
Gets the requested keybindings or returns a final fallback keybinding
Gets the requested keybindings or returns a final fallback keybinding
...
@@ -174,7 +176,6 @@ class IdleConf:
...
@@ -174,7 +176,6 @@ class IdleConf:
"""
"""
pass
pass
def
LoadCfgFiles
(
self
):
def
LoadCfgFiles
(
self
):
"""
"""
load all configuration files.
load all configuration files.
...
...
Lib/idlelib/dynOptionMenuWidget.py
Dosyayı görüntüle @
41a8532f
...
@@ -21,7 +21,7 @@ class DynOptionMenu(OptionMenu):
...
@@ -21,7 +21,7 @@ class DynOptionMenu(OptionMenu):
self
.
variable
=
variable
self
.
variable
=
variable
self
.
command
=
kwargs
.
get
(
'command'
)
self
.
command
=
kwargs
.
get
(
'command'
)
def
SetMenu
(
self
,
valueList
,
value
):
def
SetMenu
(
self
,
valueList
,
value
=
None
):
"""
"""
clear and reload the menu with a new set of options.
clear and reload the menu with a new set of options.
valueList - list of new options
valueList - list of new options
...
@@ -31,4 +31,5 @@ class DynOptionMenu(OptionMenu):
...
@@ -31,4 +31,5 @@ class DynOptionMenu(OptionMenu):
for
item
in
valueList
:
for
item
in
valueList
:
self
[
'menu'
]
.
add_command
(
label
=
item
,
self
[
'menu'
]
.
add_command
(
label
=
item
,
command
=
_setit
(
self
.
variable
,
item
,
self
.
command
))
command
=
_setit
(
self
.
variable
,
item
,
self
.
command
))
self
.
variable
.
set
(
value
)
if
value
:
self
.
variable
.
set
(
value
)
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