diff --git a/misc/upload_notification_template.html b/misc/upload_notification_template.html index 5aa9809..e4af4c1 100644 --- a/misc/upload_notification_template.html +++ b/misc/upload_notification_template.html @@ -13,7 +13,7 @@
Dear user,
Your file has been successfully uploaded and is now in our processing queue. This means that our system has received your file, and it is waiting to be processed. We will handle your file as soon as possible.
- +We will notify you once your file has been processed. If you have any urgent needs or further questions, feel free to reach out to our support team.
You can contact our support team at {contact_email}. Please note that our support team is here to help with any questions or issues you might have.
diff --git a/scraibe/email_sender.py b/scraibe/email_sender.py index 162b8cd..0a97cf3 100644 --- a/scraibe/email_sender.py +++ b/scraibe/email_sender.py @@ -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"] diff --git a/scraibe/tasks.py b/scraibe/tasks.py index 8da6a9f..26ffac9 100644 --- a/scraibe/tasks.py +++ b/scraibe/tasks.py @@ -118,7 +118,7 @@ def send_initial_email(to: str, queue_pos: int): try: html = load_template( "upload_notification_template.html", - queue_position=str(queue_pos) if queue_pos > 0 else "the queue", + queue_position=str(max(queue_pos, 1)), ) except EmailError as e: logger.warning("Failed to render upload notification template: %s", e)