forked from seL4/sel4-tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.py
More file actions
executable file
·35 lines (30 loc) · 944 Bytes
/
Copy pathtemplate.py
File metadata and controls
executable file
·35 lines (30 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python
#
# Copyright 2018, Data61
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
# ABN 41 687 119 230.
#
# This software may be distributed and modified according to the terms of
# the BSD 2-Clause license. Note that NO WARRANTY is provided.
# See "LICENSE_BSD2.txt" for details.
#
# @TAG(DATA61_BSD)
#
import jinja2
import argparse
import sys
import sh
def main():
parser = argparse.ArgumentParser(description='Tutorial script template parser. Template is read from '
'stdin and outout is placed in stdout')
parser.add_argument('-s','--solution', action='store_true', default=False)
args = parser.parse_args()
input = sys.stdin.read()
template = jinja2.Template(input,
block_start_string='/*-',
block_end_string='-*/'
)
sys.stdout.write(template.render(solution=args.solution))
return 0
if __name__ == '__main__':
sys.exit(main())