From ce7293824e3af6b33ed5acf360bc24e1ca7aacb7 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Sun, 9 Nov 2025 00:09:04 +0100 Subject: [PATCH] fixing unterminated fsting --- pyWebLayout/core/base.py | 4 ++-- pyWebLayout/io/readers/epub_reader.py | 5 ++--- pyWebLayout/style/fonts.py | 4 ++-- tests/concrete/test_linkedword_hyphenation.py | 4 ++-- tests/io_tests/test_epub_reader.py | 4 ++-- tests/io_tests/test_html_file_loader.py | 4 ++-- tests/layouter/test_document_layouter_integration.py | 6 ++---- 7 files changed, 14 insertions(+), 17 deletions(-) diff --git a/pyWebLayout/core/base.py b/pyWebLayout/core/base.py index 47218e0..28cd681 100644 --- a/pyWebLayout/core/base.py +++ b/pyWebLayout/core/base.py @@ -416,8 +416,8 @@ class ContainerAware: """ if not hasattr(container, required_method): raise AttributeError( - f"Container { - type(container).__name__} must have a '{required_method}' method") + f"Container {type(container).__name__} must have a '{required_method}' method" + ) @classmethod def _inherit_style(cls, container, style=None): diff --git a/pyWebLayout/io/readers/epub_reader.py b/pyWebLayout/io/readers/epub_reader.py index a8f4330..bc11e97 100644 --- a/pyWebLayout/io/readers/epub_reader.py +++ b/pyWebLayout/io/readers/epub_reader.py @@ -461,9 +461,8 @@ class EPUBReader: block._loaded_image = self.image_processor(block._loaded_image) except Exception as e: print( - f"Warning: Image processing failed for image '{ - block.alt_text}': { - str(e)}") + f"Warning: Image processing failed for image '{block.alt_text}': {str(e)}" + ) # Continue with unprocessed image def _process_content_images(self): diff --git a/pyWebLayout/style/fonts.py b/pyWebLayout/style/fonts.py index 66189bb..97e682f 100644 --- a/pyWebLayout/style/fonts.py +++ b/pyWebLayout/style/fonts.py @@ -81,8 +81,8 @@ class Font: logger.debug(f"Font loading: assets_dir = {assets_dir}") logger.debug(f"Font loading: bundled_font_path = {bundled_font_path}") logger.debug( - f"Font loading: bundled font exists = { - os.path.exists(bundled_font_path)}") + f"Font loading: bundled font exists = {os.path.exists(bundled_font_path)}" + ) if os.path.exists(bundled_font_path): logger.info(f"Found bundled font at: {bundled_font_path}") diff --git a/tests/concrete/test_linkedword_hyphenation.py b/tests/concrete/test_linkedword_hyphenation.py index 394a971..78dfad2 100644 --- a/tests/concrete/test_linkedword_hyphenation.py +++ b/tests/concrete/test_linkedword_hyphenation.py @@ -91,8 +91,8 @@ class TestLinkedWordHyphenation(unittest.TestCase): self.assertIsInstance( text_obj, LinkText, - f"Hyphenated LinkedWord part should be LinkText, got { - type(text_obj)}") + f"Hyphenated LinkedWord part should be LinkText, got {type(text_obj)}" + ) self.assertEqual(text_obj.link.location, linked_word.location) # The overflow should also be LinkText if it's hyphenated diff --git a/tests/io_tests/test_epub_reader.py b/tests/io_tests/test_epub_reader.py index e67625f..84d0351 100644 --- a/tests/io_tests/test_epub_reader.py +++ b/tests/io_tests/test_epub_reader.py @@ -381,8 +381,8 @@ class TestEPUBReader(unittest.TestCase): # Each chapter should start with a heading first_block = blocks[0] self.assertIsInstance( - first_block, Heading, f"Chapter { - i + 1} should start with heading") + first_block, Heading, f"Chapter {i + 1} should start with heading" + ) def test_epub_styled_content(self): """Test that styled content in EPUB is properly parsed.""" diff --git a/tests/io_tests/test_html_file_loader.py b/tests/io_tests/test_html_file_loader.py index 2e3615d..4515acd 100644 --- a/tests/io_tests/test_html_file_loader.py +++ b/tests/io_tests/test_html_file_loader.py @@ -51,8 +51,8 @@ class TestHTMLFileLoader(unittest.TestCase): self.assertIsInstance( block, Block, - f"Item {i} should be a Block instance, got { - type(block)}") + f"Item {i} should be a Block instance, got {type(block)}" + ) print(f"Successfully loaded and parsed HTML file with {len(blocks)} blocks") diff --git a/tests/layouter/test_document_layouter_integration.py b/tests/layouter/test_document_layouter_integration.py index fa9ee96..528b898 100644 --- a/tests/layouter/test_document_layouter_integration.py +++ b/tests/layouter/test_document_layouter_integration.py @@ -335,10 +335,8 @@ class TestDocumentLayouterIntegration: line = test_page.children[0] min_spacing, max_spacing = line._spacing - assert min_spacing == case["expected_min"], f"Min constraint failed for { - case['name']}" - assert max_spacing == case["expected_max"], f"Max constraint failed for { - case['name']}" + assert min_spacing == case["expected_min"], f"Min constraint failed for {case['name']}" + assert max_spacing == case["expected_max"], f"Max constraint failed for {case['name']}" print(f"✓ {case['name']}: constraints ({min_spacing}, {max_spacing})")