30
30
from idlelib .codecontext import CodeContext
31
31
from idlelib .parenmatch import ParenMatch
32
32
from idlelib .paragraph import FormatParagraph
33
+ from idlelib .squeezer import Squeezer
33
34
34
35
changes = ConfigChanges ()
35
36
# Reload changed options in the following classes.
36
- reloadables = (AutoComplete , CodeContext , ParenMatch , FormatParagraph )
37
+ reloadables = (AutoComplete , CodeContext , ParenMatch , FormatParagraph ,
38
+ Squeezer )
37
39
38
40
39
41
class ConfigDialog (Toplevel ):
@@ -1748,9 +1750,9 @@ def delete_custom_keys(self):
1748
1750
self .customlist .SetMenu (item_list , item_list [0 ])
1749
1751
# Revert to default key set.
1750
1752
self .keyset_source .set (idleConf .defaultCfg ['main' ]
1751
- .Get ('Keys' , 'default' ))
1753
+ .Get ('Keys' , 'default' ))
1752
1754
self .builtin_name .set (idleConf .defaultCfg ['main' ].Get ('Keys' , 'name' )
1753
- or idleConf .default_keys ())
1755
+ or idleConf .default_keys ())
1754
1756
# User can't back out of these changes, they must be applied now.
1755
1757
changes .save_all ()
1756
1758
self .cd .save_all_changed_extensions ()
@@ -1817,6 +1819,10 @@ def create_page_general(self):
1817
1819
frame_context: Frame
1818
1820
context_title: Label
1819
1821
(*)context_int: Entry - context_lines
1822
+ frame_shell: LabelFrame
1823
+ frame_auto_squeeze_min_lines: Frame
1824
+ auto_squeeze_min_lines_title: Label
1825
+ (*)auto_squeeze_min_lines_int: Entry - auto_squeeze_min_lines
1820
1826
frame_help: LabelFrame
1821
1827
frame_helplist: Frame
1822
1828
frame_helplist_buttons: Frame
@@ -1842,6 +1848,9 @@ def create_page_general(self):
1842
1848
self .paren_bell = tracers .add (
1843
1849
BooleanVar (self ), ('extensions' , 'ParenMatch' , 'bell' ))
1844
1850
1851
+ self .auto_squeeze_min_lines = tracers .add (
1852
+ StringVar (self ), ('main' , 'PyShell' , 'auto-squeeze-min-lines' ))
1853
+
1845
1854
self .autosave = tracers .add (
1846
1855
IntVar (self ), ('main' , 'General' , 'autosave' ))
1847
1856
self .format_width = tracers .add (
@@ -1855,8 +1864,10 @@ def create_page_general(self):
1855
1864
text = ' Window Preferences' )
1856
1865
frame_editor = LabelFrame (self , borderwidth = 2 , relief = GROOVE ,
1857
1866
text = ' Editor Preferences' )
1867
+ frame_shell = LabelFrame (self , borderwidth = 2 , relief = GROOVE ,
1868
+ text = ' Shell Preferences' )
1858
1869
frame_help = LabelFrame (self , borderwidth = 2 , relief = GROOVE ,
1859
- text = ' Additional Help Sources ' )
1870
+ text = ' Additional Help Sources ' )
1860
1871
# Frame_window.
1861
1872
frame_run = Frame (frame_window , borderwidth = 0 )
1862
1873
startup_title = Label (frame_run , text = 'At Startup' )
@@ -1918,6 +1929,13 @@ def create_page_general(self):
1918
1929
self .context_int = Entry (
1919
1930
frame_context , textvariable = self .context_lines , width = 3 )
1920
1931
1932
+ # Frame_shell.
1933
+ frame_auto_squeeze_min_lines = Frame (frame_shell , borderwidth = 0 )
1934
+ auto_squeeze_min_lines_title = Label (frame_auto_squeeze_min_lines ,
1935
+ text = 'Auto-Squeeze Min. Lines:' )
1936
+ self .auto_squeeze_min_lines_int = Entry (
1937
+ frame_auto_squeeze_min_lines , width = 4 ,
1938
+ textvariable = self .auto_squeeze_min_lines )
1921
1939
1922
1940
# frame_help.
1923
1941
frame_helplist = Frame (frame_help )
@@ -1943,6 +1961,7 @@ def create_page_general(self):
1943
1961
# Body.
1944
1962
frame_window .pack (side = TOP , padx = 5 , pady = 5 , expand = TRUE , fill = BOTH )
1945
1963
frame_editor .pack (side = TOP , padx = 5 , pady = 5 , expand = TRUE , fill = BOTH )
1964
+ frame_shell .pack (side = TOP , padx = 5 , pady = 5 , expand = TRUE , fill = BOTH )
1946
1965
frame_help .pack (side = TOP , padx = 5 , pady = 5 , expand = TRUE , fill = BOTH )
1947
1966
# frame_run.
1948
1967
frame_run .pack (side = TOP , padx = 5 , pady = 0 , fill = X )
@@ -1983,6 +2002,11 @@ def create_page_general(self):
1983
2002
context_title .pack (side = LEFT , anchor = W , padx = 5 , pady = 5 )
1984
2003
self .context_int .pack (side = TOP , padx = 5 , pady = 5 )
1985
2004
2005
+ # frame_auto_squeeze_min_lines
2006
+ frame_auto_squeeze_min_lines .pack (side = TOP , padx = 5 , pady = 0 , fill = X )
2007
+ auto_squeeze_min_lines_title .pack (side = LEFT , anchor = W , padx = 5 , pady = 5 )
2008
+ self .auto_squeeze_min_lines_int .pack (side = TOP , padx = 5 , pady = 5 )
2009
+
1986
2010
# frame_help.
1987
2011
frame_helplist_buttons .pack (side = RIGHT , padx = 5 , pady = 5 , fill = Y )
1988
2012
frame_helplist .pack (side = TOP , padx = 5 , pady = 5 , expand = TRUE , fill = BOTH )
@@ -2018,6 +2042,10 @@ def load_general_cfg(self):
2018
2042
self .context_lines .set (idleConf .GetOption (
2019
2043
'extensions' , 'CodeContext' , 'maxlines' , type = 'int' ))
2020
2044
2045
+ # Set variables for shell windows.
2046
+ self .auto_squeeze_min_lines .set (idleConf .GetOption (
2047
+ 'main' , 'PyShell' , 'auto-squeeze-min-lines' , type = 'int' ))
2048
+
2021
2049
# Set additional help sources.
2022
2050
self .user_helplist = idleConf .GetAllExtraHelpSourcesList ()
2023
2051
self .helplist .delete (0 , 'end' )
@@ -2211,6 +2239,9 @@ def detach(self):
2211
2239
2212
2240
CodeContext: Maxlines is the maximum number of code context lines to
2213
2241
display when Code Context is turned on for an editor window.
2242
+
2243
+ Shell Preferences: Auto-Squeeze Min. Lines is the minimum number of lines
2244
+ of output to automatically "squeeze".
2214
2245
'''
2215
2246
}
2216
2247
0 commit comments