@@ -170,13 +170,15 @@ def __init__(self, flist=None, filename=None, key=None, root=None):
170170 'recent-files.lst' )
171171 self .text_frame = text_frame = Frame (top )
172172 self .vbar = vbar = Scrollbar (text_frame , name = 'vbar' )
173- self .width = idleConf .GetOption ('main' ,'EditorWindow' ,'width' )
173+ self .width = idleConf .GetOption ('main' , 'EditorWindow' ,
174+ 'width' , type = 'int' )
174175 text_options = {
175176 'name' : 'text' ,
176177 'padx' : 5 ,
177178 'wrap' : 'none' ,
178179 'width' : self .width ,
179- 'height' : idleConf .GetOption ('main' , 'EditorWindow' , 'height' )}
180+ 'height' : idleConf .GetOption ('main' , 'EditorWindow' ,
181+ 'height' , type = 'int' )}
180182 if TkVersion >= 8.5 :
181183 # Starting with tk 8.5 we have to set the new tabstyle option
182184 # to 'wordprocessor' to achieve the same display of tabs as in
@@ -253,7 +255,8 @@ def __init__(self, flist=None, filename=None, key=None, root=None):
253255 if idleConf .GetOption ('main' , 'EditorWindow' , 'font-bold' , type = 'bool' ):
254256 fontWeight = 'bold'
255257 text .config (font = (idleConf .GetOption ('main' , 'EditorWindow' , 'font' ),
256- idleConf .GetOption ('main' , 'EditorWindow' , 'font-size' ),
258+ idleConf .GetOption ('main' , 'EditorWindow' ,
259+ 'font-size' , type = 'int' ),
257260 fontWeight ))
258261 text_frame .pack (side = LEFT , fill = BOTH , expand = 1 )
259262 text .pack (side = TOP , fill = BOTH , expand = 1 )
@@ -268,7 +271,8 @@ def __init__(self, flist=None, filename=None, key=None, root=None):
268271 # Although use-spaces=0 can be configured manually in config-main.def,
269272 # configuration of tabs v. spaces is not supported in the configuration
270273 # dialog. IDLE promotes the preferred Python indentation: use spaces!
271- usespaces = idleConf .GetOption ('main' , 'Indent' , 'use-spaces' , type = 'bool' )
274+ usespaces = idleConf .GetOption ('main' , 'Indent' ,
275+ 'use-spaces' , type = 'bool' )
272276 self .usetabs = not usespaces
273277
274278 # tabwidth is the display width of a literal tab character.
@@ -382,9 +386,11 @@ def home_callback(self, event):
382386 self .text .tag_remove ("sel" , "1.0" , "end" )
383387 else :
384388 if not self .text .index ("sel.first" ):
385- self .text .mark_set ("my_anchor" , "insert" ) # there was no previous selection
389+ # there was no previous selection
390+ self .text .mark_set ("my_anchor" , "insert" )
386391 else :
387- if self .text .compare (self .text .index ("sel.first" ), "<" , self .text .index ("insert" )):
392+ if self .text .compare (self .text .index ("sel.first" ), "<" ,
393+ self .text .index ("insert" )):
388394 self .text .mark_set ("my_anchor" , "sel.first" ) # extend back
389395 else :
390396 self .text .mark_set ("my_anchor" , "sel.last" ) # extend forward
@@ -766,7 +772,8 @@ def ResetFont(self):
766772 if idleConf .GetOption ('main' ,'EditorWindow' ,'font-bold' ,type = 'bool' ):
767773 fontWeight = 'bold'
768774 self .text .config (font = (idleConf .GetOption ('main' ,'EditorWindow' ,'font' ),
769- idleConf .GetOption ('main' ,'EditorWindow' ,'font-size' ),
775+ idleConf .GetOption ('main' ,'EditorWindow' ,'font-size' ,
776+ type = 'int' ),
770777 fontWeight ))
771778
772779 def RemoveKeybindings (self ):
0 commit comments