File: generate_file.py

package info (click to toggle)
python-asdf 2.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 3,248 kB
  • sloc: python: 13,104; makefile: 125
file content (26 lines) | stat: -rw-r--r-- 609 bytes parent folder | download
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
import argparse
from pathlib import Path

from asdf.versioning import AsdfVersion

from common import generate_file


def parse_args():
    parser = argparse.ArgumentParser(description="Generate an ASDF file for library version compatibility testing")
    parser.add_argument("filename", help="the output filename")
    parser.add_argument("version", help="the ASDF Standard version to write")
    return parser.parse_args()


def main():
    args = parse_args()

    path = Path(args.filename)
    version = AsdfVersion(args.version)

    generate_file(path, version)


if __name__ == "__main__":
    main()