python-sdbus / python-sdbus-networkmanager

python-sdbus binds for NetworkManager
GNU Lesser General Public License v2.1
30 stars 6 forks source link

Add to_settings_dict() complementing from_settings_dict() #24

Closed bernhardkaindl closed 2 years ago

bernhardkaindl commented 2 years ago

@igo95862 This adds to_settings_dict() with tests and an example updated to use it.

I've split this into 3 commits to make it easier to review.

The new functions for the library are very small, only the tests are large, the show the functionality.

And examples/async/update-connection-async.py is updated.

It shows a simple example how I'm using the settings_dict added by this (and the previous commit) to convert to and from a simple dict which is also good for conversion to and from JSON for RPC using JSON-RPC.

The 1st commit of this PR adds new helpers used by the tests added in the tests for it.

bernhardkaindl commented 2 years ago

@igo95862 Here is the last of my "feature" commits for the settings helper classes.

Again, there is more info in the description of the PR and this time also more in method docstrings and comments in the added tests.

Thank you for that feature!