bpo-33907: Rename an IDLE module and class. (GH-7807)
Improve consistency and appearance. Module idlelib.calltips is now calltip.
Class idlelib.calltip_w.CallTip is now Calltip.
(cherry picked from commit 06e2029dfa500a42e3565ed7ba8573412f153d1c)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
diff --git a/Lib/idlelib/calltip_w.py b/Lib/idlelib/calltip_w.py
index 122b73a..b75e4c2 100644
--- a/Lib/idlelib/calltip_w.py
+++ b/Lib/idlelib/calltip_w.py
@@ -1,7 +1,7 @@
-"""A CallTip window class for Tkinter/IDLE.
+"""A Calltip window class for Tkinter/IDLE.
After tooltip.py, which uses ideas gleaned from PySol
-Used by the calltips IDLE extension.
+Used by calltip.
"""
from tkinter import Toplevel, Label, LEFT, SOLID, TclError
@@ -13,7 +13,7 @@
MARK_RIGHT = "calltipwindowregion_right"
-class CallTip:
+class Calltip:
def __init__(self, widget):
self.widget = widget
@@ -47,7 +47,7 @@
def showtip(self, text, parenleft, parenright):
"""Show the calltip, bind events which will close it and reposition it.
"""
- # Only called in CallTips, where lines are truncated
+ # Only called in Calltip, where lines are truncated
self.text = text
if self.tipwindow or not self.text:
return
@@ -147,7 +147,7 @@
text.pack(side=LEFT, fill=BOTH, expand=1)
text.insert("insert", "string.split")
top.update()
- calltip = CallTip(text)
+ calltip = Calltip(text)
def calltip_show(event):
calltip.showtip("(s=Hello world)", "insert", "end")
@@ -161,7 +161,7 @@
if __name__ == '__main__':
from unittest import main
- main('idlelib.idle_test.test_calltips', verbosity=2, exit=False)
+ main('idlelib.idle_test.test_calltip_w', verbosity=2, exit=False)
from idlelib.idle_test.htest import run
run(_calltip_window)