bpo-33906: Rename idlelib.windows as window (#7833) · python/cpython@a361e89 (original) (raw)

`@@ -25,7 +25,7 @@

`

25

25

`from idlelib import query

`

26

26

`from idlelib import replace

`

27

27

`from idlelib import search

`

28

``

`-

from idlelib import windows

`

``

28

`+

from idlelib import window

`

29

29

``

30

30

`# The default tab setting for a Text widget, in average-width characters.

`

31

31

`TK_TABWIDTH_DEFAULT = 8

`

`@@ -101,7 +101,7 @@ def init(self, flist=None, filename=None, key=None, root=None):

`

101

101

`root = root or flist.root

`

102

102

`self.root = root

`

103

103

`self.menubar = Menu(root)

`

104

``

`-

self.top = top = windows.ListedToplevel(root, menu=self.menubar)

`

``

104

`+

self.top = top = window.ListedToplevel(root, menu=self.menubar)

`

105

105

`if flist:

`

106

106

`self.tkinter_vars = flist.vars

`

107

107

`#self.top.instance_dict makes flist.inversedict available to

`

`@@ -138,7 +138,7 @@ def init(self, flist=None, filename=None, key=None, root=None):

`

138

138

`self.top.protocol("WM_DELETE_WINDOW", self.close)

`

139

139

`self.top.bind("<>", self.close_event)

`

140

140

`if macosx.isAquaTk():

`

141

``

`-

Command-W on editorwindows doesn't work without this.

`

``

141

`+

Command-W on editor windows doesn't work without this.

`

142

142

`text.bind('<>', self.close_event)

`

143

143

`# Some OS X systems have only one mouse button, so use

`

144

144

`# control-click for popup context menus there. For two

`

`@@ -276,7 +276,7 @@ def init(self, flist=None, filename=None, key=None, root=None):

`

276

276

`menu.add_separator()

`

277

277

`end = end + 1

`

278

278

`self.wmenu_end = end

`

279

``

`-

windows.register_callback(self.postwindowsmenu)

`

``

279

`+

window.register_callback(self.postwindowsmenu)

`

280

280

``

281

281

`# Some abstractions so IDLE extensions are cross-IDE

`

282

282

`self.askyesno = tkMessageBox.askyesno

`

`@@ -436,14 +436,14 @@ def createmenubar(self):

`

436

436

`self.reset_help_menu_entries()

`

437

437

``

438

438

`def postwindowsmenu(self):

`

439

``

`-

Only called when Windows menu exists

`

``

439

`+

Only called when Window menu exists

`

440

440

`menu = self.menudict['windows']

`

441

441

`end = menu.index("end")

`

442

442

`if end is None:

`

443

443

`end = -1

`

444

444

`if end > self.wmenu_end:

`

445

445

`menu.delete(self.wmenu_end+1, end)

`

446

``

`-

windows.add_windows_to_menu(menu)

`

``

446

`+

window.add_windows_to_menu(menu)

`

447

447

``

448

448

`def handle_yview(self, event, *args):

`

449

449

`"Handle scrollbar."

`

`@@ -1012,7 +1012,7 @@ def close(self):

`

1012

1012

`def _close(self):

`

1013

1013

`if self.io.filename:

`

1014

1014

`self.update_recent_files_list(new_file=self.io.filename)

`

1015

``

`-

windows.unregister_callback(self.postwindowsmenu)

`

``

1015

`+

window.unregister_callback(self.postwindowsmenu)

`

1016

1016

`self.unload_extensions()

`

1017

1017

`self.io.close()

`

1018

1018

`self.io = None

`