'Print in json format but customized for pretty artifact display.'

def ToPrettyJson(self, extended=False):

    if extended:
        artifact_dict = self.ToExtendedDict()
    else:
        artifact_dict = self.ToPrimitiveDict()
    artifact_json = json.dumps(artifact_dict, indent=2, sort_keys=True, separators=(',', ':    '))
    def CompressBraces(name, in_str):
        return re.sub(('%s\\":    \\[\\n\\s+(.*)\\n\\s+' % name), ('%s":    [    \\g<1>    ' % name), in_str)
    artifact_json = CompressBraces('conditions', artifact_json)
    artifact_json = CompressBraces('urls', artifact_json)
    artifact_json = CompressBraces('labels', artifact_json)
    artifact_json = CompressBraces('supported_os', artifact_json)
    artifact_json = re.sub('{\\n\\s+', '{    ', artifact_json)
    return artifact_json
