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

expose spec for dynamically generated messages #75

Merged
merged 1 commit into from
Mar 2, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/genpy/dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ def generate_dynamic(core_type, msg_cat):
messages[t] = getattr(mod, _gen_dyn_name(pkg, s_type))
except AttributeError:
raise MsgGenerationException("cannot retrieve message class for %s/%s: %s"%(pkg, s_type, _gen_dyn_name(pkg, s_type)))
messages[t]._spec = specs[t]
Copy link
Member

Choose a reason for hiding this comment

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

could you point me to where the _spec slot/attribute is defined ? I can't find it in the generated python modules or the genpy.Message class. Is it equivalent to _full_text in the generated classes?

Copy link
Member Author

Choose a reason for hiding this comment

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

The instance is a generated class. It doesn't have that attribute before. _full_text contains the plain text of the message, _spec contains the parsed MsgSpec instance for the message.

Copy link
Member

Choose a reason for hiding this comment

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

ok that explains what I couldn't find it in the generated code then. Thanks for clarifying 👍


return messages

Expand Down