fix flake8
Python CI / test (push) Has been cancelled

This commit is contained in:
2025-11-04 22:41:05 +01:00
parent 37505d3dcc
commit 55fdcbcb6d
4 changed files with 8 additions and 336 deletions
+1 -3
View File
@@ -9,6 +9,7 @@ from pyWebLayout.abstract import Paragraph, Word, Link
from pyWebLayout.abstract.block import Image as AbstractImage
from pyWebLayout.abstract.inline import LinkedWord
from pyWebLayout.style.concrete_style import ConcreteStyleRegistry, RenderingContext, StyleResolver
from pyWebLayout.style import Font, Alignment
def paragraph_layouter(paragraph: Paragraph, page: Page, start_word: int = 0, pretext: Optional[Text] = None, alignment_override: Optional['Alignment'] = None) -> Tuple[bool, Optional[int], Optional[Text]]:
"""
@@ -40,7 +41,6 @@ def paragraph_layouter(paragraph: Paragraph, page: Page, start_word: int = 0, pr
# paragraph.style is already a Font object (concrete), not AbstractStyle
# We need to get word spacing constraints from the Font's abstract style if available
# For now, use reasonable defaults based on font size
from pyWebLayout.style import Font, Alignment
if isinstance(paragraph.style, Font):
# paragraph.style is already a Font (concrete style)
@@ -228,8 +228,6 @@ def image_layouter(image: AbstractImage, page: Page, max_width: Optional[int] =
Returns:
bool: True if image was successfully laid out, False if page ran out of space
"""
from pyWebLayout.style import Alignment
# Use page available width if max_width not specified
if max_width is None:
max_width = page.available_width