amitools
amitools copied to clipboard
WIP: JSON output for commands
- Methods added for Partition Info as JSON
I really like the idea of json output... From the implementation side I'd prefer to have a generic approach... I.e. the Python objects are inspected by a json exporter or convert themselves to dicts and then the json conversion takes place. This allows us to write a single json dumper that works on all structures...
I thought about the exporter but it would have to be 'smart' because it would need to handle types such has size in MB etc.
The self conversion i liked the most and thought about using the __str__() method to return a JSON string which could then be decoded.
The current implementation is meant as a 'phase 1' to get naming, and patterns working without breaking existing returns
It took quite a while for this feature: but finally its here: a2850a8