feat(export): show the kidnappings flag under its glossary name, detention

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GZZENdTLzNGsbNy4DyF1yt
This commit is contained in:
StellarCrow
2026-09-15 15:47:25 +02:00
co-authored by Claude Fable 5.1
parent e5043eed41
commit 6c6f79c34e
3 changed files with 6 additions and 3 deletions
+5 -3
View File
@@ -116,7 +116,8 @@ def main():
cov_cols = ["sources_with_text", "article_chars", "untrimmed_blocks", "summary_status", "summary_chars"] cov_cols = ["sources_with_text", "article_chars", "untrimmed_blocks", "summary_status", "summary_chars"]
new_cols = ["venue_of_control", "held_duration", "outcome", "arrests", "amount_demanded_usd", "amount_taken_usd"] new_cols = ["venue_of_control", "held_duration", "outcome", "arrests", "amount_demanded_usd", "amount_taken_usd"]
cols = base_cols + FLAGS + cov_cols + new_cols + ["summary"] cols = base_cols + FLAGS + cov_cols + new_cols + ["summary"]
ws.append(cols) LABEL = {"kidnappings": "detention"} # the DB column keeps its old name; the export shows the glossary name
ws.append([LABEL.get(c, c) for c in cols])
for c in ws[1]: for c in ws[1]:
c.font = Font(bold=True) c.font = Font(bold=True)
c.fill = HEAD c.fill = HEAD
@@ -210,7 +211,7 @@ def main():
# ---------------- case_violence ---------------- # ---------------- case_violence ----------------
ws3 = wb.create_sheet("case_violence") ws3 = wb.create_sheet("case_violence")
ws3.append(["case_id", "category", "subtype", "target", "evidence", "source"]) ws3.append(["case_id", "category", "subtype", "target", "evidence", "source"]) # category 'detention' = DB flag kidnappings
for c in ws3[1]: for c in ws3[1]:
c.font = Font(bold=True) c.font = Font(bold=True)
c.fill = HEAD c.fill = HEAD
@@ -224,7 +225,7 @@ def main():
elif int(v) > 0: elif int(v) > 0:
n = int(v) if f == "life_taken" else 1 n = int(v) if f == "life_taken" else 1
for _ in range(n): for _ in range(n):
ws3.append([r["id"], CATEGORY_OF[f], None, None, None, f"seeded from flag {f}={v}"]) ws3.append([r["id"], CATEGORY_OF[f], None, None, None, f"seeded from flag {LABEL.get(f, f)}={v}"])
for c in ws3[ws3.max_row][2:5]: for c in ws3[ws3.max_row][2:5]:
c.fill = ORANGE c.fill = ORANGE
ws3.freeze_panes = "A2" ws3.freeze_panes = "A2"
@@ -252,6 +253,7 @@ def main():
("blue", BLUE, "filled by a rule from existing data (venue from scenario, held from the flag, outcome from Dodged/life_taken, " ("blue", BLUE, "filled by a rule from existing data (venue from scenario, held from the flag, outcome from Dodged/life_taken, "
"USD parsed from money_wanted, scenario tags proposed by the site's keyword engine): a proposal, not verified"), "USD parsed from money_wanted, scenario tags proposed by the site's keyword engine): a proposal, not verified"),
("none", None, "present and verified")] ("none", None, "present and verified")]
ws5.append(["note", "column 'detention' on the attacks sheet is the DB field 'kidnappings' (the detention violence category, see DEFINITIONS.md)"])
ws5.append(["colour", "meaning"]) ws5.append(["colour", "meaning"])
for name, fill, meaning in rows: for name, fill, meaning in rows:
ws5.append([name, meaning]) ws5.append([name, meaning])
@@ -0,0 +1 @@
,disi,pop-os,15.09.2026 15:33,file:///home/disi/.config/libreoffice/4;