From 26501383e0f91bc72b3bdab1f90423250b14440e Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Thu, 30 Oct 2014 15:35:54 +0000 Subject: [PATCH] Added generation of {draftname}.shepherd aliases for drafts when generating draft email aliases, and also added the shepherd's email address to the {draftname}.all alias. Changed the signature line of the script to give the script path instead of a manually maintained string (which had become outdated). - Legacy-Id: 8522 --- ietf/bin/generate-draft-aliases | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ietf/bin/generate-draft-aliases b/ietf/bin/generate-draft-aliases index 6cab455cf..997d6ff83 100755 --- a/ietf/bin/generate-draft-aliases +++ b/ietf/bin/generate-draft-aliases @@ -29,6 +29,7 @@ DRAFT_EMAIL_SUFFIX='@tools.ietf.org' # boilerplate (from various other ietf/bin scripts) import os, sys +filename = os.path.abspath(__file__) basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")) sys.path = [ basedir ] + sys.path os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ietf.settings") @@ -51,6 +52,9 @@ def get_draft_ad_emails(draft): #return [ad and ad.user and ad.user.email] return [ad and ad.email_address()] +def get_draft_shepherd_email(draft): + return [ draft.shepherd.email_address() ] if draft.shepherd else [] + def get_draft_authors_emails(draft): " Get list of authors for the given draft." @@ -91,9 +95,8 @@ if __name__ == '__main__': # 10 years ago? #show_since = datetime.datetime.now() - datetime.timedelta(10 * 365) - modname = 'ietf.generate_draft_aliases' date = time.strftime("%Y-%m-%d_%H:%M:%S") - signature = '# Generated by python -m %s at %s\n' % (modname, date) + signature = '# Generated by %s at %s\n' % (filename, date) afile = open(settings.DRAFT_ALIASES_PATH, "w") vfile = open(settings.DRAFT_VIRTUAL_PATH, "w") @@ -135,6 +138,9 @@ if __name__ == '__main__': # .notify = notify email list from the Document handle_sublist(afile, vfile, alias+'.notify', get_draft_notify_emails(draft)) + # .shepherd = shepherd email from the Document + handle_sublist(afile, vfile, alias+'.shepherd', get_draft_shepherd_email(draft)) + # .all = everything on 'all' (expanded aliases) handle_sublist(afile, vfile, alias+'.all', all)