Merge branch '20674-cope-with-python3-flask-update' into 'devel'
[tails.git] / bin / generate-call-for-manual-testers
blob922645b54bc7746ec8c51b0172a7f1b95a4aec59
1 #! /usr/bin/python3
3 import jinja2
4 import datetime
5 from subprocess import check_output
8 def end_date() -> str:
9     when = "tomorrow 10:00 UTC"
10     cmd = ["env", "LC_ALL=C", "TZ=UTC", "date", "-d", when, "+%A %H:%M %Z"]
11     return check_output(cmd).decode("utf8").strip()
14 def call_for_testing_contents(args) -> str:
15     jinja2_env = jinja2.Environment(  # nosec jinja2_autoescape_false
16         loader=jinja2.FileSystemLoader("config/release_management/templates"),
17         autoescape=jinja2.select_autoescape(
18             enabled_extensions=("html", "xml"),
19             default_for_string=False,
20         ),
21     )
23     return jinja2_env.get_template("call_for_manual_testers.mdwn").render(
24         dist=args.dist,
25         pad=args.pad,
26         version=args.version,
27         end=end_date(),
28     )
31 if __name__ == "__main__":
32     import argparse
34     parser = argparse.ArgumentParser()
35     parser.add_argument("--dist", required=True)
36     parser.add_argument("--version", required=True)
37     parser.add_argument("--pad", required=True)
38     args = parser.parse_args()
40     print(call_for_testing_contents(args))