ajout de commentaires
This commit is contained in:
parent
888e1593f9
commit
c68da7af37
@ -10,18 +10,19 @@ except ModuleNotFoundError:
|
|||||||
sys.exit("Le module 'lxml' est nécessaire.\n\thttp://pypi.org/lxml")
|
sys.exit("Le module 'lxml' est nécessaire.\n\thttp://pypi.org/lxml")
|
||||||
|
|
||||||
def jsproc(data):
|
def jsproc(data):
|
||||||
"""supprime les données inutiles d'une série"""
|
"""traite les données JSON"""
|
||||||
unwanted = ("color","opacity","yAxis","dashStyle", "tooltip",)
|
|
||||||
if data.get("data"):
|
if data.get("data"):
|
||||||
|
#nettoyage des données
|
||||||
|
unwanted = ("color","opacity","yAxis","dashStyle", "tooltip",)
|
||||||
for u in unwanted:
|
for u in unwanted:
|
||||||
if u in data.keys():
|
if u in data.keys():
|
||||||
if u == "tooltip":
|
if u == "tooltip": #rattache une unité à la valeur concernée
|
||||||
tt = data.get(u)
|
tt = data.get(u)
|
||||||
suffix = tt.get("valueSuffix")
|
suffix = tt.get("valueSuffix")
|
||||||
if suffix: data.update({
|
if suffix: data.update({
|
||||||
"name": " ".join([data["name"], suffix])
|
"name": " ".join([data["name"], suffix])
|
||||||
})
|
})
|
||||||
del(data[u])
|
del(data[u]) #supprime la donnée indésirable
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def hproc(path_in):
|
def hproc(path_in):
|
||||||
|
Loading…
Reference in New Issue
Block a user