diff --git a/papi/main.py b/papi/main.py index 26ad98d..1379188 100644 --- a/papi/main.py +++ b/papi/main.py @@ -77,8 +77,7 @@ def historique(idsonde): if diff: for d in diff["changements"]: - line = date, *d - print(line) + line = date, *utils.clean_state(d) yield " ".join(line) else: print(f"no change for {date}") diff --git a/papi/utils.py b/papi/utils.py index fbc646e..9afaf2f 100644 --- a/papi/utils.py +++ b/papi/utils.py @@ -54,6 +54,11 @@ def compare(channels, previous, current): return res +def clean_state(state): + # Ote l'identifiant en début de chaine + return state[0].split("#", 1)[1], *state[1:] + + def list_channels(p, c): all_channels = sorted(set((*p["channels"], *c["channels"]))) return all_channels