chiark / gitweb /
convert metadata.Build to a subclass of dict
authorHans-Christoph Steiner <hans@eds.org>
Tue, 29 Nov 2016 12:26:32 +0000 (13:26 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Fri, 24 Feb 2017 10:01:01 +0000 (11:01 +0100)
commitc0bc3afda9d67a826471df2f387ab1b489df04e0
tree8e0a464d2bc37246891e0e9adf74732f78ad2e92
parentb7fc7f2228986d0210e221c9ec8ddcc2ad9b93bc
convert metadata.Build to a subclass of dict

Like with the App class in the commit before, this makes it a lot
easier to work with this data when converting between the internal
formats and external formats like YAML, JSON, MsgPack, protobuf, etc.

The one unfortunate thing here is Build.update. It becomes
dict.update(), which is a method not an attribute.
build.get('update') or build['update'] could be used, but that would
be oddly inconsistent. So instead the field is renamed to
'androidupdate', except for in the .txt v0 metadata files. This better
describes what field does anyway, since it runs `android update`.

Build.update is only referenced in two places right next to each other
for the ant builds, so this change still seems worthwhile.
fdroidserver/common.py
fdroidserver/metadata.py
tests/metadata.TestCase
tests/metadata/dump/org.adaway.yaml
tests/metadata/dump/org.smssecure.smssecure.yaml
tests/metadata/dump/org.videolan.vlc.yaml
tests/metadata/org.adaway.json
tests/metadata/org.smssecure.smssecure.txt
tests/metadata/org.videolan.vlc.yml