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.
This commit is contained in:
Terry Jan Reedy 2018-06-19 23:00:35 -04:00 committed by GitHub
parent 4d92158f4c
commit 06e2029dfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 35 additions and 32 deletions

View file

@ -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 @@ CHECKHIDE_TIME = 100 # milliseconds
MARK_RIGHT = "calltipwindowregion_right"
class CallTip:
class Calltip:
def __init__(self, widget):
self.widget = widget
@ -47,7 +47,7 @@ class CallTip:
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 @@ def _calltip_window(parent): # htest #
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 @@ def _calltip_window(parent): # htest #
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)