bpo-33907: Rename an IDLE module and classes. (GH-7810)

Fix-up class name duplication in PR #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.
This commit is contained in:
Terry Jan Reedy 2018-06-20 02:18:49 -04:00 committed by GitHub
parent acdc660efc
commit 9af1836664
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 11 deletions

View file

@ -31,7 +31,7 @@ class Calltip:
def _make_tk_calltip_window(self): def _make_tk_calltip_window(self):
# See __init__ for usage # See __init__ for usage
return calltip_w.Calltip(self.text) return calltip_w.CalltipWindow(self.text)
def _remove_calltip_window(self, event=None): def _remove_calltip_window(self, event=None):
if self.active_calltip: if self.active_calltip:
@ -44,7 +44,7 @@ class Calltip:
return "break" return "break"
def try_open_calltip_event(self, event): def try_open_calltip_event(self, event):
"""Happens when it would be nice to open a Calltip, but not really """Happens when it would be nice to open a calltip, but not really
necessary, for example after an opening bracket, so function calls necessary, for example after an opening bracket, so function calls
won't be made. won't be made.
""" """

View file

@ -1,4 +1,4 @@
"""A Calltip window class for Tkinter/IDLE. """A calltip window class for Tkinter/IDLE.
After tooltip.py, which uses ideas gleaned from PySol After tooltip.py, which uses ideas gleaned from PySol
Used by calltip. Used by calltip.
@ -13,7 +13,7 @@ CHECKHIDE_TIME = 100 # milliseconds
MARK_RIGHT = "calltipwindowregion_right" MARK_RIGHT = "calltipwindowregion_right"
class Calltip: class CalltipWindow:
def __init__(self, widget): def __init__(self, widget):
self.widget = widget self.widget = widget
@ -47,7 +47,7 @@ class Calltip:
def showtip(self, text, parenleft, parenright): def showtip(self, text, parenleft, parenright):
"""Show the calltip, bind events which will close it and reposition it. """Show the calltip, bind events which will close it and reposition it.
""" """
# Only called in Calltip, where lines are truncated # Only called in calltip.Calltip, where lines are truncated
self.text = text self.text = text
if self.tipwindow or not self.text: if self.tipwindow or not self.text:
return return
@ -147,7 +147,7 @@ def _calltip_window(parent): # htest #
text.pack(side=LEFT, fill=BOTH, expand=1) text.pack(side=LEFT, fill=BOTH, expand=1)
text.insert("insert", "string.split") text.insert("insert", "string.split")
top.update() top.update()
calltip = Calltip(text) calltip = CalltipWindow(text)
def calltip_show(event): def calltip_show(event):
calltip.showtip("(s=Hello world)", "insert", "end") calltip.showtip("(s=Hello world)", "insert", "end")

View file

@ -6,7 +6,7 @@ from test.support import requires
from tkinter import Tk, Text from tkinter import Tk, Text
class CallTipTest(unittest.TestCase): class CallTipWindowTest(unittest.TestCase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
@ -14,7 +14,7 @@ class CallTipTest(unittest.TestCase):
cls.root = Tk() cls.root = Tk()
cls.root.withdraw() cls.root.withdraw()
cls.text = Text(cls.root) cls.text = Text(cls.root)
cls.calltip = calltip_w.Calltip(cls.text) cls.calltip = calltip_w.CalltipWindow(cls.text)
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):

View file

@ -1,3 +1,3 @@
For consistency and appearance, rename an IDLE module and class. Module For consistency and clarity, rename an IDLE module and classes.
idlelib.calltips is now calltip. Class idlelib.calltip_w.CallTip is now Module calltips and its class CallTips are now calltip and Calltip.
Calltip. In module calltip_w, class CallTip is now CalltipWindow.