根据xmps修改时间确定是否需要更新,未改完
This commit is contained in:
1 parent
16e0afc0fe
commit
b662fda437
1 file changed
+16
-4
+16
-4
@@ -65,17 +65,29 @@ if __name__ == '__main__':
|
|||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
for pid in pids.split(','):
|
for pid in pids.split(','):
|
||||||
input_path = os.path.join('d:\\', pid)
|
input_path = os.path.join(config.workdir, pid)
|
||||||
ImagesGeometry = os.path.join(input_path, "photo1")
|
ImagesGeometry = os.path.join(input_path, "photo1")
|
||||||
ImagesTexture = os.path.join(input_path, "photo2")
|
ImagesTexture = os.path.join(input_path, "photo2")
|
||||||
|
|
||||||
psid = libs.getPSid(pid)
|
psid = libs.getPSid(pid)
|
||||||
config_path = f'D:\\apps\\config\\'
|
config_path = os.path.join(config.sharedir, 'libs')
|
||||||
xmps_mesh_path = config_path + f'xmps\\{psid}\\mesh\\'
|
xmps_mesh_path = os.path.join(config_path, 'xmps', psid, 'mesh')
|
||||||
xmps_texture_path = config_path + f'xmps\\{psid}\\texture\\'
|
xmps_texture_path = os.path.join(config_path, 'xmps', psid, 'texture')
|
||||||
|
|
||||||
down_xmps_from_oss(psid)
|
down_xmps_from_oss(psid)
|
||||||
|
|
||||||
|
# 根据坐标文件时间戳判断是否需要更新
|
||||||
|
remotefile = os.path.join(xmps_mesh_path, '11_1.xmp')
|
||||||
|
localfile = os.path.join(ImagesGeometry, '11_1.xmp')
|
||||||
|
print(f'remotefile: {remotefile}, localfile: {localfile}')
|
||||||
|
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}文件已是最新, 不需要更新')
|
||||||
|
continue
|
||||||
|
|
||||||
|
print(f'正在更新{pid}号影棚坐标文件')
|
||||||
os.system('xcopy /y /q ' + xmps_mesh_path + '*.* ' + ImagesGeometry)
|
os.system('xcopy /y /q ' + xmps_mesh_path + '*.* ' + ImagesGeometry)
|
||||||
os.system('xcopy /y /q ' + xmps_texture_path + '*.* ' + ImagesTexture)
|
os.system('xcopy /y /q ' + xmps_texture_path + '*.* ' + ImagesTexture)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user