Don't delete old JSON files
This commit is contained in:
parent
25dc18669b
commit
341d2232d7
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user