contrib/release.py: email: don't write '<>' for message-id twice

Minor code refactoring.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Nicolas Sebrecht 2017-10-08 16:39:56 +02:00
parent 832c704443
commit 8c9cd5b7e3
2 changed files with 7 additions and 7 deletions

View File

@ -230,7 +230,7 @@ class User(object):
answer = User.request(msg, prompt).lower() answer = User.request(msg, prompt).lower()
if answer in ['y', 'yes']: if answer in ['y', 'yes']:
return True return True
if defaultToYes and answer not in ['n', 'no']: if defaultToYes is not False and answer not in ['n', 'no']:
return True return True
return False return False

View File

@ -221,7 +221,7 @@ class Announce(object):
self.version = version self.version = version
def setHeaders(self, messageId, date): def setHeaders(self, messageId, date):
self.fd.write("Message-Id: <{}>\n".format(messageId)) self.fd.write("Message-Id: {}\n".format(messageId))
self.fd.write("Date: {}\n".format(date)) self.fd.write("Date: {}\n".format(date))
self.fd.write("From: Nicolas Sebrecht <nicolas.s-dev@laposte.net>\n") self.fd.write("From: Nicolas Sebrecht <nicolas.s-dev@laposte.net>\n")
self.fd.write("To: {}\n".format(MAILING_LIST)) self.fd.write("To: {}\n".format(MAILING_LIST))
@ -261,8 +261,8 @@ Pip:
class Website(object): class Website(object):
def updateAPI(self): def updateAPI(self):
req = "update API of the website? (requires {}) [Y/n]".format(SPHINXBUILD) req = "update API of the website? (requires {})".format(SPHINXBUILD)
if not User.yesNo(req, defaultToYes=True): if User.yesNo(req, defaultToYes=True) is False:
return False return False
if check_call(shlex.split("{} --version".format(SPHINXBUILD))) != 0: if check_call(shlex.split("{} --version".format(SPHINXBUILD))) != 0: