Exemple #1
0
    p.add_argument('--no-vt',
                   action='store_true',
                   help='Do not use VT100 escape codes')
    p.add_argument('--no-log',
                   action='store_true',
                   help='Do not print logs and time measurements')

    asm = Assembler()

    args = p.parse_args()
    if args.no_vt:
        asm.preventVT100()
    if args.no_log:
        asm.preventLogging()
    if args.info is not None:
        asm.printInfo(args.info if args.info != '' else None)
        exit()
    if args.script is None:
        print(
            "You are supposed to pass a path to the script file as the first positional argument."
        )
        exit()

    with open(args.script, 'r') as script_file:
        script = [line.strip('\n') for line in script_file.readlines()]
    try:
        flow = asm.assembleFromText(lines=script,
                                    num_proc=args.num_processes,
                                    debug=args.debug)
    except muException as e:
        e.die()