bpo-33906: Rename idlelib.windows as window (#7833)

Match Window on the main menu and remove last plural module name.
Change imports, test, and attribute references to match new name.
This commit is contained in:
Terry Jan Reedy 2018-06-20 21:25:59 -04:00 committed by GitHub
parent 87a927325e
commit a361e89d5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 24 additions and 22 deletions

View file

@ -25,7 +25,7 @@ from idlelib import pyparse
from idlelib import query
from idlelib import replace
from idlelib import search
from idlelib import windows
from idlelib import window
# The default tab setting for a Text widget, in average-width characters.
TK_TABWIDTH_DEFAULT = 8
@ -101,7 +101,7 @@ class EditorWindow(object):
root = root or flist.root
self.root = root
self.menubar = Menu(root)
self.top = top = windows.ListedToplevel(root, menu=self.menubar)
self.top = top = window.ListedToplevel(root, menu=self.menubar)
if flist:
self.tkinter_vars = flist.vars
#self.top.instance_dict makes flist.inversedict available to
@ -138,7 +138,7 @@ class EditorWindow(object):
self.top.protocol("WM_DELETE_WINDOW", self.close)
self.top.bind("<<close-window>>", self.close_event)
if macosx.isAquaTk():
# Command-W on editorwindows doesn't work without this.
# Command-W on editor windows doesn't work without this.
text.bind('<<close-window>>', self.close_event)
# Some OS X systems have only one mouse button, so use
# control-click for popup context menus there. For two
@ -276,7 +276,7 @@ class EditorWindow(object):
menu.add_separator()
end = end + 1
self.wmenu_end = end
windows.register_callback(self.postwindowsmenu)
window.register_callback(self.postwindowsmenu)
# Some abstractions so IDLE extensions are cross-IDE
self.askyesno = tkMessageBox.askyesno
@ -436,14 +436,14 @@ class EditorWindow(object):
self.reset_help_menu_entries()
def postwindowsmenu(self):
# Only called when Windows menu exists
# Only called when Window menu exists
menu = self.menudict['windows']
end = menu.index("end")
if end is None:
end = -1
if end > self.wmenu_end:
menu.delete(self.wmenu_end+1, end)
windows.add_windows_to_menu(menu)
window.add_windows_to_menu(menu)
def handle_yview(self, event, *args):
"Handle scrollbar."
@ -1012,7 +1012,7 @@ class EditorWindow(object):
def _close(self):
if self.io.filename:
self.update_recent_files_list(new_file=self.io.filename)
windows.unregister_callback(self.postwindowsmenu)
window.unregister_callback(self.postwindowsmenu)
self.unload_extensions()
self.io.close()
self.io = None