from pathlib import Path
import argparse,shutil,sqlite3
p=Path('/tmp/lead-32693-r2/capture-1/project')
a=argparse.ArgumentParser();a.add_argument('action',choices=['A','B','insert401','move','restore','repair-corrupt']);args=a.parse_args()
if args.action in ['A','B']:shutil.copyfile(f'/tmp/lead-32693-r2/capture-1/report-{args.action}.docx',p/'report.docx')
elif args.action=='insert401':
 c=sqlite3.connect(p/'records.sqlite');c.execute("INSERT INTO records (id,label,notes,extra) VALUES (401,'Synthetic added row','Committed edit for evidence','Row 401')");c.commit();c.close()
elif args.action=='move':shutil.move(p/'report.docx','/tmp/lead-32693-r2/capture-1/report-moved.docx')
elif args.action=='restore':shutil.copyfile('/tmp/lead-32693-r2/capture-1/report-A.docx',p/'report.docx')
elif args.action=='repair-corrupt':shutil.copyfile('/tmp/lead-32693-r2/capture-1/report-A.docx',p/'corrupt.docx')
