Esempio n. 1
0
def test_argv():
    from shlex import split as strtoargs

    argtitles = (
        "input filename",
        "output filename",
        "tile sheet",
        "X offset",
        "Y offset",
        "palette",
        "print palette",
        "write CHR with color set",
        "show picture",
        "remap CHR",
    )
    for line in testpatterns:
        print(line)
        args = strtoargs(line)
        try:
            row = parse_argv(args)
        except SystemExit:
            print("Would exit")
        except Exception as e:
            print(e)
        else:
            print("\n".join("  %s: %s" % (a, repr(b)) for (a, b) in zip(argtitles, row)))
Esempio n. 2
0
def test_argv():
    from shlex import split as strtoargs
    argtitles = ("input filename", "output filename", "tile sheet", "X offset",
                 "Y offset", "palette", "print palette",
                 "write CHR with color set", "show picture", "remap CHR")
    for line in testpatterns:
        print(line)
        args = strtoargs(line)
        try:
            row = parse_argv(args)
        except SystemExit:
            print("Would exit")
        except Exception as e:
            print(e)
        else:
            print("\n".join("  %s: %s" % (a, repr(b))
                            for (a, b) in zip(argtitles, row)))