cnvogelg / amitools

Various tools for using AmigaOS programs on other platforms
258 stars 72 forks source link

WIP: JSON output for commands #139

Closed ryanm101 closed 2 years ago

ryanm101 commented 4 years ago
cnvogelg commented 4 years ago

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...

ryanm101 commented 4 years ago

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

cnvogelg commented 2 years ago

It took quite a while for this feature: but finally its here: a2850a8