Exemple #1
0
    if args.action == actions[0]:
        # "GenerateHFile"
        fw.generate_header_file(args.output)

    if args.action == actions[2]:
        # "ApplyPatches"

        # collect the rst and code files
        code_dict = {}
        rst_dict = {}

        args_dict = vars(args)
        if args_dict["basecode"] is not None:
            code_dict[0] = args_dict["basecode"]

        if args_dict["baserst"] is not None:
            rst_dict[0] = args_dict["baserst"]

        for i in xrange(16):
            code_name = "%icode" % i
            rst_name = "%irst" % i

            if args_dict[code_name] is not None:
                code_dict[i + 1] = args_dict[code_name]

            if args_dict[rst_name] is not None:
                code_dict[i + 1] = args_dict[rst_name]

        fw.apply_patches(code_dict, rst_dict)
        fw.save(args.output)
Exemple #2
0
    if args.action == actions[0]:
        # "GenerateHFile"
        fw.generate_header_file(args.output)

    if args.action == actions[2]:
        # "ApplyPatches"

        # collect the rst and code files
        code_dict = {}
        rst_dict = {}

        args_dict = vars(args)
        if args_dict["basecode"] is not None:
            code_dict[0] = args_dict["basecode"]

        if args_dict["baserst"] is not None:
            rst_dict[0] = args_dict["baserst"]

        for i in xrange(16):
            code_name = "%icode" % i
            rst_name = "%irst" % i

            if args_dict[code_name] is not None:
                code_dict[i + 1] = args_dict[code_name]

            if args_dict[rst_name] is not None:
                code_dict[i + 1] = args_dict[rst_name]

        fw.apply_patches(code_dict, rst_dict)
        fw.save(args.output)