Always send numeric queue position in upload notification email
This commit is contained in:
+15
-14
@@ -291,26 +291,25 @@ def create_transcript_docx(text: str, filename: str):
|
||||
- 12pt Courier
|
||||
- Continuous line numbering on the left
|
||||
- Speaker names capitalized and indented; spoken text further indented
|
||||
- No section headings; use bold/underline only.
|
||||
"""
|
||||
doc = Document()
|
||||
section = doc.sections[0]
|
||||
|
||||
# Margins
|
||||
# Set margins via section properties
|
||||
section = doc.sections[0]
|
||||
section.left_margin = Inches(1.5)
|
||||
section.right_margin = Inches(1.0)
|
||||
section.top_margin = Inches(1.0)
|
||||
section.bottom_margin = Inches(1.0)
|
||||
|
||||
# Line numbering (continuous, left side)
|
||||
section_type = section.element.find(qn("w:sectionPr"))
|
||||
if section_type is None:
|
||||
section_type = OxmlElement("w:sectionPr")
|
||||
section.element.insert(0, section_type)
|
||||
|
||||
line_num = OxmlElement("w:lineNumbering")
|
||||
line_num.set(qn("w:start"), "continuous")
|
||||
line_num.set(qn("w:countBy"), "1")
|
||||
section_type.append(line_num)
|
||||
# Enable continuous line numbering on the left
|
||||
sectPr = section._element
|
||||
lnNumType = sectPr.find(qn("w:lnNumType"))
|
||||
if lnNumType is None:
|
||||
lnNumType = OxmlElement("w:lnNumType")
|
||||
sectPr.append(lnNumType)
|
||||
lnNumType.set(qn("w:start"), "continuous")
|
||||
lnNumType.set(qn("w:countBy"), "1")
|
||||
|
||||
# Default font
|
||||
style = doc.styles["Normal"]
|
||||
@@ -329,15 +328,16 @@ def create_transcript_docx(text: str, filename: str):
|
||||
m = re.match(r"\[(\d+:\d+(?::\d+)?)\]\s*(.+?):\s*(.*)", line)
|
||||
if m:
|
||||
ts, speaker, content = m.groups()
|
||||
# Speaker line
|
||||
# Speaker line: bold, underlined, indented
|
||||
p_spk = doc.add_paragraph()
|
||||
p_spk.paragraph_format.left_indent = Inches(0.25)
|
||||
run_spk = p_spk.add_run(f"[{ts}] {speaker.upper()}")
|
||||
run_spk.bold = True
|
||||
run_spk.underline = True
|
||||
run_spk.font.name = "Courier"
|
||||
run_spk.font.size = Pt(12)
|
||||
|
||||
# Spoken text line
|
||||
# Spoken text line: further indented
|
||||
p_txt = doc.add_paragraph()
|
||||
p_txt.paragraph_format.left_indent = Inches(0.5)
|
||||
run_txt = p_txt.add_run(content.strip())
|
||||
@@ -356,6 +356,7 @@ def create_transcript_docx(text: str, filename: str):
|
||||
def create_summary_docx(text: str, filename: str):
|
||||
"""
|
||||
Create a .docx summary with consistent font.
|
||||
No section headings; use bold/underline only.
|
||||
"""
|
||||
doc = Document()
|
||||
style = doc.styles["Normal"]
|
||||
|
||||
Reference in New Issue
Block a user