update: write status in JSON repo file, using new internal API

This commit is contained in:
Hans-Christoph Steiner 2020-02-18 12:41:12 +01:00
parent 5459a461db
commit d16478b10b
No known key found for this signature in database
GPG key ID: 3E177817BA1B9BFA
3 changed files with 100 additions and 9 deletions

View file

@ -64,13 +64,6 @@ class Decoder(json.JSONDecoder):
return set(values), end
class Encoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, set):
return sorted(obj)
return super().default(obj)
def write_json_report(url, remote_apk, unsigned_apk, compare_result):
"""write out the results of the verify run to JSON
@ -118,7 +111,7 @@ def write_json_report(url, remote_apk, unsigned_apk, compare_result):
data['packages'][packageName] = set()
data['packages'][packageName].add(output)
with open(jsonfile, 'w') as fp:
json.dump(data, fp, cls=Encoder, sort_keys=True)
json.dump(data, fp, cls=common.Encoder, sort_keys=True)
def main():