Skip to content

Commit

Permalink
Clean up data directory from previous runs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daryl Wilding-McBride committed Oct 1, 2018
1 parent 9460ca0 commit aac32d5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions process-instrument-db.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import sys
import json
import glob
import shutil

def run_process(process):
print("Executing: {}".format(process))
Expand Down Expand Up @@ -204,9 +205,10 @@ def chunks(l, n):
if (args.final_operation is None):
args.final_operation = steps[-1]

# make sure the processing directories exist
if not os.path.exists(args.data_directory):
os.makedirs(args.data_directory)
# clean up the data directory from any previous runs
if os.path.exists(args.data_directory):
shutil.rmtree(args.data_directory)
os.makedirs(args.data_directory)

converted_database_name = "{}/{}.sqlite".format(args.data_directory, args.database_base_name)
frame_database_root = "{}/{}-frames".format(args.data_directory, args.database_base_name) # used to split the data into frame-based sections
Expand Down

0 comments on commit aac32d5

Please sign in to comment.