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")
|
||||
|
||||
def jsproc(data):
|
||||
"""supprime les données inutiles d'une série"""
|
||||
unwanted = ("color","opacity","yAxis","dashStyle", "tooltip",)
|
||||
"""traite les données JSON"""
|
||||
if data.get("data"):
|
||||
#nettoyage des données
|
||||
unwanted = ("color","opacity","yAxis","dashStyle", "tooltip",)
|
||||
for u in unwanted:
|
||||
if u in data.keys():
|
||||
if u == "tooltip":
|
||||
if u == "tooltip": #rattache une unité à la valeur concernée
|
||||
tt = data.get(u)
|
||||
suffix = tt.get("valueSuffix")
|
||||
if suffix: data.update({
|
||||
"name": " ".join([data["name"], suffix])
|
||||
})
|
||||
del(data[u])
|
||||
del(data[u]) #supprime la donnée indésirable
|
||||
return data
|
||||
|
||||
def hproc(path_in):
|
||||
|
Loading…
Reference in New Issue
Block a user