提交 4d4edc0f 编写于 作者: A Aaron Xiao 提交者: Jiangtao Hu

HMI: Copy file content only when switch vehicle.

上级 c917b379
......@@ -45,12 +45,12 @@ def async_run_command_pb(cmd_pb):
async_run_command(cmd_str, cmd_pb.stdout_file, cmd_pb.stderr_file)
def copy(src, dst):
def copyfile(src, dst):
"""Copy file from src to dst if they are not the same."""
src = Config.get_realpath(src)
dst = Config.get_realpath(dst)
if src != dst:
shutil.copy(src, dst)
shutil.copyfile(src, dst)
Config.log.debug('HMI: Copying file from %s to %s', src, dst)
......
......@@ -156,12 +156,12 @@ class ToolApi(object):
conf_pb = Config.get_pb()
# Copy vehicle_param_pb.
if vehicle_conf.HasField('vehicle_param_pb_path'):
system_cmd.copy(vehicle_conf.vehicle_param_pb_path,
conf_pb.vehicle_param_pb_target_path)
system_cmd.copyfile(vehicle_conf.vehicle_param_pb_path,
conf_pb.vehicle_param_pb_target_path)
# Copy calibration_table.
if vehicle_conf.HasField('calibration_table_path'):
system_cmd.copy(vehicle_conf.calibration_table_path,
conf_pb.calibration_table_target_path)
system_cmd.copyfile(vehicle_conf.calibration_table_path,
conf_pb.calibration_table_target_path)
# Copy velodyne_params.
if vehicle_conf.HasField('velodyne_params_path'):
system_cmd.copytree(
......@@ -169,12 +169,12 @@ class ToolApi(object):
Config.get_realpath(conf_pb.velodyne_params_target_path, True))
# Copy gnss_driver.
if vehicle_conf.HasField('gnss_driver_path'):
system_cmd.copy(
system_cmd.copyfile(
vehicle_conf.gnss_driver_path,
Config.get_realpath(conf_pb.gnss_driver_target_path, True))
# Copy gnss_conf.
if vehicle_conf.HasField('gnss_conf_path'):
system_cmd.copy(
system_cmd.copyfile(
vehicle_conf.gnss_conf_path,
Config.get_realpath(conf_pb.gnss_conf_target_path, True))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册