Label ids first in each JSON line (D-131)

ids.py puts the id first and never re-gives an id retired in the same operation; labeling.py
keeps it first on add and edit; controle.py requires it first. Cross-review apply: a modified
label keeps its id, and revue is today's date. All 991 auto labels reordered, content unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-05 08:58:47 +01:00
1 parent d9833b3fdf
commit 620f536e9e
15 files changed
+1024 -1006

No files matched your search

+4 -2
View File
@@ -380,8 +380,10 @@ def modifier(corps):
if not description or datetime.strptime(debut, FORMAT) >= datetime.strptime(fin, FORMAT):
raise ValueError("empty text or range")
c = categorie(corps) if "categorie" in corps else avant.get("categorie", "")
# debut, fin, categorie en tête, comme à l'Add ; les autres champs à leur place
label = dict.fromkeys(("debut", "fin", "categorie")) | avant | {"debut": debut, "fin": fin, "categorie": c, "description": description}
# l'id d'abord (D-131), puis debut, fin, categorie, comme à l'Add ; les autres champs à leur place
label = dict.fromkeys(("id", "debut", "fin", "categorie")) | avant | {"debut": debut, "fin": fin, "categorie": c, "description": description}
if label["id"] is None:
del label["id"]
if not c:
del label["categorie"]
label.pop("revue", None) # texte, catégorie ou bornes changés : à revoir par /review-labels (D-103)