Clean up the code.

This commit is contained in:
Cristiano Ferreira
2024-04-10 22:21:30 +01:00
parent f1d2ec3bf8
commit 6e2355ee4c
24 changed files with 36 additions and 6397 deletions

View File

@@ -1,5 +1,5 @@
import os
import datetime
import os
from pathlib import Path
@@ -12,6 +12,6 @@ def delete_files_older_than_one_day(directory):
file_name = file_path.name
file_modified_time = datetime.datetime.fromtimestamp(file_path.stat().st_mtime)
time_difference = current_time - file_modified_time
if time_difference.days > 1 and "placeholder" not in file_name:
if time_difference.days > 1 and "placeholder" not in file_name:
file_path.unlink()
print(f"Deleted file: {file_path}")
print(f"Deleted file: {file_path}")