Skip to content

Commit 2650138

Browse files
committed
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
1 parent 1ef00d4 commit 2650138

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

ietf/bin/generate-draft-aliases

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ DRAFT_EMAIL_SUFFIX='@tools.ietf.org'
2929

3030
# boilerplate (from various other ietf/bin scripts)
3131
import os, sys
32+
filename = os.path.abspath(__file__)
3233
basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
3334
sys.path = [ basedir ] + sys.path
3435
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ietf.settings")
@@ -51,6 +52,9 @@ def get_draft_ad_emails(draft):
5152
#return [ad and ad.user and ad.user.email]
5253
return [ad and ad.email_address()]
5354

55+
def get_draft_shepherd_email(draft):
56+
return [ draft.shepherd.email_address() ] if draft.shepherd else []
57+
5458
def get_draft_authors_emails(draft):
5559
" Get list of authors for the given draft."
5660

@@ -91,9 +95,8 @@ if __name__ == '__main__':
9195
# 10 years ago?
9296
#show_since = datetime.datetime.now() - datetime.timedelta(10 * 365)
9397

94-
modname = 'ietf.generate_draft_aliases'
9598
date = time.strftime("%Y-%m-%d_%H:%M:%S")
96-
signature = '# Generated by python -m %s at %s\n' % (modname, date)
99+
signature = '# Generated by %s at %s\n' % (filename, date)
97100

98101
afile = open(settings.DRAFT_ALIASES_PATH, "w")
99102
vfile = open(settings.DRAFT_VIRTUAL_PATH, "w")
@@ -135,6 +138,9 @@ if __name__ == '__main__':
135138
# .notify = notify email list from the Document
136139
handle_sublist(afile, vfile, alias+'.notify', get_draft_notify_emails(draft))
137140

141+
# .shepherd = shepherd email from the Document
142+
handle_sublist(afile, vfile, alias+'.shepherd', get_draft_shepherd_email(draft))
143+
138144
# .all = everything on 'all' (expanded aliases)
139145
handle_sublist(afile, vfile, alias+'.all', all)
140146

0 commit comments

Comments
 (0)