IObundle / py2hwsw

a Python framework for managing embedded HW/SW projects
MIT License
9 stars 3 forks source link

ShortHand notation #41

Closed agrevin closed 2 months ago

agrevin commented 2 months ago

This PR introduces a new notation to describe iob_core's attributes. The handler method of each attribute can use the new str_to_kwargs decorator to take a string instead of **kwargs. The format of the string is defined by the attrs dictionary with the necessary translation. Arguments are separated by spaces, spaces inside '' are ignored. Arguments that start with $ are translated to kwargs if {<letter>:<attribute>} is in attrs, attrs must also contain the positional arguments as such: {<#position>:<attribute>}. iob_conf has an example of how to use the decorator and iob_int_sqrt has all its confs defined with the new notation. TODO: