From 288acfb264c7ad1d1ffd3fe1d96b4071ae65b836 Mon Sep 17 00:00:00 2001 From: lededev Date: Sat, 9 Oct 2021 05:28:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E9=80=A0=E6=88=90bug?= =?UTF-8?q?=EF=BC=8C=E4=BD=86=E8=BF=98=E6=98=AF=E6=94=B9=E4=B8=80=E4=B8=8B?= =?UTF-8?q?=E5=A5=BD=E4=B8=80=E4=BA=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AV_Data_Capture.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AV_Data_Capture.py b/AV_Data_Capture.py index 4411538..5def067 100755 --- a/AV_Data_Capture.py +++ b/AV_Data_Capture.py @@ -177,12 +177,12 @@ def close_logfile(logdir: str): # rm -rf $LOGDIR """ # 第一步,合并到月 + today = datetime.today() for i in range(1): # 利用1次循环的break跳到第二步,避免大块if缩进或者使用goto语法 txts = [f for f in log_dir.glob(r'*.txt') if re.match(r'avdc_\d{8}T\d{6}', f.stem, re.A)] if not txts or not len(txts): break txts.sort() - today = datetime.today() tmstr_3_month_ago = (today.replace(day=1) - timedelta(days=3*30)).strftime("%Y%m32T") deadline_month = f'avdc_{tmstr_3_month_ago}' month_merge = [f for f in txts if f.stem < deadline_month]