diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1998-05-26 15:55:40 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1998-05-26 15:55:40 +0000 |
commit | 4e67d05c5ecab1288f95187941f848dbc7c55992 (patch) | |
tree | 5cb4b8f92ae9e3fb5e8f5fe97131e52eb577d8fa | |
parent | 37e3ad7e81e15c4a9397c2d55a1ed0631453a1f8 (diff) | |
download | fetchmail-4e67d05c5ecab1288f95187941f848dbc7c55992.tar.gz fetchmail-4e67d05c5ecab1288f95187941f848dbc7c55992.tar.bz2 fetchmail-4e67d05c5ecab1288f95187941f848dbc7c55992.zip |
Now we can overwrite the .fetchmailrc
svn path=/trunk/; revision=1857
-rwxr-xr-x | fetchmailconf | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/fetchmailconf b/fetchmailconf index cc933e22..cde73c5e 100755 --- a/fetchmailconf +++ b/fetchmailconf @@ -2,6 +2,9 @@ # # A GUI configurator for generating Fetchmail configuration files # by Eric S. Raymond, <esr@snark.thyrsus.com>. Requires Python with Tkinter. +# +# TO DO: Arrange for save and quit buttons to clean up all frames dependent +# on the current ones. from Tkinter import * from Dialog import * @@ -596,12 +599,19 @@ class ConfigurationEdit(Frame, MyWidget): if ConfirmQuit(self, self.mode + " configuration editor"): self.quit() - # XXX Someday this must go to the actual config file location def save(self): self.fetch(Configuration, 'configuration') - sys.stdout.write("# Configuration created %s\n" % time.ctime(time.time())) - sys.stdout.write(`self.configuration`) - self.quit() + fetchmailrc = os.environ["HOME"] + "/.fetchmailrc" + if not os.path.isfile(fetchmailrc) or Dialog(self, + title = 'Overwrite existing run control file?', + text = 'Really overwrite existing run control file?', + bitmap = 'question', + strings = ('Yes', 'No'), + default = 1).num == 0: + fm = open(fetchmailrc, 'w') + fm.write("# Configuration created %s by fetchmailconf\n" % time.ctime(time.time())) + fm.write(`self.configuration`) + self.quit() # # Server editing stuff. |