From ab11987d03f42ecd69e69b9e3d183ece66c09b63 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 26 May 1998 06:09:30 +0000 Subject: Separate initialization from editing. svn path=/trunk/; revision=1845 --- fetchmailconf | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'fetchmailconf') diff --git a/fetchmailconf b/fetchmailconf index ad84ea80..8ef9092b 100755 --- a/fetchmailconf +++ b/fetchmailconf @@ -484,18 +484,20 @@ This will take you to a site configuration dialogue. class ConfigurationEdit(Frame): - def __init__(self, configuration, mode, master=None): - Frame.__init__(self, master) - self.master.title('fetchmail ' + mode + ' configurator'); - self.master.iconname('fetchmail ' + mode + ' configurator'); + def __init__(self, configuration, master=None): self.configuration = configuration - Pack.config(self) + self.master = master + ConfigurationEdit.mode_to_help = { + 'novice':configure_novice_help, 'expert':configure_expert_help + } + + def edit(self, mode): self.mode = mode - self.mode_to_help = {'novice':configure_novice_help, - 'expert':configure_expert_help} - self.makeWidgets() + Frame.__init__(self, self.master) + self.master.title('fetchmail ' + self.mode + ' configurator'); + self.master.iconname('fetchmail ' + self.mode + ' configurator'); + Pack.config(self) - def makeWidgets(self): self.poll_interval = StringVar(self) self.poll_interval.set(`self.configuration.poll_interval`) self.syslog = BooleanVar(self) @@ -509,7 +511,7 @@ class ConfigurationEdit(Frame): self.invisible.set(self.configuration.invisible) dispose_window(self, 'Configurator ' + self.mode + ' Controls', - self.mode_to_help[self.mode]) + ConfigurationEdit.mode_to_help[self.mode]) gf = Frame(self, relief=RAISED, bd = 5) Label(gf, @@ -1063,11 +1065,11 @@ Or you can just select `Quit' to leave the configurator now. def novice(self): self.destroy() - ConfigurationEdit(Configuration, 'novice') + ConfigurationEdit(Configuration).edit('novice') def expert(self): self.destroy() - ConfigurationEdit(Configuration, 'expert') + ConfigurationEdit(Configuration).edit('expert') def leave(self): self.quit() -- cgit v1.2.3