mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-31459: Rename IDLE's module browser from Class Browser to Module Browser. (#3704)
The original module-level class and method browser became a module browser, with the addition of module-level functions, years ago. Nested classes and functions were added yesterday. For back- compatibility, the virtual event <<open-class-browser>>, which appears on the Keys tab of the Settings dialog, is not changed. Patch by Cheryl Sabella.
This commit is contained in:
parent
99167f85b7
commit
cd99e79dc7
7 changed files with 44 additions and 37 deletions
|
@ -1,4 +1,4 @@
|
|||
"""Class browser.
|
||||
"""Module browser.
|
||||
|
||||
XXX TO DO:
|
||||
|
||||
|
@ -55,7 +55,7 @@ def transform_children(child_dict, modname=None):
|
|||
return sorted(obs, key=lambda o: o.lineno)
|
||||
|
||||
|
||||
class ClassBrowser:
|
||||
class ModuleBrowser:
|
||||
"""Browse module classes and functions in IDLE.
|
||||
"""
|
||||
# This class is the base class for pathbrowser.PathBrowser.
|
||||
|
@ -122,8 +122,8 @@ class ClassBrowser:
|
|||
|
||||
def settitle(self):
|
||||
"Set the window title."
|
||||
self.top.wm_title("Class Browser - " + self.name)
|
||||
self.top.wm_iconname("Class Browser")
|
||||
self.top.wm_title("Module Browser - " + self.name)
|
||||
self.top.wm_iconname("Module Browser")
|
||||
|
||||
def rootnode(self):
|
||||
"Return a ModuleBrowserTreeItem as the root of the tree."
|
||||
|
@ -226,7 +226,7 @@ class ChildBrowserTreeItem(TreeItem):
|
|||
pass
|
||||
|
||||
|
||||
def _class_browser(parent): # htest #
|
||||
def _module_browser(parent): # htest #
|
||||
try:
|
||||
file = sys.argv[1] # If pass file on command line
|
||||
# If this succeeds, unittest will fail.
|
||||
|
@ -242,10 +242,10 @@ def _class_browser(parent): # htest #
|
|||
flist = pyshell.PyShellFileList(parent)
|
||||
global file_open
|
||||
file_open = flist.open
|
||||
ClassBrowser(flist, name, [dir], _htest=True)
|
||||
ModuleBrowser(flist, name, [dir], _htest=True)
|
||||
|
||||
if __name__ == "__main__":
|
||||
from unittest import main
|
||||
main('idlelib.idle_test.test_browser', verbosity=2, exit=False)
|
||||
from idlelib.idle_test.htest import run
|
||||
run(_class_browser)
|
||||
run(_module_browser)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue