示例#1
0
文件: kbpcomp.py 项目: 4lextg/kabopan
        "aplib":["APLib", lambda x:x, ""],
    },
    "JCAlg": \
    {
        "jcalg":["JCAlg", lambda x:x, ""],
    },
    "BriefLZ": \
    {
        "brieflz":["BriefLZ", lambda x:x, ""],
    },
}

algorithms = get_algorithms(families)

Help = makehelp(description, __version__, "<data_to_compress>", families)

if len(argv) == 1:
    print(Help)
    exit()

requested_algorithms, inputs = get_parameters(argv, 1, algorithms)
tab = "   "

data_to_sum = inputs[0]
if len(requested_algorithms) == 1:
    print "%s" % (algorithms[requested_algorithms[0]][0](data_to_sum))
else:
    for s in requested_algorithms:
            print "%s%s%s" % (algorithms[s][1], tab, algorithms[s][0](data_to_sum))

示例#2
0
    {
        "aplib":["APLib", lambda x:x, ""],
    },
    "JCAlg": \
    {
        "jcalg":["JCAlg", lambda x:x, ""],
    },
    "BriefLZ": \
    {
        "brieflz":["BriefLZ", lambda x:x, ""],
    },
}

algorithms = get_algorithms(families)

Help = makehelp(description, __version__, "<data_to_compress>", families)

if len(argv) == 1:
    print(Help)
    exit()

requested_algorithms, inputs = get_parameters(argv, 1, algorithms)
tab = "   "

data_to_sum = inputs[0]
if len(requested_algorithms) == 1:
    print "%s" % (algorithms[requested_algorithms[0]][0](data_to_sum))
else:
    for s in requested_algorithms:
        print "%s%s%s" % (algorithms[s][1], tab, algorithms[s][0](data_to_sum))