Use consistent wording
[tails.git] / bin / generate-call-for-testing
blob5eacb280d807136be5ecbd4c55db9cd8e369324b
1 #! /usr/bin/python3
3 import email.utils
5 from datetime import datetime, timedelta
6 import jinja2
9 def feedback_deadline(final_date: datetime) -> datetime:
10     return final_date - timedelta(days=2)
13 def call_for_testing_contents(args) -> str:
14     jinja2_env = jinja2.Environment(  # nosec jinja2_autoescape_false
15         loader=jinja2.FileSystemLoader('config/release_management/templates'))
17     return (jinja2_env.get_template('call_for_testing.mdwn').render(
18         date=email.utils.format_datetime(datetime.fromisoformat(args.date)),
19         version=args.version,
20         tag=args.tag,
21         final_date=datetime.fromisoformat(args.final_date).strftime("%B %d"),
22         final_version=args.final_version,
23         deadline=feedback_deadline(datetime.fromisoformat(
24             args.final_date)).strftime("%B %d")))
27 if __name__ == '__main__':
28     import argparse
29     parser = argparse.ArgumentParser()
30     parser.add_argument('--version', required=True)
31     parser.add_argument('--tag', required=True)
32     parser.add_argument('--date', required=True)
33     parser.add_argument('--final-version', required=True)
34     parser.add_argument('--final-date', required=True)
35     args = parser.parse_args()
37     print(call_for_testing_contents(args))