Nicer output

This commit is contained in:
Colin Goutte 2021-09-24 15:29:57 +02:00
parent 1a91c32880
commit 876d46b719
2 changed files with 6 additions and 2 deletions

View File

@ -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}")

View File

@ -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