update ros_package_path.bat.em to follow logic in ros_package_path.sh.em#13
Merged
dirk-thomas merged 4 commits intoros:melodicfrom Jan 26, 2019
kejxu:update_ros_package_path.bat
Merged
update ros_package_path.bat.em to follow logic in ros_package_path.sh.em#13dirk-thomas merged 4 commits intoros:melodicfrom kejxu:update_ros_package_path.bat
dirk-thomas merged 4 commits intoros:melodicfrom
kejxu:update_ros_package_path.bat
Conversation
* Get ROS_PACKAGE_PATH from the python * normcase workspace path and eliminate duplicate entries
dirk-thomas
reviewed
Jan 15, 2019
env-hooks/1.ros_package_path.bat.em
Outdated
| echo paths = [path for path in os.environ[env_name].split(os.pathsep)] if env_name in os.environ and os.environ[env_name] != '' else [] >> _parent_package_path.py | ||
| echo workspaces = [path for path in paths if os.path.exists(os.path.join(path, '.catkin'))] >> _parent_package_path.py | ||
| echo # remove duplicate entries >> _parent_package_path.py | ||
| echo unique_workspaces = [] >> _parent_package_path.py |
Member
There was a problem hiding this comment.
I would suggest to use a set here instead of a list since the order of elements doesn't matter and all items are unique.
Author
There was a problem hiding this comment.
Thanks for the suggestion! updated to use list(set()) + list comprehension to remove duplicate entries
Member
|
Thanks for the patch. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the first part of this change is updating
ros_package_path.bat.emto follow the same logic (reuse python code) inros_package_path.sh.em.the second part of this change does some extra package paths' processing by removing duplicate entries in the
workspaceslist