aboutsummaryrefslogtreecommitdiffstats
path: root/examples/csv/csv.py
blob: bb27522609e24c2f72e3a7ffe90054e3c9d9a8c4 (plain)
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
#!/usr/bin/env python3
# Copyright (c) Pelagicore AB 2016

import click
from qface.generator import FileSystem, Generator


def run(src, dst):
    system = FileSystem.parse(src)
    generator = Generator(search_path='templates')
    ctx = {'dst': dst, 'system': system}
    generator.write('{{dst}}/modules.csv', 'modules.csv', ctx)


@click.command()
@click.argument('src', nargs=-1, type=click.Path(exists=True))
@click.argument('dst', nargs=1, type=click.Path(exists=True))
def app(src, dst):
    """Generates a modules,csv file with statistics about all
    interfaces, structs and enums from the given interface
    sources"""
    run(src, dst)


if __name__ == '__main__':
    app()