From 9304aab940c1324b3376f3c70a5f24163dde0155 Mon Sep 17 00:00:00 2001 From: lededev Date: Mon, 27 Sep 2021 03:56:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=96=E5=B1=82=E4=B9=9F=E8=B0=83=E7=94=A8mo?= =?UTF-8?q?veFailedFolder()=E5=87=BD=E6=95=B0=E6=9D=A5=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AV_Data_Capture.py | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/AV_Data_Capture.py b/AV_Data_Capture.py index c19cab1..64420b3 100755 --- a/AV_Data_Capture.py +++ b/AV_Data_Capture.py @@ -13,7 +13,7 @@ import time from pathlib import Path from ADC_function import file_modification_days, get_html, is_link from number_parser import get_number -from core import core_main +from core import core_main, moveFailedFolder def check_update(local_version): @@ -242,21 +242,10 @@ def create_data_and_move(file_path: str, c: config.Config, debug): print(f"[-] [{file_path}] ERROR:") print('[-]', err) - # 3.7.2 New: Move or not move to failed folder. - if c.failed_move() == False: - if c.soft_link(): - print("[-]Link {} to failed folder".format(file_path)) - os.symlink(file_path, os.path.join(conf.failed_folder(), file_name)) - elif c.failed_move() == True: - if c.soft_link(): - print("[-]Link {} to failed folder".format(file_path)) - os.symlink(file_path, os.path.join(conf.failed_folder(), file_name)) - else: - try: - print("[-]Move [{}] to failed folder".format(file_path)) - shutil.move(file_path, os.path.join(conf.failed_folder(), file_name)) - except Exception as err: - print('[!]', err) + try: + moveFailedFolder(file_path, conf) + except Exception as err: + print('[!]', err) def create_data_and_move_with_custom_number(file_path: str, c: config.Config, custom_number):