Carry underlines to the slides; keep Bible names in the typo check (v1.3.1)
- Underlined words in the notes are underlined on every slide type, as the
operator does by hand (Part 8: "saved", "saves"); segments are now
(text, bold, italic, underline); TextEdit edit format uses __word__
- Typo check never changes capitalised words inside scripture, or names
the notes' scripture uses ("Gilead was the father..." became "Gilled")
- Tests: Part 8 + Together Tuesday notes, hand-fixed Part 8 deck
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+33
-1
@@ -112,7 +112,39 @@ def main():
|
||||
except spelling.Unavailable as e:
|
||||
print("skip typo checks (%s)" % e)
|
||||
|
||||
# 7. other campuses: their template names, and who preaches there according to the email
|
||||
# 7. underlined words in the notes are underlined on the slides (as the operator does by hand)
|
||||
def underlined_runs(data):
|
||||
p = deck.C.decode(data, "rv.data.Presentation")
|
||||
out = []
|
||||
for c in deck.C.all(p, "cues"):
|
||||
a = deck.slide_action(c)
|
||||
for el in (deck.slide_elements(a) if a is not None else []):
|
||||
t = deck.element_text(el)
|
||||
d = deck.C.get(t, "rtf_data") if t is not None else None
|
||||
for para in (rtf.read(d).paras if d else []):
|
||||
out += [r.text.strip() for r in para.runs if "ul" in r.state and r.text.strip()]
|
||||
return sorted(out)
|
||||
|
||||
p8 = notes.parse(open(os.path.join(NOTES, "Slides - Where is Your Faith - Part 8.rtf"), "rb").read())
|
||||
got = underlined_runs(deck.build(tpl, p8, "TEST", tpl.speaker()))
|
||||
hand = underlined_runs(open(os.path.join(PRO, "261018 Where Is Your Faith Part 8.pro"), "rb").read())
|
||||
check("part 8 underlines match the hand-fixed deck", got == hand == ["saved", "saves"], "%s vs %s" % (got, hand))
|
||||
p7l = notes.parse(open(os.path.join(NOTES, "Slides - 7 Letters - Part 2.rtf"), "rb").read())
|
||||
got = underlined_runs(deck.build(tpl, p7l, "TEST", tpl.speaker()))
|
||||
hand = underlined_runs(open(os.path.join(PRO, "260628 The 7 Letters Part 2.pro"), "rb").read())
|
||||
check("7 Letters 2 underlines match the hand-made deck", got == hand, "%s vs %s" % (got, hand))
|
||||
tt = notes.parse(open(os.path.join(NOTES, "Slides - Together Tuesday - October 2026.rtf"), "rb").read())
|
||||
pt = [s for s in tt.slides if s.kind == "point" and s.lines[0].text.startswith("Prophesy")]
|
||||
check("underline kept in a point", pt and [x[0] for x in pt[0].lines[0].segs_plain() if x[3]] == ["Prophesy,"],
|
||||
"%s" % (pt[0].lines[0].segs_plain() if pt else "no point"))
|
||||
rt = plantext.load(plantext.dump(p8, "x"))
|
||||
styled = lambda plan: [[(ch,) + tuple(seg[1:]) for seg in l.segs for ch in seg[0] if not ch.isspace()]
|
||||
for s in plan.slides for l in s.lines] # spaces at bold edges may move
|
||||
check("underline survives the TextEdit round trip", styled(p8) == styled(rt))
|
||||
check("fill-in blanks are not underline marks", plantext.parse_bold("Faith is ______.") ==
|
||||
[("Faith is ______.", False, False, False)])
|
||||
|
||||
# 8. other campuses: their template names, and who preaches there according to the email
|
||||
import app
|
||||
import settings
|
||||
for n, want in (("_TEMPLATE - DO NOT DELETE 2608 Lower Thirds.pro", True),
|
||||
|
||||
Reference in New Issue
Block a user