Exemplo n.º 1
0
    parser.add_argument(
        'header',
        help='Header file to modify',
        type=Path,
    )

    parser.add_argument(
        '--gl-header',
        '-H',
        help='Header to look up functions in; may be specified multiple times',
        type=Path,
        dest='gl_headers',
        action='append',
    )

    parser.add_argument(
        '--function',
        '-f',
        help=
        'Include this function even if a direct call was not found in the source files; may be specified multiple times',
        action='append',
        dest='functions',
    )

    write_header(parser.parse_args(args[1:]))


if __name__ == '__main__':
    run_main(main)
Exemplo n.º 2
0
from concurrent.futures import (
    ThreadPoolExecutor,
)

from pathlib import Path

import os
import sys
import subprocess


def main(args):
    import argparse
    parser = argparse.ArgumentParser(description='Perform all automated routine maintenance tasks.', prog=args[0])
    add_common_args(parser)
    pargs = parser.parse_args(args[1:])

    scripts = pargs.rootdir / 'scripts' / 'upkeep'

    tasks = (
        'fixup-source-files',
        'update-glsl-sources',
    )

    with ThreadPoolExecutor() as ex:
        tuple(ex.map(lambda task: subprocess.check_call([scripts / f'{task}.py'] + args[1:]), tasks))


if __name__ == '__main__':
    run_main(main)