Ensure --dry-run flag is honored
This commit is contained in:
parent
9f269b1aa6
commit
e514129d06
1 changed files with 10 additions and 8 deletions
|
@ -26,16 +26,17 @@ for path in args.path:
|
|||
try:
|
||||
outlook = parser.parse(fh.read())
|
||||
|
||||
db.add(outlook)
|
||||
if not args.dry_run:
|
||||
db.add(outlook)
|
||||
|
||||
for probability in outlook.probabilities:
|
||||
probability.outlook_id = outlook.id
|
||||
db.add(probability)
|
||||
for probability in outlook.probabilities:
|
||||
probability.outlook_id = outlook.id
|
||||
db.add(probability)
|
||||
|
||||
for category in outlook.categories:
|
||||
category.outlook_id = outlook.id
|
||||
for category in outlook.categories:
|
||||
category.outlook_id = outlook.id
|
||||
|
||||
db.add(category)
|
||||
db.add(category)
|
||||
|
||||
if args.verbose:
|
||||
print(f"Ingested {path}")
|
||||
|
@ -46,4 +47,5 @@ for path in args.path:
|
|||
else:
|
||||
raise
|
||||
|
||||
db.commit()
|
||||
if not args.dry_run:
|
||||
db.commit()
|
||||
|
|
Loading…
Add table
Reference in a new issue