From: Raymond Hettinger Date: Mon, 23 Sep 2002 14:01:40 +0000 (+0000) Subject: Backport patch 543222. Disable script bindings in shell window. X-Git-Tag: v2.2.2b1~163 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ff5fc2831313621f9d714263b37eeb5e36210c31;p=thirdparty%2FPython%2Fcpython.git Backport patch 543222. Disable script bindings in shell window. --- diff --git a/Tools/idle/EditorWindow.py b/Tools/idle/EditorWindow.py index bb69a5be3ddb..a6bf090df319 100644 --- a/Tools/idle/EditorWindow.py +++ b/Tools/idle/EditorWindow.py @@ -95,6 +95,7 @@ class EditorWindow: about_text = about_text vars = {} + runnable = False # Shell window cannot Import Module or Run Script def __init__(self, flist=None, filename=None, key=None, root=None): edconf = idleconf.getsection('EditorWindow') diff --git a/Tools/idle/PyShell.py b/Tools/idle/PyShell.py index 03b468424d0a..7e2deaf68e3c 100644 --- a/Tools/idle/PyShell.py +++ b/Tools/idle/PyShell.py @@ -76,6 +76,7 @@ class PyShellEditorWindow(EditorWindow): # Regular text edit window when a shell is present # XXX ought to merge with regular editor window + runnable = True def __init__(self, *args): apply(EditorWindow.__init__, (self,) + args) diff --git a/Tools/idle/ScriptBinding.py b/Tools/idle/ScriptBinding.py index 4071681b7fd1..3e1279ccbc37 100644 --- a/Tools/idle/ScriptBinding.py +++ b/Tools/idle/ScriptBinding.py @@ -51,6 +51,9 @@ class ScriptBinding: ] def __init__(self, editwin): + if not editwin.runnable: + self.menudefs = [] + self.keydefs = {} self.editwin = editwin # Provide instance variables referenced by Debugger # XXX This should be done differently