Ejemplo n.º 1
0
def pack(srcfolder, outfile=None):
    olddir = os.getcwd()
    os.chdir(os.path.dirname(srcfolder))
    if outfile is None:
        outfile = os.path.normpath(srcfolder) + '.wad'
    elif not outfile.lower().endswith('.wad'):
        outfile += '.wad'
    print "Reading directory %s" % (srcfolder)
    try:
        wadfile = wad.fromdirectory(srcfolder)
    except IOError, err:
        print err
        exit()
Ejemplo n.º 2
0
        print "Reading wad file %s" % (sys.argv[2])
        try:
            wadfile = wad.load(sys.argv[2])
        except IOError, err:
            print err
            exit()
        print "Extracting into %s" % (sys.argv[3])
        try:
            wadfile.extract(sys.argv[3])
        except IOError, err:
            print err

    if sys.argv[1] == 'p':
        print "Reading directory %s" % (sys.argv[3])
        try:
            wadfile = wad.fromdirectory(sys.argv[3])
        except IOError, err:
            print err
            exit()
        print "Saving WAD file %s" % (sys.argv[2])
        try:
            wadfile.save(sys.argv[2])
        except IOError, err:
            print err

if __name__ == "__main__":
    main()

# End ogun code ################################################################

def extract(wadfile, outfolder=None):