Warning, /epic/bin/make_images is written in an unsupported language. File is not indexed.
0001 #!/usr/bin/env python3
0002
0003 from jinja2 import Environment, FileSystemLoader, select_autoescape
0004 env = Environment(
0005 loader=FileSystemLoader('reports/templates'),
0006 #loader=PackageLoader('reports', 'templates'),
0007 autoescape=select_autoescape(['html', 'xml'])
0008 )
0009
0010 import os
0011 import glob
0012
0013 if "CI_PROJECT_ID" in os.environ:
0014 CI_PROJECT_ID = str(os.environ["CI_PROJECT_ID"])
0015 else:
0016 CI_PROJECT_ID = "473"
0017
0018 base_url = f"https://eicweb.phy.anl.gov/api/v4/projects/{CI_PROJECT_ID}/jobs/artifacts/main/raw"
0019
0020 #images = ["images/view2a.png","images/view2b.png", "images/view1.png"]
0021 images = glob.glob("images/*.png")
0022
0023 template = env.get_template('detector_views.md')
0024 print(template.render(base_url=base_url, images=images))