Skip to content

Commit 17d4c53

Browse files
bpo-33907: Rename an IDLE module and classes. (GH-7810)
Fix-up class name duplication in PR GH-7807. Combined effect is that module calltips and its class CallTips are now calltip and Calltip. In module calltip_w class CallTip is now CalltipWindow. (cherry picked from commit 9af1836) Co-authored-by: Terry Jan Reedy <[email protected]>
1 parent e97a685 commit 17d4c53

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

Lib/idlelib/calltip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def close(self):
3131

3232
def _make_tk_calltip_window(self):
3333
# See __init__ for usage
34-
return calltip_w.Calltip(self.text)
34+
return calltip_w.CalltipWindow(self.text)
3535

3636
def _remove_calltip_window(self, event=None):
3737
if self.active_calltip:
@@ -44,7 +44,7 @@ def force_open_calltip_event(self, event):
4444
return "break"
4545

4646
def try_open_calltip_event(self, event):
47-
"""Happens when it would be nice to open a Calltip, but not really
47+
"""Happens when it would be nice to open a calltip, but not really
4848
necessary, for example after an opening bracket, so function calls
4949
won't be made.
5050
"""

Lib/idlelib/calltip_w.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""A Calltip window class for Tkinter/IDLE.
1+
"""A calltip window class for Tkinter/IDLE.
22
33
After tooltip.py, which uses ideas gleaned from PySol
44
Used by calltip.
@@ -13,7 +13,7 @@
1313

1414
MARK_RIGHT = "calltipwindowregion_right"
1515

16-
class Calltip:
16+
class CalltipWindow:
1717

1818
def __init__(self, widget):
1919
self.widget = widget
@@ -47,7 +47,7 @@ def position_window(self):
4747
def showtip(self, text, parenleft, parenright):
4848
"""Show the calltip, bind events which will close it and reposition it.
4949
"""
50-
# Only called in Calltip, where lines are truncated
50+
# Only called in calltip.Calltip, where lines are truncated
5151
self.text = text
5252
if self.tipwindow or not self.text:
5353
return
@@ -147,7 +147,7 @@ def _calltip_window(parent): # htest #
147147
text.pack(side=LEFT, fill=BOTH, expand=1)
148148
text.insert("insert", "string.split")
149149
top.update()
150-
calltip = Calltip(text)
150+
calltip = CalltipWindow(text)
151151

152152
def calltip_show(event):
153153
calltip.showtip("(s=Hello world)", "insert", "end")

Lib/idlelib/idle_test/test_calltip_w.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
from tkinter import Tk, Text
77

88

9-
class CallTipTest(unittest.TestCase):
9+
class CallTipWindowTest(unittest.TestCase):
1010

1111
@classmethod
1212
def setUpClass(cls):
1313
requires('gui')
1414
cls.root = Tk()
1515
cls.root.withdraw()
1616
cls.text = Text(cls.root)
17-
cls.calltip = calltip_w.Calltip(cls.text)
17+
cls.calltip = calltip_w.CalltipWindow(cls.text)
1818

1919
@classmethod
2020
def tearDownClass(cls):
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
For consistency and appearance, rename an IDLE module and class. Module
2-
idlelib.calltips is now calltip. Class idlelib.calltip_w.CallTip is now
3-
Calltip.
1+
For consistency and clarity, rename an IDLE module and classes.
2+
Module calltips and its class CallTips are now calltip and Calltip.
3+
In module calltip_w, class CallTip is now CalltipWindow.

0 commit comments

Comments
 (0)