Skip to content

Commit e1a6d77

Browse files
authored
add yaml dumper representator for str type to keep quotes always. (#436)
* add yaml dumper representator for str type to keep quotes always. Signed-off-by: Tomoya Fujita <[email protected]> * representator should be applied to conversion from py dictionary. Signed-off-by: Tomoya Fujita <[email protected]> --------- Signed-off-by: Tomoya Fujita <[email protected]>
1 parent 2e737c8 commit e1a6d77

File tree

1 file changed

+4
-0
lines changed
  • launch_ros/launch_ros/actions

1 file changed

+4
-0
lines changed

Diff for: launch_ros/launch_ros/actions/node.py

+4
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,10 @@ def _create_params_file_from_dict(self, params):
373373
self.node_name if self.is_node_name_fully_specified() else '/**':
374374
{'ros__parameters': params}
375375
}
376+
377+
def quoted_representor(dumper, data):
378+
return dumper.represent_scalar('tag:yaml.org,2002:str', data, style='"')
379+
yaml.add_representer(str, quoted_representor)
376380
yaml.dump(param_dict, h, default_flow_style=False)
377381
return param_file_path
378382

0 commit comments

Comments
 (0)