|
|
|
@ -26,12 +26,12 @@ def restore(database,source,destination): |
|
|
|
for path,imohash,realhash in hashes: |
|
|
|
ppath = os.path.join(source,path) |
|
|
|
qpath=lookup(cur,imohash,realhash) |
|
|
|
qpath=os.path.join(temp,qpth) |
|
|
|
qpath=os.path.join(temp,qpath) |
|
|
|
parent = os.path.dirname(qpath) |
|
|
|
if not os.path.exists(parent): |
|
|
|
os.makedirs(parent) |
|
|
|
shutil.move(ppath,qpath) |
|
|
|
shutil.move(temp,dest) |
|
|
|
os.rename(temp,destination) |
|
|
|
if __name__ == "__main__": |
|
|
|
parser = argparse.ArgumentParser() |
|
|
|
parser.add_argument('database') |
|
|
|
|