From 1e78b00609d4d284f6316a328aa9b25c1cf2a254 Mon Sep 17 00:00:00 2001 From: Catalin Marinas Date: Tue, 28 Mar 2006 22:01:02 +0100 Subject: [PATCH] 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 --- examples/stgitrc | 3 +++ stgit/commands/mail.py | 2 +- stgit/config.py | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/stgitrc b/examples/stgitrc index d9bd6ca8..fdb11b14 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 88e9241c..456c4b1f 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 a124cb7e..e6c95385 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"') -- 2.11.4.GIT