From 341d2232d72051782399fcbead6075b8e0e887c9 Mon Sep 17 00:00:00 2001 From: Cole Deck Date: Fri, 10 May 2024 12:51:45 -0500 Subject: [PATCH] Don't delete old JSON files --- get_specs.py | 1 + read_datasheet.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/get_specs.py b/get_specs.py index ab93b8e..a36a044 100755 --- a/get_specs.py +++ b/get_specs.py @@ -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 diff --git a/read_datasheet.py b/read_datasheet.py index 57b1f12..cd4c631 100755 --- a/read_datasheet.py +++ b/read_datasheet.py @@ -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)