mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
eliminate "from ... import *" in a function.
This commit is contained in:
parent
3741effcf8
commit
003b09883e
1 changed files with 4 additions and 5 deletions
|
@ -51,8 +51,8 @@ class Percolator:
|
||||||
f.setdelegate(filter.delegate)
|
f.setdelegate(filter.delegate)
|
||||||
filter.setdelegate(None)
|
filter.setdelegate(None)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
import Tkinter as Tk
|
||||||
class Tracer(Delegator):
|
class Tracer(Delegator):
|
||||||
def __init__(self, name):
|
def __init__(self, name):
|
||||||
self.name = name
|
self.name = name
|
||||||
|
@ -63,9 +63,9 @@ def main():
|
||||||
def delete(self, *args):
|
def delete(self, *args):
|
||||||
print(self.name, ": delete", args)
|
print(self.name, ": delete", args)
|
||||||
self.delegate.delete(*args)
|
self.delegate.delete(*args)
|
||||||
root = Tk()
|
root = Tk.Tk()
|
||||||
root.wm_protocol("WM_DELETE_WINDOW", root.quit)
|
root.wm_protocol("WM_DELETE_WINDOW", root.quit)
|
||||||
text = Text()
|
text = Tk.Text()
|
||||||
text.pack()
|
text.pack()
|
||||||
text.focus_set()
|
text.focus_set()
|
||||||
p = Percolator(text)
|
p = Percolator(text)
|
||||||
|
@ -73,7 +73,7 @@ def main():
|
||||||
t2 = Tracer("t2")
|
t2 = Tracer("t2")
|
||||||
p.insertfilter(t1)
|
p.insertfilter(t1)
|
||||||
p.insertfilter(t2)
|
p.insertfilter(t2)
|
||||||
root.mainloop()
|
root.mainloop() # click close widget to continue...
|
||||||
p.removefilter(t2)
|
p.removefilter(t2)
|
||||||
root.mainloop()
|
root.mainloop()
|
||||||
p.insertfilter(t2)
|
p.insertfilter(t2)
|
||||||
|
@ -81,5 +81,4 @@ def main():
|
||||||
root.mainloop()
|
root.mainloop()
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
from Tkinter import *
|
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue