mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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:
parent
bfebfd81de
commit
d6bb65f378
4 changed files with 42 additions and 47 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue