Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Iterable from collections.abc. #73

Merged
merged 2 commits into from Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions setup.cfg
@@ -1,4 +1,4 @@
[develop]
script-dir=$base/share/urdfdom_py/scripts
script_dir=$base/share/urdfdom_py/scripts
[install]
install-scripts=$base/share/urdfdom_py/scripts
install_scripts=$base/share/urdfdom_py/scripts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is different from https://github.com/ros2/examples/blob/master/rclpy/executors/setup.cfg where scripts are installed into $base/lib/package name. I think that's the only place ros2 looks for scripts to run.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is an excellent point, and indeed no binaries are found with ros2 run urdfdom_py display_urdf. I'll merge this one in and also open another PR to fix that.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where can I find this setup.cfg file?

4 changes: 2 additions & 2 deletions src/urdf_parser_py/xml_reflection/basics.py
@@ -1,6 +1,6 @@
import string
import yaml
import collections
import collections.abc
from lxml import etree

def xml_string(rootXml, addHeader=True):
Expand Down Expand Up @@ -66,7 +66,7 @@ def to_yaml(obj):
elif hasattr(obj, 'tolist'):
# For numpy objects
out = to_yaml(obj.tolist())
elif isinstance(obj, collections.Iterable):
elif isinstance(obj, collections.abc.Iterable):
out = [to_yaml(item) for item in obj]
else:
out = str(obj)
Expand Down