bpo-31460: Simplify the API of IDLE's Module Browser. (#3842)

Passing a widget instead of an flist with a root widget opens the option of
creating a browser frame that is only part of a window. Passing a full file
name instead of pieces assumed to come from a .py file opens the possibility
of browsing python files that do not end in .py.
This commit is contained in:
Terry Jan Reedy 2017-09-30 19:54:28 -04:00 committed by GitHub
parent bfebfd81de
commit d6bb65f378
4 changed files with 42 additions and 47 deletions

View file

@ -664,10 +664,8 @@ class EditorWindow(object):
filename = self.open_module()
if filename is None:
return "break"
head, tail = os.path.split(filename)
base, ext = os.path.splitext(tail)
from idlelib import browser
browser.ModuleBrowser(self.flist, base, [head])
browser.ModuleBrowser(self.root, filename)
return "break"
def open_path_browser(self, event=None):