1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-05 18:50:09 +02:00
fdroidserver/tests/metadata/dump
Hans-Christoph Steiner b7fc7f2228 convert App to subclass of dict to support parsing/dumping libs
Python is heavily based on its core data types, and dict is one of the more
important ones.  Even classes are basically a wrapper around a dict. This
converts metadata.App to be a subclass of dict so it can behave like a dict
when being dumped and loaded.  This makes its drastically easier to use
different data formats for build metadata and for sending data to the
client.  This approach will ultimately mean we no longer have to maintain
custom parsing and dumping code.

This also means then that the YAML/JSON field names will not have spaces in
them, and they will match exactly what it used as the dict keys once the
data is parsed, as well as matching exactly the instance attribute names:

* CurrentVersion: 1.2.6
* app['CurrentVersion'] == '1.2.6'
* app.CurrentVersion == '1.2.6'

Inspired by:
https://goodcode.io/articles/python-dict-object/
2017-02-24 11:01:01 +01:00
..
org.adaway.yaml convert App to subclass of dict to support parsing/dumping libs 2017-02-24 11:01:01 +01:00
org.smssecure.smssecure.yaml convert App to subclass of dict to support parsing/dumping libs 2017-02-24 11:01:01 +01:00
org.videolan.vlc.yaml convert App to subclass of dict to support parsing/dumping libs 2017-02-24 11:01:01 +01:00