aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-05-26 13:43:37 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-05-26 13:43:37 +0000
commit4e3c2a71051e3fea6b66060450aff60e8cc312cb (patch)
tree0d5ca061e397ca6f26c8d9a85c761ffa88784d8e
parent55f9e738e524be7e37f24e925d74d87da4e4323e (diff)
downloadfetchmail-4e3c2a71051e3fea6b66060450aff60e8cc312cb.tar.gz
fetchmail-4e3c2a71051e3fea6b66060450aff60e8cc312cb.tar.bz2
fetchmail-4e3c2a71051e3fea6b66060450aff60e8cc312cb.zip
post/gather abstraction, part 2.
svn path=/trunk/; revision=1851
-rwxr-xr-xfetchmailconf28
1 files changed, 3 insertions, 25 deletions
diff --git a/fetchmailconf b/fetchmailconf
index 42a8846f..3f8f4af5 100755
--- a/fetchmailconf
+++ b/fetchmailconf
@@ -882,7 +882,7 @@ the configuration issues; see the manual
page section on multidrop mode.
"""}
-class UserEdit(Frame):
+class UserEdit(Frame, MyWidget):
def __init__(self, username, server):
self.server = server
self.user = None
@@ -901,40 +901,18 @@ class UserEdit(Frame):
self.master.title('Fetchmail user ' + self.user.remote
+ ' querying ' + self.server.pollname);
self.master.iconname('Fetchmail user ' + self.user.remote);
- self.post()
+ self.post(User, 'user')
self.makeWidgets(mode, self.server.pollname)
# self.grab_set()
# self.focus_set()
# self.wait_window()
- def post(self):
- # we can't abstract this away, execs would happen in the wrong scope
- for x in User.typemap:
- target = "self." + x[0]
- source = "self.user." + x[0]
- if x[1] == 'Boolean':
- exec target + " = BooleanVar(self)"
- if eval(source):
- exec target + ".set(" + source + ")"
- elif x[1] == 'String':
- exec target + " = StringVar(self)"
- if eval(source):
- exec target + ".set(" + source + ")"
- elif x[1] == 'Int':
- exec target + " = IntVar(self)"
- if eval(source):
- exec target + ".set(" + source + ")"
-
- def gather(self):
- for x in User.typemap:
- setattr(self.user, x[0], getattr(self, x[0]).get())
-
def nosave(self):
if ConfirmQuit(self, 'user option editing'):
Widget.destroy(self.master)
def save(self):
- self.gather()
+ self.gather(User, 'user')
Widget.destroy(self.master)
def makeWidgets(self, mode, servername):