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
This commit is contained in:
Henrik Levkowetz 2014-10-30 15:35:54 +00:00
parent 1ef00d44b2
commit 26501383e0

View file

@ -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)