|
@@ -9,9 +9,14 @@ import datetime
|
|
|
# директория файла
|
|
|
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
|
+# кого проверяем
|
|
|
+who = "Савкин"
|
|
|
+
|
|
|
print()
|
|
|
files_paths = []
|
|
|
exec_files_paths = [] # уже проверенные
|
|
|
+remove_files_paths = [] # файлы на удаление
|
|
|
+
|
|
|
dirs = os.listdir(BASE_DIR)
|
|
|
for dir in dirs:
|
|
|
dir_path = os.path.join(BASE_DIR, dir)
|
|
@@ -25,7 +30,7 @@ for dir in dirs:
|
|
|
files_paths.append(file_path)
|
|
|
|
|
|
now = datetime.datetime.now().strftime('%d-%m-%Y %H:%M')
|
|
|
-out_str = f"Время проверки: {now} \n"
|
|
|
+out_str = f"Проверка: {who}, время проверки: {now} \n"
|
|
|
print(out_str)
|
|
|
|
|
|
|
|
@@ -68,7 +73,10 @@ for file_1 in tqdm(files_paths):
|
|
|
early_file = small_filename_1
|
|
|
later_file = small_filename_2
|
|
|
out_str += f"{later_file} позже {early_file}\n"
|
|
|
- out_str += f"ratio = {ratio}\n"
|
|
|
+ out_str += f"ratio = {ratio}, удален\n"
|
|
|
+
|
|
|
+ remove_files_paths.append(os.path.join(BASE_DIR, later_file))
|
|
|
+
|
|
|
|
|
|
exec_files_paths.append(f"{small_filename_1}|{small_filename_2}")
|
|
|
|
|
@@ -85,6 +93,10 @@ with open(log_path, "w", encoding="utf-8") as f_log:
|
|
|
f_log.write(prev_str)
|
|
|
f_log.close()
|
|
|
|
|
|
+# удаление файлов
|
|
|
+for remove_path in remove_files_paths:
|
|
|
+ os.remove(remove_path)
|
|
|
+
|
|
|
|
|
|
print("success")
|
|
|
|