Delete generate_list.py
Browse files- generate_list.py +0 -29
generate_list.py
DELETED
|
@@ -1,29 +0,0 @@
|
|
| 1 |
-
import os
|
| 2 |
-
import json
|
| 3 |
-
|
| 4 |
-
DATA_DIR = "data"
|
| 5 |
-
OUTPUT_FILE = "filelist.json"
|
| 6 |
-
|
| 7 |
-
def generate_file_list():
|
| 8 |
-
"""
|
| 9 |
-
Scans the data directory for .html files and saves the list to a JSON file.
|
| 10 |
-
"""
|
| 11 |
-
if not os.path.exists(DATA_DIR):
|
| 12 |
-
print(f"Error: The '{DATA_DIR}' directory was not found.")
|
| 13 |
-
return
|
| 14 |
-
|
| 15 |
-
try:
|
| 16 |
-
# List all files in the data directory that end with .html
|
| 17 |
-
filenames = [f for f in os.listdir(DATA_DIR) if f.endswith(".html")]
|
| 18 |
-
|
| 19 |
-
# Write the list of filenames to the output file
|
| 20 |
-
with open(OUTPUT_FILE, 'w') as f:
|
| 21 |
-
json.dump(filenames, f)
|
| 22 |
-
|
| 23 |
-
print(f"Successfully created '{OUTPUT_FILE}' with {len(filenames)} files.")
|
| 24 |
-
|
| 25 |
-
except Exception as e:
|
| 26 |
-
print(f"An error occurred: {e}")
|
| 27 |
-
|
| 28 |
-
if __name__ == "__main__":
|
| 29 |
-
generate_file_list()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|