tractatus/pptx-env/lib/python3.12/site-packages/xlsxwriter/rich_value_rel.py
TheFlow 2298d36bed fix(submissions): restructure Economist package and fix article display
- Create Economist SubmissionTracking package correctly:
  * mainArticle = full blog post content
  * coverLetter = 216-word SIR— letter
  * Links to blog post via blogPostId
- Archive 'Letter to The Economist' from blog posts (it's the cover letter)
- Fix date display on article cards (use published_at)
- Target publication already displaying via blue badge

Database changes:
- Make blogPostId optional in SubmissionTracking model
- Economist package ID: 68fa85ae49d4900e7f2ecd83
- Le Monde package ID: 68fa2abd2e6acd5691932150

Next: Enhanced modal with tabs, validation, export

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 08:47:42 +13:00

82 lines
2.2 KiB
Python

###############################################################################
#
# RichValueRel - A class for writing the Excel XLSX richValueRel.xml file.
#
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2013-2025, John McNamara, jmcnamara@cpan.org
#
# Package imports.
from . import xmlwriter
class RichValueRel(xmlwriter.XMLwriter):
"""
A class for writing the Excel XLSX richValueRel.xml file.
"""
###########################################################################
#
# Public API.
#
###########################################################################
def __init__(self) -> None:
"""
Constructor.
"""
super().__init__()
self.num_embedded_images = 0
###########################################################################
#
# Private API.
#
###########################################################################
def _assemble_xml_file(self) -> None:
# Assemble and write the XML file.
# Write the XML declaration.
self._xml_declaration()
# Write the richValueRels element.
self._write_rich_value_rels()
self._xml_end_tag("richValueRels")
# Close the file.
self._xml_close()
###########################################################################
#
# XML methods.
#
###########################################################################
def _write_rich_value_rels(self) -> None:
# Write the <richValueRels> element.
xmlns = "http://schemas.microsoft.com/office/spreadsheetml/2022/richvaluerel"
xmlns_r = "http://schemas.openxmlformats.org/officeDocument/2006/relationships"
attributes = [
("xmlns", xmlns),
("xmlns:r", xmlns_r),
]
self._xml_start_tag("richValueRels", attributes)
# Write the rel elements.
for index in range(self.num_embedded_images):
self._write_rel(index + 1)
def _write_rel(self, index) -> None:
# Write the <rel> element.
r_id = f"rId{index}"
attributes = [("r:id", r_id)]
self._xml_empty_tag("rel", attributes)