|
@@ -75,7 +75,7 @@ def upload_simulation(parse_prefix, mp41):
|
|
logging.info('上传仿真视频到 %s' % parse_prefix + 'scenario_orig.mp4')
|
|
logging.info('上传仿真视频到 %s' % parse_prefix + 'scenario_orig.mp4')
|
|
# bucket.put_object_from_file(parse_prefix + 'scenario_hmi.mp4', mp42)
|
|
# bucket.put_object_from_file(parse_prefix + 'scenario_hmi.mp4', mp42)
|
|
# logging.info('上传仿真视频到 %s' % parse_prefix + 'scenario_hmi.mp4')
|
|
# logging.info('上传仿真视频到 %s' % parse_prefix + 'scenario_hmi.mp4')
|
|
- shutil.rmtree(path1) # 仿真完就删除
|
|
|
|
|
|
+ shutil.rmtree(path1) # todo 仿真完就删除了,所以不需要 local_delete_list
|
|
except Exception as e:
|
|
except Exception as e:
|
|
logging.exception("上传视频报错 %s" % str(e))
|
|
logging.exception("上传视频报错 %s" % str(e))
|
|
|
|
|
|
@@ -120,7 +120,6 @@ if __name__ == '__main__':
|
|
bucket = oss2.Bucket(auth, endpoint, 'open-bucket')
|
|
bucket = oss2.Bucket(auth, endpoint, 'open-bucket')
|
|
while True:
|
|
while True:
|
|
logging.info("开始新一轮扫描")
|
|
logging.info("开始新一轮扫描")
|
|
- local_delete_list = []
|
|
|
|
oss_delete_list = []
|
|
oss_delete_list = []
|
|
prefix_list = []
|
|
prefix_list = []
|
|
# 2 获取已经上传完成的所有目录并分组
|
|
# 2 获取已经上传完成的所有目录并分组
|
|
@@ -151,15 +150,6 @@ if __name__ == '__main__':
|
|
os.makedirs(root_path1)
|
|
os.makedirs(root_path1)
|
|
|
|
|
|
bucket.get_object_to_file(parse_prefix_full + 'scenario_orig.xosc', root_path1 + 'scenario_orig.xosc')
|
|
bucket.get_object_to_file(parse_prefix_full + 'scenario_orig.xosc', root_path1 + 'scenario_orig.xosc')
|
|
- local_delete_list.append(root_path1 + 'scenario_orig.xosc')
|
|
|
|
move_xosc_before_simulation(root_path1)
|
|
move_xosc_before_simulation(root_path1)
|
|
simulation(parse_prefix_full, root_path1 + 'simulation.mp4')
|
|
simulation(parse_prefix_full, root_path1 + 'simulation.mp4')
|
|
-
|
|
|
|
- # 删除本地临时文件
|
|
|
|
- if len(local_delete_list) > 0:
|
|
|
|
- for local_delete in local_delete_list:
|
|
|
|
- try:
|
|
|
|
- os.remove(local_delete)
|
|
|
|
- except Exception as e:
|
|
|
|
- logging.exception("删除本地临时文件报错: %s" % str(e))
|
|
|
|
time.sleep(sleep_time)
|
|
time.sleep(sleep_time)
|