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
90f84922
Commit
90f84922
authored
Feb 05, 2007
by
Kurt B. Kaiser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add 'raw' support to configHandler. Patch 1650174 Tal Einat.
parent
f5400032
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
Lib/idlelib/NEWS.txt
Lib/idlelib/NEWS.txt
+2
-0
Lib/idlelib/configHandler.py
Lib/idlelib/configHandler.py
+11
-12
No files found.
Lib/idlelib/NEWS.txt
View file @
90f84922
...
...
@@ -3,6 +3,8 @@ What's New in IDLE 2.6a1?
*Release date: XX-XXX-200X*
- Add 'raw' support to configHandler. Patch 1650174 Tal Einat.
- Avoid hang when encountering a duplicate in a completion list. Bug 1571112.
- Patch #1362975: Rework CodeContext indentation algorithm to
...
...
Lib/idlelib/configHandler.py
View file @
90f84922
...
...
@@ -39,22 +39,19 @@ class IdleConfParser(ConfigParser):
self
.
file
=
cfgFile
ConfigParser
.
__init__
(
self
,
defaults
=
cfgDefaults
)
def
Get
(
self
,
section
,
option
,
type
=
None
,
default
=
None
):
def
Get
(
self
,
section
,
option
,
type
=
None
,
default
=
None
,
raw
=
False
):
"""
Get an option value for given section/option or return default.
If type is specified, return as type.
"""
if
not
self
.
has_option
(
section
,
option
):
return
default
if
type
==
'bool'
:
getVal
=
self
.
getboolean
return
self
.
getboolean
(
section
,
option
)
elif
type
==
'int'
:
getVal
=
self
.
getint
else
:
getVal
=
self
.
get
if
self
.
has_option
(
section
,
option
):
#return getVal(section, option, raw, vars, default)
return
getVal
(
section
,
option
)
return
self
.
getint
(
section
,
option
)
else
:
return
default
return
self
.
get
(
section
,
option
,
raw
=
raw
)
def
GetOptionList
(
self
,
section
):
"""
...
...
@@ -219,7 +216,7 @@ class IdleConf:
return
userDir
def
GetOption
(
self
,
configType
,
section
,
option
,
default
=
None
,
type
=
None
,
warn_on_default
=
True
):
warn_on_default
=
True
,
raw
=
False
):
"""
Get an option value for given config type and given general
configuration section/option or return a default. If type is specified,
...
...
@@ -233,9 +230,11 @@ class IdleConf:
"""
if
self
.
userCfg
[
configType
].
has_option
(
section
,
option
):
return
self
.
userCfg
[
configType
].
Get
(
section
,
option
,
type
=
type
)
return
self
.
userCfg
[
configType
].
Get
(
section
,
option
,
type
=
type
,
raw
=
raw
)
elif
self
.
defaultCfg
[
configType
].
has_option
(
section
,
option
):
return
self
.
defaultCfg
[
configType
].
Get
(
section
,
option
,
type
=
type
)
return
self
.
defaultCfg
[
configType
].
Get
(
section
,
option
,
type
=
type
,
raw
=
raw
)
else
:
#returning default, print warning
if
warn_on_default
:
warning
=
(
'
\
n
Warning: configHandler.py - IdleConf.GetOption -
\
n
'
...
...
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