-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunKeyCIAWrapper.py
More file actions
39 lines (28 loc) · 917 Bytes
/
FunKeyCIAWrapper.py
File metadata and controls
39 lines (28 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import os
import csv
import sys
import shutil
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-titles', action='store', dest='title_list')
arguments = parser.parse_args()
BASEDIR = os.getcwd()
print ("Testing for target folder...")
if (not(os.path.isdir(BASEDIR + "/CIAs"))):
os.makedirs(BASEDIR + "/CIAs")
print ("Creating directory "'CIAs'"")
else:
print ("Directory already exists")
print ("Processing "'input.csv'"...")
f = open(arguments.title_list)
csv_f = csv.reader(f)
for row in csv_f:
print ("Building CIA for " + row[2])
os.system("python FunKeyCIA.py -title " + row[0] + " -key " + row[1])
print(BASEDIR + "/cia/" + row[0] + "/" + row[0] + ".cia", BASEDIR + "/CIAs/" + row[2] + ".cia")
shutil.rmtree(BASEDIR + "/cia/" + row[0])
shutil.rmtree(BASEDIR + "/raw/" + row[0])
print ("")
print ("Processing complete!")
raw_input("Press ENTER to exit...")
os.exit(0)