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
2a63a079
Kaydet (Commit)
2a63a079
authored
Eki 26, 2001
tarafından
Steven M. Gava
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
further work supporting reading config dialog values form config files.
üst
f126bcb6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
20 deletions
+40
-20
configHandler.py
Lib/idlelib/configHandler.py
+40
-20
No files found.
Lib/idlelib/configHandler.py
Dosyayı görüntüle @
2a63a079
...
@@ -4,7 +4,9 @@
...
@@ -4,7 +4,9 @@
## elguavas
## elguavas
##
##
##---------------------------------------------------------------------------##
##---------------------------------------------------------------------------##
"""Provides access to configuration information"""
"""
Provides access to configuration information
"""
import
os
import
os
import
sys
import
sys
...
@@ -21,20 +23,6 @@ class IdleConfParser(ConfigParser):
...
@@ -21,20 +23,6 @@ class IdleConfParser(ConfigParser):
self
.
file
=
cfgFile
self
.
file
=
cfgFile
ConfigParser
.
__init__
(
self
,
defaults
=
cfgDefaults
)
ConfigParser
.
__init__
(
self
,
defaults
=
cfgDefaults
)
# def GetInt(self, section, option, *kw):
# """
# Get an option value as an integer
# """
# return self.Get(section, option, type='int', *kw)
#
# def GetBool(self, section, option, **kw):
# """
# Get an option value as a boolean
# """
# return self.Get(section, option, type='bool', *kw)
# def Get(self, section, option, raw=0, vars=None, default=None,
# type=None):
def
Get
(
self
,
section
,
option
,
default
=
None
,
type
=
None
):
def
Get
(
self
,
section
,
option
,
default
=
None
,
type
=
None
):
"""
"""
Get an option value for given section/option or return default.
Get an option value for given section/option or return default.
...
@@ -49,10 +37,6 @@ class IdleConfParser(ConfigParser):
...
@@ -49,10 +37,6 @@ class IdleConfParser(ConfigParser):
else
:
else
:
return
default
return
default
def
GetSectionList
(
self
):
# only provided for consistency
return
self
.
sections
()
def
GetOptionList
(
self
,
section
):
def
GetOptionList
(
self
,
section
):
"""
"""
Get an option list for given section
Get an option list for given section
...
@@ -138,7 +122,7 @@ class IdleConf:
...
@@ -138,7 +122,7 @@ class IdleConf:
self
.
defaultCfg
[
cfgType
]
=
IdleConfParser
(
defCfgFiles
[
cfgType
])
self
.
defaultCfg
[
cfgType
]
=
IdleConfParser
(
defCfgFiles
[
cfgType
])
self
.
userCfg
[
cfgType
]
=
IdleUserConfParser
(
usrCfgFiles
[
cfgType
])
self
.
userCfg
[
cfgType
]
=
IdleUserConfParser
(
usrCfgFiles
[
cfgType
])
def
Get
Default
(
self
,
configType
,
section
,
option
,
default
=
None
,
type
=
None
):
def
Get
Option
(
self
,
configType
,
section
,
option
,
default
=
None
,
type
=
None
):
"""
"""
Get an option value for given config type and given general
Get an option value for given config type and given general
configuration section/option or return a default. If type is specified,
configuration section/option or return a default. If type is specified,
...
@@ -155,6 +139,42 @@ class IdleConf:
...
@@ -155,6 +139,42 @@ class IdleConf:
else
:
else
:
return
default
return
default
def
GetSectionList
(
self
,
configSet
,
configType
):
"""
Get a list of sections from either the user or default config for
the given config type.
configSet must be either 'user' or 'default'
configType must be one of ('extensions','highlight','keys')
"""
if
not
(
configType
in
(
'extensions'
,
'highlight'
,
'keys'
)):
raise
'Invalid configType specified'
if
configSet
==
'user'
:
cfgParser
=
self
.
userCfg
[
configType
]
elif
configSet
==
'default'
:
cfgParser
=
self
.
defaultCfg
[
configType
]
else
:
raise
'Invalid configSet specified'
return
cfgParser
.
sections
()
def
GetTheme
(
self
,
name
=
None
):
"""
Gets the requested theme or returns a final fallback theme in case
one can't be obtained from either the user or default config files.
"""
pass
def
GetKeys
(
self
,
name
=
None
):
"""
Gets the requested keybindings or returns a final fallback keybinding
set in case one can't be obtained from either the user or default
config files.
"""
pass
def
LoadCfgFiles
(
self
):
def
LoadCfgFiles
(
self
):
"""
"""
load all configuration files.
load all configuration files.
...
...
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