trompamusic / trompace-client

A python library to read from and write to the Trompa CE
Apache License 2.0
1 stars 0 forks source link

a) make_parameters support dictionaries b) mutation for control action in new format c) refactoring of mutation code #56

Closed aggelosgkiokas closed 3 years ago

aggelosgkiokas commented 3 years ago

Changes to make_parameters(): now it can handle every (??) arbitrary input, including dicts, list of dicts etc. It is a recursive approach. To work, the make_parameters SHOULD be call only once:

Wrong: make_parameters(propertyObject=[StringConstant("{"+make_parameters(foo="one", bar="two")+"}")])) Correct: obj = {"properyObject":{"foo":"foo","boo":"boo"}} make_parameters(**obj)

Also changed mutation/property.py to the new mutation function format and moved all controlaction related mutations to mutations/controlaction.py

pep8speaks commented 3 years ago

Hello @aggelosgkiokas! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 68:131: E501 line too long (133 > 130 characters) Line 69:79: E128 continuation line under-indented for visual indent

Line 323:3: E114 indentation is not a multiple of four (comment)

Comment last updated at 2020-11-27 12:15:27 UTC
alastair commented 3 years ago

This is much better, thanks. Note that your changes caused some tests to fail. Can you take a look at those? You can run the tests locally by running pytest from within the virtualenv

alastair commented 3 years ago

Thanks, this is merged. I had to do some magic with pytest to make assert messages look nice: https://docs.pytest.org/en/stable/writing_plugins.html#assertion-rewriting, but otherwise it was fine.