utils/create_url_polemics_param.py
changeset 56 b90c1bd1a46e
parent 41 69a7e0b101de
child 58 726ee64f18a9
equal deleted inserted replaced
55:18e48b4ec917 56:b90c1bd1a46e
    29     json_file.close()
    29     json_file.close()
    30     
    30     
    31     output = []
    31     output = []
    32     
    32     
    33     for c in data["categories"]:
    33     for c in data["categories"]:
    34         if "subcategories" in c and len(c["subcategories"])>0:
    34         #if "subcategories" in c and len(c["subcategories"])>0:
    35             for sc in c["subcategories"]:
    35         #    for sc in c["subcategories"]:
    36                 output.append({"name": sc["code"],"keywords": [ sc["label"] ], "color" : sc["color"] })
    36         #        output.append({"name": sc["code"],"keywords": [ sc["label"] ], "color" : sc["color"] })
    37         else:
    37         #else:
    38             output.append({"name": c["code"],"keywords": [ c["label"] ], "color" : c["color"] })
    38         output.append({"name": c["code"],"keywords": [ c["label"] ], "color" : c["color"] })
    39     
    39     
    40     base_url = "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/embediframe/?project_id=" + options.project_id + "&polemic=all&polemics_list="
    40     base_url = "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/embediframe/?project_id=" + options.project_id + "&polemic=all&polemics_list="
    41     output_str = json.dumps(output, separators=(',',':'))
    41     output_str = json.dumps(output, separators=(',',':'))
    42     
    42     
    43     print "SIMPLE JSON DUMPS :"
    43     print "SIMPLE JSON DUMPS :"