diff options
author | Guido van Rossum <guido@python.org> | 1998-03-05 20:12:18 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-03-05 20:12:18 (GMT) |
commit | 88b02cf346da9c648bddd762d49fae9e33f9a6c7 (patch) | |
tree | b710045c72cd8b61366392f28b5c26bd27f1e290 /Tools | |
parent | 213511754239f84de0b0bc57f59a25a49e82df05 (diff) | |
download | cpython-88b02cf346da9c648bddd762d49fae9e33f9a6c7.zip cpython-88b02cf346da9c648bddd762d49fae9e33f9a6c7.tar.gz cpython-88b02cf346da9c648bddd762d49fae9e33f9a6c7.tar.bz2 |
Use a better way to bind the checkext instance variable to a check
button widget, not involving a __getattr__() method but a callback on
the widget.
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/webchecker/wcgui.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/Tools/webchecker/wcgui.py b/Tools/webchecker/wcgui.py index 10c77d0..027718f 100755 --- a/Tools/webchecker/wcgui.py +++ b/Tools/webchecker/wcgui.py @@ -120,10 +120,11 @@ class CheckerWindow(webchecker.Checker): self.__step = Button(self.__controls, text="Check one", command=self.step) self.__step.pack(side=LEFT) - self.__cv = BooleanVar() - self.__cv.set(1) + self.__cv = BooleanVar(parent) + self.__cv.set(self.checkext) self.__checkext = Checkbutton(self.__controls, variable=self.__cv, - text="Check nonlocal links") + command=self.update_checkext, + text="Check nonlocal links",) self.__checkext.pack(side=LEFT) self.__reset = Button(self.__controls, text="Start over", command=self.reset) self.__reset.pack(side=LEFT) @@ -144,17 +145,12 @@ class CheckerWindow(webchecker.Checker): self.__errors = ListPanel(mp, "Pages w/ bad links", self.showinfo) self.__details = LogPanel(mp, "Details") webchecker.Checker.__init__(self) - del self.checkext # See __getattr__ below if root: root = string.strip(str(root)) if root: self.suggestroot(root) self.newstatus() - def __getattr__(self, name): - if name != 'checkext': raise AttributeError, name - return self.__cv.get() - def reset(self): webchecker.Checker.reset(self) for p in self.__todo, self.__done, self.__bad, self.__errors: @@ -299,6 +295,9 @@ class CheckerWindow(webchecker.Checker): self.__status.config(text="Status: "+self.status()) self.__parent.update() + def update_checkext(self): + self.checkext = self.__cv.get() + class ListPanel: @@ -395,7 +394,7 @@ class MultiPanel: self.panels = {} def addpanel(self, name, on=0): - v = StringVar() + v = StringVar(self.parent) if on: v.set(name) else: |