From: Catalin Marinas Date: Tue, 28 Mar 2006 21:01:02 +0000 (+0100) Subject: Add the "smtpdelay" config option X-Git-Tag: v0.14.3~521 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/1e78b00609d4d284f6316a328aa9b25c1cf2a254 Add the "smtpdelay" config option This option is similar to the --sleep option for the mail command, i.e. the number of seconds between sending two consecutive patches. Signed-off-by: Catalin Marinas --- diff --git a/examples/stgitrc b/examples/stgitrc index d9bd6ca..fdb11b1 100644 --- a/examples/stgitrc +++ b/examples/stgitrc @@ -17,6 +17,9 @@ smtpserver: localhost:25 #smtpuser: username #smtppassword: password +# delay between messages in seconds (defaults to 2) +#smtpdelay: 2 + # stg will look for this first, then look for the EDITOR environmental # variable, then default to using 'vi' #editor: /usr/bin/vi diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py index 88e9241..456c4b1 100644 --- a/stgit/commands/mail.py +++ b/stgit/commands/mail.py @@ -426,7 +426,7 @@ def func(parser, options, args): if options.sleep != None: sleep = options.sleep else: - sleep = 2 + sleep = config.getint('stgit', 'smtpdelay') # send the cover message (if any) if options.cover or options.edit: diff --git a/stgit/config.py b/stgit/config.py index a124cb7..e6c9538 100644 --- a/stgit/config.py +++ b/stgit/config.py @@ -32,6 +32,7 @@ config = ConfigParser.RawConfigParser() config.add_section('stgit') config.set('stgit', 'autoresolved', 'no') config.set('stgit', 'smtpserver', 'localhost:25') +config.set('stgit', 'smtpdelay', '2') config.set('stgit', 'merger', 'diff3 -L local -L older -L remote -m -E ' \ '"%(branch1)s" "%(ancestor)s" "%(branch2)s" > "%(output)s"')