aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-06-06 16:12:26 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-06-06 16:12:26 +0000
commit54c02875f121a4e2146f9b4d00b692da51f87bba (patch)
treecf7e11966220d22078901879209d434aa29914b0
parentd02972396290fabceeccfff87e3817374f0c1ef2 (diff)
downloadfetchmail-54c02875f121a4e2146f9b4d00b692da51f87bba.tar.gz
fetchmail-54c02875f121a4e2146f9b4d00b692da51f87bba.tar.bz2
fetchmail-54c02875f121a4e2146f9b4d00b692da51f87bba.zip
No more evals.
svn path=/trunk/; revision=1923
-rwxr-xr-xfetchmailconf18
1 files changed, 7 insertions, 11 deletions
diff --git a/fetchmailconf b/fetchmailconf
index ce71be55..1480d3dd 100755
--- a/fetchmailconf
+++ b/fetchmailconf
@@ -461,24 +461,20 @@ def dispose_window(master, legend, help):
class MyWidget:
# Common methods for Tkinter widgets -- deals with Tkinter declaration
- def post(self, template, field):
- for x in template.typemap:
- source = "self." + field + "." + x[0]
+ def post(self, widgetclass, field):
+ for x in widgetclass.typemap:
if x[1] == 'Boolean':
setattr(self, x[0], BooleanVar(self))
- if eval(source):
- exec "self." + x[0] + ".set(" + source + ")"
elif x[1] == 'String':
setattr(self, x[0], StringVar(self))
- if eval(source):
- exec "self." + x[0] + ".set(" + source + ")"
elif x[1] == 'Int':
setattr(self, x[0], IntVar(self))
- if eval(source):
- exec "self." + x[0] + ".set(" + source + ")"
+ source = getattr(getattr(self, field), x[0])
+ if source:
+ getattr(self, x[0]).set(source)
- def fetch(self, template, field):
- for x in template.typemap:
+ def fetch(self, widgetclass, field):
+ for x in widgetclass.typemap:
setattr(getattr(self, field), x[0], getattr(self, x[0]).get())
#