bpo-33907: Rename an IDLE module and classes. (GH-7810) · python/cpython@17d4c53 (original) (raw)
4 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -31,7 +31,7 @@ def close(self): | ||
31 | 31 | |
32 | 32 | def _make_tk_calltip_window(self): |
33 | 33 | # See __init__ for usage |
34 | -return calltip_w.Calltip(self.text) | |
34 | +return calltip_w.CalltipWindow(self.text) | |
35 | 35 | |
36 | 36 | def _remove_calltip_window(self, event=None): |
37 | 37 | if self.active_calltip: |
@@ -44,7 +44,7 @@ def force_open_calltip_event(self, event): | ||
44 | 44 | return "break" |
45 | 45 | |
46 | 46 | 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 | |
48 | 48 | necessary, for example after an opening bracket, so function calls |
49 | 49 | won't be made. |
50 | 50 | """ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
1 | -"""A Calltip window class for Tkinter/IDLE. | |
1 | +"""A calltip window class for Tkinter/IDLE. | |
2 | 2 | |
3 | 3 | After tooltip.py, which uses ideas gleaned from PySol |
4 | 4 | Used by calltip. |
@@ -13,7 +13,7 @@ | ||
13 | 13 | |
14 | 14 | MARK_RIGHT = "calltipwindowregion_right" |
15 | 15 | |
16 | -class Calltip: | |
16 | +class CalltipWindow: | |
17 | 17 | |
18 | 18 | def __init__(self, widget): |
19 | 19 | self.widget = widget |
@@ -47,7 +47,7 @@ def position_window(self): | ||
47 | 47 | def showtip(self, text, parenleft, parenright): |
48 | 48 | """Show the calltip, bind events which will close it and reposition it. |
49 | 49 | """ |
50 | -# Only called in Calltip, where lines are truncated | |
50 | +# Only called in calltip.Calltip, where lines are truncated | |
51 | 51 | self.text = text |
52 | 52 | if self.tipwindow or not self.text: |
53 | 53 | return |
@@ -147,7 +147,7 @@ def _calltip_window(parent): # htest # | ||
147 | 147 | text.pack(side=LEFT, fill=BOTH, expand=1) |
148 | 148 | text.insert("insert", "string.split") |
149 | 149 | top.update() |
150 | -calltip = Calltip(text) | |
150 | +calltip = CalltipWindow(text) | |
151 | 151 | |
152 | 152 | def calltip_show(event): |
153 | 153 | calltip.showtip("(s=Hello world)", "insert", "end") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -6,15 +6,15 @@ | ||
6 | 6 | from tkinter import Tk, Text |
7 | 7 | |
8 | 8 | |
9 | -class CallTipTest(unittest.TestCase): | |
9 | +class CallTipWindowTest(unittest.TestCase): | |
10 | 10 | |
11 | 11 | @classmethod |
12 | 12 | def setUpClass(cls): |
13 | 13 | requires('gui') |
14 | 14 | cls.root = Tk() |
15 | 15 | cls.root.withdraw() |
16 | 16 | cls.text = Text(cls.root) |
17 | -cls.calltip = calltip_w.Calltip(cls.text) | |
17 | +cls.calltip = calltip_w.CalltipWindow(cls.text) | |
18 | 18 | |
19 | 19 | @classmethod |
20 | 20 | def tearDownClass(cls): |
Original file line number | Diff line number | Diff 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. |