[Python-checkins] bpo-33907: Rename an IDLE module and classes. (GH-7810)
Terry Jan Reedy
webhook-mailer at python.org
Wed Jun 20 02:18:52 EDT 2018
https://github.com/python/cpython/commit/9af1836664d241fec6e62955ffaa559b3a2eaf1b
commit: 9af1836664d241fec6e62955ffaa559b3a2eaf1b
branch: master
author: Terry Jan Reedy <tjreedy at udel.edu>
committer: GitHub <noreply at github.com>
date: 2018-06-20T02:18:49-04:00
summary:
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.
files:
M Lib/idlelib/calltip.py
M Lib/idlelib/calltip_w.py
M Lib/idlelib/idle_test/test_calltip_w.py
M Misc/NEWS.d/next/IDLE/2018-06-19-22-21-27.bpo-33907.z-_B3N.rst
diff --git a/Lib/idlelib/calltip.py b/Lib/idlelib/calltip.py
index 1ff0deb96844..596d2bcb2775 100644
--- a/Lib/idlelib/calltip.py
+++ b/Lib/idlelib/calltip.py
@@ -31,7 +31,7 @@ def close(self):
def _make_tk_calltip_window(self):
# See __init__ for usage
- return calltip_w.Calltip(self.text)
+ return calltip_w.CalltipWindow(self.text)
def _remove_calltip_window(self, event=None):
if self.active_calltip:
@@ -44,7 +44,7 @@ def force_open_calltip_event(self, event):
return "break"
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
won't be made.
"""
diff --git a/Lib/idlelib/calltip_w.py b/Lib/idlelib/calltip_w.py
index b75e4c27db34..34531f431a67 100644
--- a/Lib/idlelib/calltip_w.py
+++ b/Lib/idlelib/calltip_w.py
@@ -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
Used by calltip.
@@ -13,7 +13,7 @@
MARK_RIGHT = "calltipwindowregion_right"
-class Calltip:
+class CalltipWindow:
def __init__(self, widget):
self.widget = widget
@@ -47,7 +47,7 @@ def position_window(self):
def showtip(self, text, parenleft, parenright):
"""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
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 = CalltipWindow(text)
def calltip_show(event):
calltip.showtip("(s=Hello world)", "insert", "end")
diff --git a/Lib/idlelib/idle_test/test_calltip_w.py b/Lib/idlelib/idle_test/test_calltip_w.py
index fc1f11140035..59e69677e679 100644
--- a/Lib/idlelib/idle_test/test_calltip_w.py
+++ b/Lib/idlelib/idle_test/test_calltip_w.py
@@ -6,7 +6,7 @@
from tkinter import Tk, Text
-class CallTipTest(unittest.TestCase):
+class CallTipWindowTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
@@ -14,7 +14,7 @@ def setUpClass(cls):
cls.root = Tk()
cls.root.withdraw()
cls.text = Text(cls.root)
- cls.calltip = calltip_w.Calltip(cls.text)
+ cls.calltip = calltip_w.CalltipWindow(cls.text)
@classmethod
def tearDownClass(cls):
diff --git a/Misc/NEWS.d/next/IDLE/2018-06-19-22-21-27.bpo-33907.z-_B3N.rst b/Misc/NEWS.d/next/IDLE/2018-06-19-22-21-27.bpo-33907.z-_B3N.rst
index 9c5a070e88ed..b4741060bb21 100644
--- a/Misc/NEWS.d/next/IDLE/2018-06-19-22-21-27.bpo-33907.z-_B3N.rst
+++ b/Misc/NEWS.d/next/IDLE/2018-06-19-22-21-27.bpo-33907.z-_B3N.rst
@@ -1,3 +1,3 @@
-For consistency and appearance, rename an IDLE module and class. Module
-idlelib.calltips is now calltip. Class idlelib.calltip_w.CallTip is now
-Calltip.
+For consistency and clarity, rename an IDLE module and classes.
+Module calltips and its class CallTips are now calltip and Calltip.
+In module calltip_w, class CallTip is now CalltipWindow.
More information about the Python-checkins
mailing list