From 54c02875f121a4e2146f9b4d00b692da51f87bba Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 6 Jun 1998 16:12:26 +0000 Subject: No more evals. svn path=/trunk/; revision=1923 --- fetchmailconf | 18 +++++++----------- 1 file 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()) # -- cgit v1.2.3