diff -u CURRENT/configDialog.py ./configDialog.py --- CURRENT/configDialog.py 2005-05-05 01:29:36.000000000 -0400 +++ ./configDialog.py 2005-05-06 19:08:32.812474942 -0400 @@ -91,6 +91,7 @@ self.fontBold=BooleanVar(self) self.fontName=StringVar(self) self.spaceNum=IntVar(self) + self.useTabsInShell=BooleanVar(self) self.editFont=tkFont.Font(self,('courier',10,'normal')) ##widget creation #body frame @@ -126,6 +127,10 @@ self.scaleSpaceNum=Scale(frameIndentSize, variable=self.spaceNum, label='Indentation Width', orient='horizontal', tickinterval=2, from_=2, to=16) + self.radioUseTabsInShellsNo=Radiobutton(frameIndentSize, value=0, + variable=self.useTabsInShell, text='Use indent width in shell') + self.radioUseTabsInShellYes=Radiobutton(frameIndentSize, value=1, + variable=self.useTabsInShell, text='Use tabs in shell') #widget packing #body frameFont.pack(side=LEFT,padx=5,pady=10,expand=TRUE,fill=BOTH) @@ -146,6 +151,8 @@ frameIndentSize.pack(side=TOP,padx=5,pady=5,fill=BOTH) labelSpaceNumTitle.pack(side=TOP,anchor=W,padx=5) self.scaleSpaceNum.pack(side=TOP,padx=5,fill=X) + self.radioUseTabsInShellsNo.pack(side=TOP,anchor=W,pady=2) + self.radioUseTabsInShellYes.pack(side=TOP,anchor=W,pady=2) return frame def CreatePageHighlight(self): @@ -428,6 +435,7 @@ self.fontName.trace_variable('w',self.VarChanged_fontName) self.fontBold.trace_variable('w',self.VarChanged_fontBold) self.spaceNum.trace_variable('w',self.VarChanged_spaceNum) + self.useTabsInShell.trace_variable('w',self.VarChanged_useTabsInShell) self.colour.trace_variable('w',self.VarChanged_colour) self.builtinTheme.trace_variable('w',self.VarChanged_builtinTheme) self.customTheme.trace_variable('w',self.VarChanged_customTheme) @@ -460,6 +468,10 @@ value=self.spaceNum.get() self.AddChangedItem('main','Indent','num-spaces',value) + def VarChanged_useTabsInShell(self,*params): + value=self.useTabsInShell.get() + self.AddChangedItem('main','Indent','use-tabs-in-shell',value) + def VarChanged_colour(self,*params): self.OnNewColourSet() @@ -948,6 +960,10 @@ spaceNum=idleConf.GetOption('main','Indent','num-spaces', default=4,type='int') self.spaceNum.set(spaceNum) + ##use tabs in PyShell flag + useTabsInShell=idleConf.GetOption('main','Indent', + 'use-tabs-in-shell', default=1, type='bool') + self.useTabsInShell.set(useTabsInShell) def LoadThemeCfg(self): ##current theme type radiobutton @@ -1113,6 +1129,7 @@ instance.ResetColorizer() instance.ResetFont() instance.set_notabs_indentwidth() + instance.set_use_tabs_in_shell() instance.ResetKeybindings() instance.reset_help_menu_entries() diff -u CURRENT/config-main.def ./config-main.def --- CURRENT/config-main.def 2005-05-05 01:29:36.000000000 -0400 +++ ./config-main.def 2005-05-06 18:59:11.825996482 -0400 @@ -64,6 +64,7 @@ [Indent] use-spaces= 1 num-spaces= 4 +use-tabs-in-shell= 1 [Theme] default= 1 diff -u CURRENT/EditorWindow.py ./EditorWindow.py --- CURRENT/EditorWindow.py 2005-05-05 01:29:35.000000000 -0400 +++ ./EditorWindow.py 2005-05-06 19:05:56.093514741 -0400 @@ -594,6 +594,10 @@ self.indentwidth = idleConf.GetOption('main', 'Indent','num-spaces', type='int') + def set_use_tabs_in_shell(self): + "Update use tabs in shell setting (only affects PyShell)" + pass + def reset_help_menu_entries(self): "Update the additional help entries on the Help menu" help_list = idleConf.GetAllExtraHelpSourcesList() diff -u CURRENT/PyShell.py ./PyShell.py --- CURRENT/PyShell.py 2005-05-05 01:29:36.000000000 -0400 +++ ./PyShell.py 2005-05-06 19:05:48.352998395 -0400 @@ -796,10 +796,8 @@ __builtin__.quit = __builtin__.exit = "To exit, type Ctrl-D." # ## self.config(usetabs=1, indentwidth=8, context_use_ps1=1) - self.usetabs = True - # indentwidth must be 8 when using tabs. See note in EditorWindow: - self.indentwidth = 8 self.context_use_ps1 = True + self.set_use_tabs_in_shell() # text = self.text text.configure(wrap="char") @@ -847,6 +845,17 @@ def get_warning_stream(self): return warning_stream + def set_use_tabs_in_shell(self): + "Update use tabs in shell setting (only affects PyShell)" + self.usetabs = idleConf.GetOption('main', 'Indent','use-tabs-in-shell', + type='bool') + if self.usetabs: + # indentwidth must be 8 when using tabs. See note in EditorWindow: + self.indentwidth = 8 + else: + self.indentwidth = idleConf.GetOption('main', 'Indent','num-spaces', + type='int') + def toggle_debugger(self, event=None): if self.executing: tkMessageBox.showerror("Don't debug now",