Skip to content

Python eval#54

Merged
codebot merged 7 commits intoros:jade-develfrom
ubi-agni:python_eval
Mar 13, 2015
Merged

Python eval#54
codebot merged 7 commits intoros:jade-develfrom
ubi-agni:python_eval

Conversation

@rhaschke
Copy link
Copy Markdown
Contributor

Retargeted #50 to jade-devel branch.

properties and macros in (typically 3rd party) include files

- enable the new behaviour by passing --inorder cmdline option
- to improve code readibility and reusability, introduced functions
  process_include(node), grab_macro(elt, macros), grab_property(elt, symbols)
  containing 1:1 corresponding handling from process_includes, grab_macros, and grab_properties
- added corresponding test case test_inorder_processing()
- replaced handle_expr with python-internal eval() call
- care has been taken to resolve variables recursively on demand (in Table.__getitem__)
- allows for evaluation of standard math functions
- other desired functions could be added in eval_self_contained
- Values in Table symbols are not stored as strings but as typed values.
  If text is required, a conversion with str() is performed.
  This is need to ensure proper evaluation of expressions. Otherwise 3*"1" would evaluate to "111".
- using __future__.division we can handle int division evaluating to float as before
- for equality expressions in <xacro:if>
- math function usage
- literal evaluation should only consider literals, but no expressions
  use ast.literal_eval()
- removed eval() from xacro:if evaluation
  back to string comparison to handle (lowercase) true and false
codebot added a commit that referenced this pull request Mar 13, 2015
python eval, new test cases, ordering improvements
@codebot codebot merged commit ad9718b into ros:jade-devel Mar 13, 2015
@rhaschke rhaschke deleted the python_eval branch April 23, 2015 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants