| 15 | |
| 16 | |
| 17 | def main(): |
| 18 | |
| 19 | #argparse |
| 20 | parser = argparse.ArgumentParser(description='Uncompress dataset') |
| 21 | parser.add_argument('--dataset_zipped_path', required=True, help='Path to the difflocks folder containing all zip files') |
| 22 | parser.add_argument('--out_path', required=True, type=str, help='Where to output the difflocks dataset') |
| 23 | args = parser.parse_args() |
| 24 | |
| 25 | |
| 26 | in_path=args.dataset_zipped_path |
| 27 | onlyfiles = [f for f in listdir(in_path) if isfile(join(in_path, f))] |
| 28 | for file_name in onlyfiles: |
| 29 | filepath=os.path.join(in_path,file_name) |
| 30 | cmd=["7zz","x", "-y", filepath, "-o"+args.out_path] |
| 31 | # print("cmd",cmd) |
| 32 | subprocess.run(cmd, capture_output=False) |
| 33 | print("filename", file_name) |
| 34 | |
| 35 | |
| 36 | if __name__ == '__main__': |