Don't delete old JSON files

This commit is contained in:
Cole Deck 2024-05-10 12:51:45 -05:00
parent 25dc18669b
commit 341d2232d7
2 changed files with 5 additions and 4 deletions

View File

@ -315,6 +315,7 @@ def get_multi(partnums, delay, dir, webport, cache=True, bar=None):
bartext = "Downloading files for part " + partnum
os.makedirs(output_dir, exist_ok=True)
with open(output_dir + "/search-result.json", 'w') as json_file:
fprint("Saving search result of " + partnum)
json.dump(search_result, json_file)
# bar.text = bartext

View File

@ -399,10 +399,10 @@ def parse(filename, output_dir, partnum, dstype, weburl, extra):
#print(output_table)
#run_cmd("rm \"" + output_dir + "\"/*.json") # not reliable!
pattern = os.path.join(output_dir, '*.json')
json_files = glob.glob(pattern)
for file_path in json_files:
os.remove(file_path)
# pattern = os.path.join(output_dir, '*.json')
# json_files = glob.glob(pattern)
# for file_path in json_files:
# os.remove(file_path)
#print(f"Deleted {file_path}")
with open(output_dir + "/search.json", 'w') as json_file:
json.dump(output_table["searchspecs"], json_file)