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
d8590ff2
Kaydet (Commit)
d8590ff2
authored
Ara 24, 2012
tarafından
Andrew Svetlov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #16511: Use default IDLE width and height if config param is not valid.
Patch Serhiy Storchaka.
üst
1c6c90fc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
27 deletions
+48
-27
EditorWindow.py
Lib/idlelib/EditorWindow.py
+6
-4
FormatParagraph.py
Lib/idlelib/FormatParagraph.py
+2
-1
configDialog.py
Lib/idlelib/configDialog.py
+7
-4
configHandler.py
Lib/idlelib/configHandler.py
+33
-18
No files found.
Lib/idlelib/EditorWindow.py
Dosyayı görüntüle @
d8590ff2
...
@@ -172,13 +172,13 @@ class EditorWindow(object):
...
@@ -172,13 +172,13 @@ class EditorWindow(object):
'recent-files.lst'
)
'recent-files.lst'
)
self
.
text_frame
=
text_frame
=
Frame
(
top
)
self
.
text_frame
=
text_frame
=
Frame
(
top
)
self
.
vbar
=
vbar
=
Scrollbar
(
text_frame
,
name
=
'vbar'
)
self
.
vbar
=
vbar
=
Scrollbar
(
text_frame
,
name
=
'vbar'
)
self
.
width
=
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'width'
)
self
.
width
=
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'width'
,
type
=
'int'
)
text_options
=
{
text_options
=
{
'name'
:
'text'
,
'name'
:
'text'
,
'padx'
:
5
,
'padx'
:
5
,
'wrap'
:
'none'
,
'wrap'
:
'none'
,
'width'
:
self
.
width
,
'width'
:
self
.
width
,
'height'
:
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'height'
)}
'height'
:
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'height'
,
type
=
'int'
)}
if
TkVersion
>=
8.5
:
if
TkVersion
>=
8.5
:
# Starting with tk 8.5 we have to set the new tabstyle option
# Starting with tk 8.5 we have to set the new tabstyle option
# to 'wordprocessor' to achieve the same display of tabs as in
# to 'wordprocessor' to achieve the same display of tabs as in
...
@@ -255,7 +255,8 @@ class EditorWindow(object):
...
@@ -255,7 +255,8 @@ class EditorWindow(object):
if
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'font-bold'
,
type
=
'bool'
):
if
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'font-bold'
,
type
=
'bool'
):
fontWeight
=
'bold'
fontWeight
=
'bold'
text
.
config
(
font
=
(
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'font'
),
text
.
config
(
font
=
(
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'font'
),
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'font-size'
),
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'font-size'
,
type
=
'int'
),
fontWeight
))
fontWeight
))
text_frame
.
pack
(
side
=
LEFT
,
fill
=
BOTH
,
expand
=
1
)
text_frame
.
pack
(
side
=
LEFT
,
fill
=
BOTH
,
expand
=
1
)
text
.
pack
(
side
=
TOP
,
fill
=
BOTH
,
expand
=
1
)
text
.
pack
(
side
=
TOP
,
fill
=
BOTH
,
expand
=
1
)
...
@@ -763,7 +764,8 @@ class EditorWindow(object):
...
@@ -763,7 +764,8 @@ class EditorWindow(object):
if
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'font-bold'
,
type
=
'bool'
):
if
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'font-bold'
,
type
=
'bool'
):
fontWeight
=
'bold'
fontWeight
=
'bold'
self
.
text
.
config
(
font
=
(
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'font'
),
self
.
text
.
config
(
font
=
(
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'font'
),
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'font-size'
),
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'font-size'
,
type
=
'int'
),
fontWeight
))
fontWeight
))
def
RemoveKeybindings
(
self
):
def
RemoveKeybindings
(
self
):
...
...
Lib/idlelib/FormatParagraph.py
Dosyayı görüntüle @
d8590ff2
...
@@ -32,7 +32,8 @@ class FormatParagraph:
...
@@ -32,7 +32,8 @@ class FormatParagraph:
self
.
editwin
=
None
self
.
editwin
=
None
def
format_paragraph_event
(
self
,
event
):
def
format_paragraph_event
(
self
,
event
):
maxformatwidth
=
int
(
idleConf
.
GetOption
(
'main'
,
'FormatParagraph'
,
'paragraph'
))
maxformatwidth
=
int
(
idleConf
.
GetOption
(
'main'
,
'FormatParagraph'
,
'paragraph'
,
type
=
'int'
))
text
=
self
.
editwin
.
text
text
=
self
.
editwin
.
text
first
,
last
=
self
.
editwin
.
get_selection_indices
()
first
,
last
=
self
.
editwin
.
get_selection_indices
()
if
first
and
last
:
if
first
and
last
:
...
...
Lib/idlelib/configDialog.py
Dosyayı görüntüle @
d8590ff2
...
@@ -947,7 +947,7 @@ class ConfigDialog(Toplevel):
...
@@ -947,7 +947,7 @@ class ConfigDialog(Toplevel):
self
.
listFontName
.
select_anchor
(
currentFontIndex
)
self
.
listFontName
.
select_anchor
(
currentFontIndex
)
##font size dropdown
##font size dropdown
fontSize
=
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'font-size'
,
fontSize
=
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'font-size'
,
default
=
'10'
)
type
=
'int'
,
default
=
'10'
)
self
.
optMenuFontSize
.
SetMenu
((
'7'
,
'8'
,
'9'
,
'10'
,
'11'
,
'12'
,
'13'
,
'14'
,
self
.
optMenuFontSize
.
SetMenu
((
'7'
,
'8'
,
'9'
,
'10'
,
'11'
,
'12'
,
'13'
,
'14'
,
'16'
,
'18'
,
'20'
,
'22'
),
fontSize
)
'16'
,
'18'
,
'20'
,
'22'
),
fontSize
)
##fontWeight
##fontWeight
...
@@ -1033,10 +1033,13 @@ class ConfigDialog(Toplevel):
...
@@ -1033,10 +1033,13 @@ class ConfigDialog(Toplevel):
self
.
autoSave
.
set
(
idleConf
.
GetOption
(
'main'
,
'General'
,
'autosave'
,
self
.
autoSave
.
set
(
idleConf
.
GetOption
(
'main'
,
'General'
,
'autosave'
,
default
=
0
,
type
=
'bool'
))
default
=
0
,
type
=
'bool'
))
#initial window size
#initial window size
self
.
winWidth
.
set
(
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'width'
))
self
.
winWidth
.
set
(
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'width'
,
self
.
winHeight
.
set
(
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'height'
))
type
=
'int'
))
self
.
winHeight
.
set
(
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'height'
,
type
=
'int'
))
#initial paragraph reformat size
#initial paragraph reformat size
self
.
paraWidth
.
set
(
idleConf
.
GetOption
(
'main'
,
'FormatParagraph'
,
'paragraph'
))
self
.
paraWidth
.
set
(
idleConf
.
GetOption
(
'main'
,
'FormatParagraph'
,
'paragraph'
,
type
=
'int'
))
# default source encoding
# default source encoding
self
.
encoding
.
set
(
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
self
.
encoding
.
set
(
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'encoding'
,
default
=
'none'
))
'encoding'
,
default
=
'none'
))
...
...
Lib/idlelib/configHandler.py
Dosyayı görüntüle @
d8590ff2
...
@@ -237,24 +237,39 @@ class IdleConf:
...
@@ -237,24 +237,39 @@ class IdleConf:
printed to stderr.
printed to stderr.
"""
"""
if
self
.
userCfg
[
configType
]
.
has_option
(
section
,
option
):
try
:
return
self
.
userCfg
[
configType
]
.
Get
(
section
,
option
,
if
self
.
userCfg
[
configType
]
.
has_option
(
section
,
option
):
type
=
type
,
raw
=
raw
)
return
self
.
userCfg
[
configType
]
.
Get
(
section
,
option
,
elif
self
.
defaultCfg
[
configType
]
.
has_option
(
section
,
option
):
type
=
type
,
raw
=
raw
)
return
self
.
defaultCfg
[
configType
]
.
Get
(
section
,
option
,
except
ValueError
:
type
=
type
,
raw
=
raw
)
warning
=
(
'
\n
Warning: configHandler.py - IdleConf.GetOption -
\n
'
else
:
#returning default, print warning
' invalid
%
r value for configuration option
%
r
\n
'
if
warn_on_default
:
' from section
%
r:
%
r
\n
'
%
warning
=
(
'
\n
Warning: configHandler.py - IdleConf.GetOption -
\n
'
(
type
,
option
,
section
,
' problem retrieving configuration option
%
r
\n
'
self
.
userCfg
[
configType
]
.
Get
(
section
,
option
,
' from section
%
r.
\n
'
raw
=
raw
)))
' returning default value:
%
r
\n
'
%
try
:
(
option
,
section
,
default
))
sys
.
stderr
.
write
(
warning
)
try
:
except
IOError
:
sys
.
stderr
.
write
(
warning
)
pass
except
IOError
:
try
:
pass
if
self
.
defaultCfg
[
configType
]
.
has_option
(
section
,
option
):
return
default
return
self
.
defaultCfg
[
configType
]
.
Get
(
section
,
option
,
type
=
type
,
raw
=
raw
)
except
ValueError
:
pass
#returning default, print warning
if
warn_on_default
:
warning
=
(
'
\n
Warning: configHandler.py - IdleConf.GetOption -
\n
'
' problem retrieving configuration option
%
r
\n
'
' from section
%
r.
\n
'
' returning default value:
%
r
\n
'
%
(
option
,
section
,
default
))
try
:
sys
.
stderr
.
write
(
warning
)
except
IOError
:
pass
return
default
def
SetOption
(
self
,
configType
,
section
,
option
,
value
):
def
SetOption
(
self
,
configType
,
section
,
option
,
value
):
"""In user's config file, set section's option to value.
"""In user's config file, set section's option to 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