[Python-3000-checkins] r57266 - python/branches/py3k/Lib/idlelib/Percolator.py
kurt.kaiser
python-3000-checkins at python.org
Tue Aug 21 21:54:18 CEST 2007
Author: kurt.kaiser
Date: Tue Aug 21 21:54:18 2007
New Revision: 57266
Modified:
python/branches/py3k/Lib/idlelib/Percolator.py
Log:
eliminate "from ... import *" in a function.
Modified: python/branches/py3k/Lib/idlelib/Percolator.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/Percolator.py (original)
+++ python/branches/py3k/Lib/idlelib/Percolator.py Tue Aug 21 21:54:18 2007
@@ -51,8 +51,8 @@
f.setdelegate(filter.delegate)
filter.setdelegate(None)
-
def main():
+ import Tkinter as Tk
class Tracer(Delegator):
def __init__(self, name):
self.name = name
@@ -63,9 +63,9 @@
def delete(self, *args):
print(self.name, ": delete", args)
self.delegate.delete(*args)
- root = Tk()
+ root = Tk.Tk()
root.wm_protocol("WM_DELETE_WINDOW", root.quit)
- text = Text()
+ text = Tk.Text()
text.pack()
text.focus_set()
p = Percolator(text)
@@ -73,7 +73,7 @@
t2 = Tracer("t2")
p.insertfilter(t1)
p.insertfilter(t2)
- root.mainloop()
+ root.mainloop() # click close widget to continue...
p.removefilter(t2)
root.mainloop()
p.insertfilter(t2)
@@ -81,5 +81,4 @@
root.mainloop()
if __name__ == "__main__":
- from Tkinter import *
main()
More information about the Python-3000-checkins
mailing list