def encode_status(status): """ Before encoding a status object to JSON, we need to turn it into something simpler. """ return status.__getstate__()