Issue #16233: When the module browser is not invoked in an editor window with

a filename, pop up the Open Module box. If a module is opened, open a
corresponding browser.
This commit is contained in:
Terry Jan Reedy 2014-10-15 22:01:31 -04:00
parent c966103be6
commit 380ec63f23

View file

@ -689,16 +689,15 @@ class EditorWindow(object):
self.flist.open(file_path) self.flist.open(file_path)
else: else:
self.io.loadfile(file_path) self.io.loadfile(file_path)
return file_path
def open_class_browser(self, event=None): def open_class_browser(self, event=None):
filename = self.io.filename filename = self.io.filename
if not filename: if not (self.__class__.__name__ == 'PyShellEditorWindow'
tkMessageBox.showerror( and filename):
"No filename", filename = self.open_module()
"This buffer has no associated filename", if filename is None:
master=self.text) return
self.text.focus_set()
return None
head, tail = os.path.split(filename) head, tail = os.path.split(filename)
base, ext = os.path.splitext(tail) base, ext = os.path.splitext(tail)
from idlelib import ClassBrowser from idlelib import ClassBrowser