summaryrefslogtreecommitdiff
path: root/Tools/webchecker/wcgui.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-03-05 20:12:18 +0000
committerGuido van Rossum <guido@python.org>1998-03-05 20:12:18 +0000
commit8a2848679af578d7772850281aa026f1055a9387 (patch)
treedb50d88b079cffd17ead1a44089da305454b901e /Tools/webchecker/wcgui.py
parente25e977f18e96f7020990864c66e4a7da134810f (diff)
downloadcpython-8a2848679af578d7772850281aa026f1055a9387.tar.gz
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/webchecker/wcgui.py')
-rwxr-xr-xTools/webchecker/wcgui.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/Tools/webchecker/wcgui.py b/Tools/webchecker/wcgui.py
index 10c77d014d..027718fb5b 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: