Files
galaxy/scripts/slideshow/build_slideshow.py
T
Nicola Soranzo 9d74bba7fb Drop support for retired Python 3.5
Upgrade syntax using `pyupgrade --py36-plus` .

Manually drop several `six` imports.

Also:
- Remove broken pr_cache in scripts/bootstrap_history.py
- Fix broken prefix removal in lib/galaxy/tool_util/deps/mulled/mulled_build.py
2020-10-07 11:52:13 +01:00

29 lines
644 B
Python

import os
import string
import sys
SCRIPTS_DIRECTORY = os.path.dirname(__file__)
TEMPLATE_PATH = os.path.join(SCRIPTS_DIRECTORY, "slideshow_template.html")
TEMPLATE = string.Template(open(TEMPLATE_PATH).read())
def main(argv=None):
if argv is None:
argv = sys.argv
title = argv[1]
markdown_source = argv[2]
output = os.path.splitext(markdown_source)[0] + '.html'
with open(markdown_source) as s:
content = s.read()
html = TEMPLATE.safe_substitute(**{
'title': title,
'content': content,
})
print(html)
open(output, "w").write(html)
if __name__ == "__main__":
main()