Compare commits
1 Commits
155b5c25d1
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 708a65031a |
@@ -133,3 +133,43 @@ The `format_file_size` function was also removed since it's no longer needed. Th
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
_**User**_
|
||||||
|
|
||||||
|
though now I think of it, add a user prompt to delete all detected problem files./
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
_**Agent (model default, mode Agent)**_
|
||||||
|
|
||||||
|
|
||||||
|
Adding a user prompt to delete all detected problem files. Reviewing the current file structure:
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<tool-use data-tool-type="read" data-tool-name="read_file_v2">
|
||||||
|
<details><summary>Tool use: **read_file_v2** • Read file: R:\Videos\mux\check_files.py</summary>
|
||||||
|
|
||||||
|
</details>
|
||||||
|
</tool-use>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
Adding a user prompt to delete all detected problem files after the summary:
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<tool-use data-tool-type="write" data-tool-name="edit_file_v2">
|
||||||
|
|
||||||
|
<details><summary>Tool use: **edit_file_v2** • Edit file: R:\Videos\mux\check_files.py</summary>
|
||||||
|
|
||||||
|
Status: **loading**
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
</tool-use>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -264,6 +264,38 @@ def main():
|
|||||||
for file, issue in issues_found:
|
for file, issue in issues_found:
|
||||||
print(f"\n{file}:")
|
print(f"\n{file}:")
|
||||||
print(f"{Colors.RED} {issue}{Colors.ENDC}")
|
print(f"{Colors.RED} {issue}{Colors.ENDC}")
|
||||||
|
|
||||||
|
# Prompt to delete problem files
|
||||||
|
print(f"\n{Colors.YELLOW}Files with issues detected.{Colors.ENDC}")
|
||||||
|
response = input("Delete all problematic output files? (yes/no): ").strip().lower()
|
||||||
|
|
||||||
|
if response in ['yes', 'y']:
|
||||||
|
deleted_count = 0
|
||||||
|
failed_count = 0
|
||||||
|
|
||||||
|
for file, issue in issues_found:
|
||||||
|
# Skip "Missing from output" - nothing to delete
|
||||||
|
if issue == "Missing from output":
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Delete output file for all other issues
|
||||||
|
output_path = os.path.join(output_dir, file)
|
||||||
|
if os.path.exists(output_path):
|
||||||
|
try:
|
||||||
|
os.remove(output_path)
|
||||||
|
deleted_count += 1
|
||||||
|
logging.info(f"Deleted problematic output file: {output_path} (Issue: {issue})")
|
||||||
|
print(f"{Colors.GREEN}Deleted: {file}{Colors.ENDC}")
|
||||||
|
except Exception as e:
|
||||||
|
failed_count += 1
|
||||||
|
logging.error(f"Failed to delete {output_path}: {str(e)}")
|
||||||
|
print(f"{Colors.RED}Failed to delete {file}: {str(e)}{Colors.ENDC}")
|
||||||
|
|
||||||
|
print(f"\n{Colors.GREEN}Deleted {deleted_count} file(s){Colors.ENDC}")
|
||||||
|
if failed_count > 0:
|
||||||
|
print(f"{Colors.RED}Failed to delete {failed_count} file(s){Colors.ENDC}")
|
||||||
|
else:
|
||||||
|
print("Deletion cancelled.")
|
||||||
else:
|
else:
|
||||||
print(f"{Colors.GREEN}No issues found in any files!{Colors.ENDC}")
|
print(f"{Colors.GREEN}No issues found in any files!{Colors.ENDC}")
|
||||||
print("\nIssue counts:")
|
print("\nIssue counts:")
|
||||||
|
|||||||
Reference in New Issue
Block a user