Source code for fdroid_dl.json.encoder

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import logging
from json import JSONEncoder


LOGGER = logging.getLogger('json.GenericJSONEncoder')
[docs]class GenericJSONEncoder(JSONEncoder): ''' custom encoder so we can serialize Config to json '''
[docs] def default(self, obj): if hasattr(obj, '__json__'): return getattr(obj, '__json__') return JSONEncoder.default(self, obj)