Closed bernhardkaindl closed 2 years ago
@igo95862 Method to create a settings profile from a simple dict without signatures - I need this for my RPC server to create (and modify) with input data being a simple JSON which I convert to this simple settings dict which this new method reads.
I need this for my RPC server to create (and modify) with input data being a simple JSON
I am curious what does your RPC server do.
Also I wonder if the JSONDecoder
can be leveraged here.
The RPC server gives info about NetworkManager's connections, configures them from remote and more. Of course a simple dict is easy to convert to/from JSON using json.loads() and json.dumps(). I'm using the xjsonrpc
package for RPC which does this internally.
A simple settings dict uses the same keys as from_dbus() and to_dbus() but without the dbus variable signatures used by NetworkManader.py
This means a simple settings dict does not use the underscore in keys like the attributes of this class have to use and use "id" and "type".
Also adds a simple test case which tests the conversion from the simple settings dict and can also test adding a wireless connection (unsaved, not with autoconnect) which is also deleted by the test.