blob: 1649899a14d0027fcbaff0db0a5d5ad99de3b1cf (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import argparse
import os
import tarfile
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('--input', nargs='*', required=True)
parser.add_argument('--output', required=True)
return parser.parse_args()
def main():
args = parse_args()
for asrc in filter(lambda x: x.endswith('.asrc') and os.path.exists(x), args.input):
with tarfile.open(asrc, 'r') as tar:
tar.extractall(path=args.output)
if __name__ == '__main__':
main()
|