File: generate.py

package info (click to toggle)
xtensor 0.25.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,476 kB
  • sloc: cpp: 65,302; makefile: 202; python: 171; javascript: 8
file content (16 lines) | stat: -rw-r--r-- 384 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python3

import glob

fs = glob.glob("xio_expected_results/*.txt")

include_file = "#include <string>\n\n"

for f in fs:
    with open(f) as ff:
        ctn = ff.read()
        n = f.split("/")[1]
        include_file += "static std::string {} = R\"xio({})xio\";\n\n\n".format(n[:-4], ctn)

with open("xio_expected_results.hpp", "w+") as fo:
    fo.write(include_file)