Skip to content

Commit

Permalink
Merge pull request #21 from colcon/cottsay/raw-strings
Browse files Browse the repository at this point in the history
Address invalid escape sequences in strings
  • Loading branch information
vmayoral authored Feb 10, 2024
2 parents f81c2cd + 87a019c commit b266ad1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions colcon_hardware_acceleration/subverb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def mount_rawimage(rawimage_path, partition=1, debug=False):

# fetch UNITS
units = None
cmd = "fdisk -l " + rawimage_path + " | grep 'Units\|Unidades' | awk '{print $8}'"
cmd = "fdisk -l " + rawimage_path + " | grep 'Units\\|Unidades' | awk '{print $8}'"
outs, errs = run(cmd, shell=True)
if outs:
units = int(outs)
Expand Down Expand Up @@ -682,7 +682,7 @@ def copy_colcon_workspace(install_dir): # noqa: D102

# fetch UNITS
units = None
cmd = "fdisk -l " + rawimage_path + " | grep 'Units\|Unidades' | awk '{print $8}'"
cmd = "fdisk -l " + rawimage_path + " | grep 'Units\\|Unidades' | awk '{print $8}'"
outs, errs = run(cmd, shell=True)
if outs:
units = int(outs)
Expand Down Expand Up @@ -921,7 +921,7 @@ def fix_yocto_honister(partition=2): # noqa: D102
- /etc/profile.d/ros/setup.sh and
- /usr/bin/ros_setup.bash
"""
content_etc_profile = """
content_etc_profile = r"""
# generated from ament_package/template/prefix_level/setup.sh.in
# since this file is sourced use either the provided AMENT_CURRENT_PREFIX
Expand Down Expand Up @@ -1068,7 +1068,7 @@ def fix_yocto_honister(partition=2): # noqa: D102
unset AMENT_SHELL
"""

content_usr_bin = """
content_usr_bin = r"""
# copied from ament_package/template/prefix_level/setup.bash
AMENT_SHELL=bash
Expand Down
2 changes: 1 addition & 1 deletion colcon_hardware_acceleration/subverb/emulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def prepare_emulation(self, context): # noqa: D102
cmd = (
"fdisk -l "
+ rawimage_path
+ " | grep 'Units\|Unidades' | awk '{print $8}'"
+ " | grep 'Units\\|Unidades' | awk '{print $8}'"
)
outs, errs = run(cmd, shell=True)
if outs:
Expand Down

0 comments on commit b266ad1

Please sign in to comment.