Skip to content

Commit

Permalink
fix c++ new line
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Gesel <paul.gesel@picknik.ai>
  • Loading branch information
pac48 committed Feb 24, 2024
1 parent 2544ff7 commit fa2157d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
8 changes: 8 additions & 0 deletions example/src/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,11 @@ admittance_controller:
default_value: [3,3,3],
read_only: true,
}
hover_override: {
type: int,
default_value: 1,
description: "Override hover action:\n0: Hover\n1: Push\n2: Pull\n-1: Do not override",
validation: {
one_of<>: [ [ 0, 1, 2, -1 ] ],
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,8 @@ def valid_string_cpp(description):
str: The filtered string that is a valid C++ string.
"""
if description:
filtered_description = (
description.replace('\\', '\\\\').replace('"', '\\"').replace('`', '')
)
# create a quote delimited string for every line
filtered_description = '\n'.join(
f'"{line}"' for line in filtered_description.splitlines()
)
return filtered_description
filtered_description = description.replace('\n', '\\n ')
return f'"{filtered_description}"'
else:
return '""'

Expand All @@ -33,7 +27,6 @@ def valid_string_python(description):
str: The filtered string that is a valid Python string.
"""
if description:
return description.replace('\n', '\\n')
# return description.replace('\n', '\\\n')
return description.replace('\n', '\\n ')
else:
return ''

0 comments on commit fa2157d

Please # to comment.