aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/gen-of-sanctoral-readings.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/scripts/gen-of-sanctoral-readings.py b/scripts/gen-of-sanctoral-readings.py
index fd9c035..a37a0c1 100644
--- a/scripts/gen-of-sanctoral-readings.py
+++ b/scripts/gen-of-sanctoral-readings.py
@@ -85,18 +85,27 @@ def scrape():
continue
mmdd = f"{MONS[m.group(1)]:02d}-{int(m.group(2)):02d}"
rank, src = c[3], c[4]
+ su = src.upper()
if rank.startswith("USA") or "Calif" in rank:
continue # national additions not in the universal calendar
- if not ("PROPER" in src.upper() or "Solemnity" in rank or "Feast" in rank):
+ if not ("PROPER" in su or "Solemnity" in rank or "Feast" in rank):
continue # Common-based memorial -> keep the ferial
- rows.append((mmdd, c[2], "vigil" in c[2].lower(),
- {"first": clean_cite(c[5]), "psalm": clean_cite(c[6]),
- "second": clean_cite(c[7]), "gospel": clean_cite(c[9])}))
+ parts = {"first": clean_cite(c[5]), "psalm": clean_cite(c[6]),
+ "second": clean_cite(c[7]), "gospel": clean_cite(c[9])}
+ # PARTIAL propers: the source-note marks which part is strictly proper; the
+ # OTHER reading is the ferial (the resolver fills it at runtime). A memorial
+ # with a "PROPER Gospel" keeps ONLY the gospel (Guardian Angels = ferial
+ # first + Matt 18); a "PROPER First Reading" keeps only the first (Barnabas).
+ if "PROPER" in su and "GOSPEL" in su and "FIRST" not in su:
+ parts = {"first": "", "psalm": "", "second": "", "gospel": parts["gospel"]}
+ elif "PROPER" in su and "FIRST" in su and "GOSPEL" not in su:
+ parts = {"first": parts["first"], "psalm": parts["psalm"], "second": "", "gospel": ""}
+ rows.append((mmdd, c[2], "vigil" in c[2].lower(), parts))
# one Mass per date: prefer the day Mass over a vigil; later row breaks ties
best = {}
for mmdd, name, isvig, parts in rows:
- if not (parts["first"] and parts["gospel"]):
- continue # need at least first + gospel
+ if not (parts["first"] or parts["gospel"]):
+ continue # need at least the proper part
cur = best.get(mmdd)
if cur is None or (cur[0] and not isvig): # replace a vigil with a day Mass
best[mmdd] = (isvig, name, parts)