diff options
author | Kurt B. Kaiser <kbk@shore.net> | 2007-08-21 19:54:18 (GMT) |
---|---|---|
committer | Kurt B. Kaiser <kbk@shore.net> | 2007-08-21 19:54:18 (GMT) |
commit | 003b09883ee3a710e85a68183861168c059ef773 (patch) | |
tree | 9ac9ce62a5ee0d1089dab1e2f3877f853fbacd8d | |
parent | 3741effcf8de2af3224e20af2865b7e378e59855 (diff) | |
download | cpython-003b09883ee3a710e85a68183861168c059ef773.zip cpython-003b09883ee3a710e85a68183861168c059ef773.tar.gz cpython-003b09883ee3a710e85a68183861168c059ef773.tar.bz2 |
eliminate "from ... import *" in a function.
-rw-r--r-- | Lib/idlelib/Percolator.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/idlelib/Percolator.py b/Lib/idlelib/Percolator.py index 22b6288..dc28835 100644 --- a/Lib/idlelib/Percolator.py +++ b/Lib/idlelib/Percolator.py @@ -51,8 +51,8 @@ class Percolator: 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 main(): 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 @@ def main(): 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 @@ def main(): root.mainloop() if __name__ == "__main__": - from Tkinter import * main() |