tractatus/pptx-env/lib/python3.12/site-packages/PyPDF2/generic/_outline.py
TheFlow ac2db33732 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

35 lines
1.2 KiB
Python

from typing import Any, Union
from .._utils import StreamType, deprecation_with_replacement
from ._base import NameObject
from ._data_structures import Destination
class OutlineItem(Destination):
def write_to_stream(
self, stream: StreamType, encryption_key: Union[None, str, bytes]
) -> None:
stream.write(b"<<\n")
for key in [
NameObject(x)
for x in ["/Title", "/Parent", "/First", "/Last", "/Next", "/Prev"]
if x in self
]:
key.write_to_stream(stream, encryption_key)
stream.write(b" ")
value = self.raw_get(key)
value.write_to_stream(stream, encryption_key)
stream.write(b"\n")
key = NameObject("/Dest")
key.write_to_stream(stream, encryption_key)
stream.write(b" ")
value = self.dest_array
value.write_to_stream(stream, encryption_key)
stream.write(b"\n")
stream.write(b">>")
class Bookmark(OutlineItem): # pragma: no cover
def __init__(self, *args: Any, **kwargs: Any) -> None:
deprecation_with_replacement("Bookmark", "OutlineItem", "3.0.0")
super().__init__(*args, **kwargs)