debug cat
authorcavaliet
Thu, 23 Oct 2014 10:42:11 +0200
changeset 56 b90c1bd1a46e
parent 55 18e48b4ec917
child 57 cb4df234fd79
debug cat
client/data/categories.json
utils/create_url_polemics_param.py
--- a/client/data/categories.json	Thu Oct 23 10:33:31 2014 +0200
+++ b/client/data/categories.json	Thu Oct 23 10:42:11 2014 +0200
@@ -4,6 +4,7 @@
             "label": "Mélodie",
             "prelabel": "",
             "color": "rgb(205,200,63)",
+            "code": "melodie",
             "subcategories": [
                 {
                     "label": "Bon",
@@ -53,6 +54,7 @@
             "label": "Rythme",
             "prelabel": "",
             "color": "rgb(78,144,204)",
+            "code": "rythme",
             "subcategories": [
                 {
                     "label": "Bon",
@@ -102,6 +104,7 @@
             "label": "Narration",
             "prelabel": "",
             "color": "rgb(211,94,60)",
+            "code": "narration",
             "subcategories": [
                 {
                     "label": "Bon",
@@ -151,6 +154,7 @@
             "label": "Interaction entre musiciens",
             "prelabel": "",
             "color": "rgb(197,163,202)",
+            "code": "interaction",
             "subcategories": [
                 {
                     "label": "Bon",
@@ -200,6 +204,7 @@
             "label": "Gestuelle",
             "prelabel": "",
             "color": "rgb(121,187,146)",
+            "code": "gestuelle",
             "subcategories": [
                 {
                     "label": "Bon",
@@ -249,24 +254,25 @@
             "label": "À Rejouer",
             "prelabel": "",
             "color": "rgb(137,199,214)",
+            "code": "a-rejouer",
             "subcategories": [
                 {
                     "label": "Plus vite",
                     "prelabel": "À Rejouer",
                     "color": "rgb(137,199,214)",
-                    "code": "a-rejouer-bon"
+                    "code": "a-rejouer-plus-vite"
                 },
                 {
                     "label": "Plus lentement",
                     "prelabel": "À Rejouer",
                     "color": "rgb(137,199,214)",
-                    "code": "a-rejouer-mauvais"
+                    "code": "a-rejouer-plus-lentement"
                 },
                 {
                     "label": "Avec un autre instrument",
                     "prelabel": "À Rejouer",
                     "color": "rgb(137,199,214)",
-                    "code": "a-rejouer-trop"
+                    "code": "a-rejouer-autre-instrument"
                 }
             ]
         }
--- a/utils/create_url_polemics_param.py	Thu Oct 23 10:33:31 2014 +0200
+++ b/utils/create_url_polemics_param.py	Thu Oct 23 10:42:11 2014 +0200
@@ -31,11 +31,11 @@
     output = []
     
     for c in data["categories"]:
-        if "subcategories" in c and len(c["subcategories"])>0:
-            for sc in c["subcategories"]:
-                output.append({"name": sc["code"],"keywords": [ sc["label"] ], "color" : sc["color"] })
-        else:
-            output.append({"name": c["code"],"keywords": [ c["label"] ], "color" : c["color"] })
+        #if "subcategories" in c and len(c["subcategories"])>0:
+        #    for sc in c["subcategories"]:
+        #        output.append({"name": sc["code"],"keywords": [ sc["label"] ], "color" : sc["color"] })
+        #else:
+        output.append({"name": c["code"],"keywords": [ c["label"] ], "color" : c["color"] })
     
     base_url = "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/embediframe/?project_id=" + options.project_id + "&polemic=all&polemics_list="
     output_str = json.dumps(output, separators=(',',':'))