From eed0ffa2fcd4f3169f5689c635891efd6bde0899 Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Wed, 11 Oct 2023 15:56:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=9D=90=E6=A0=87=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=89=8D=E5=85=88=E8=BF=9B=E8=A1=8C=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E5=92=8C=E4=BA=91=E7=AB=AF=E6=96=87=E4=BB=B6=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E6=AF=94=E8=BE=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/downxmps.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/downxmps.py b/tools/downxmps.py index ef4c256..d213680 100644 --- a/tools/downxmps.py +++ b/tools/downxmps.py @@ -35,6 +35,7 @@ def down_xmps_from_oss(psid,pid = ""): #在有pid 的情况下判断是否要从云端下载影棚坐标文件 if pid != "": if local_and_remote_file_time(psid,pid) == "local_file_best_new": + print("本地的文件最新,不需要下载云端影棚坐标文件") return else: if not need_down(): return @@ -81,12 +82,14 @@ def local_and_remote_file_time(psid,pid): if os.path.exists(localfile): remotefile_last_modified = os.path.getmtime(remotefile) localfile_last_modified = os.path.getmtime(localfile) - if remotefile_last_modified <= localfile_last_modified: + print(f'本地文件的时间{localfile_last_modified}, 远程文件的时间{remotefile_last_modified}') + #比较两个文件的时间 + if float(remotefile_last_modified) < float(localfile_last_modified): print(f'本地{localfile}文件已是最新,') return "local_file_best_new" else: - print(f'本地{remotefile}文件最新') + print(f'远程{remotefile}文件最新') return "remote_file_best_new" print(f'本地{localfile}文件不存在') return "local_file_not_exist" @@ -114,7 +117,7 @@ if __name__ == '__main__': # 根据坐标文件时间戳判断是否需要更新 if local_and_remote_file_time(psid,pid) == "local_file_best_new": - print(f'本地文件已是最新, 不需要更新') + print(f'本地文件已是最新, 不需要下载云端影棚坐标文件') continue # remotefile = os.path.join(xmps_mesh_path, '11_1.xmp') # localfile = os.path.join(ImagesGeometry, '11_1.xmp')