From: Radek Czajka Date: Tue, 17 Sep 2024 14:08:51 +0000 (+0200) Subject: fixes X-Git-Tag: 24.9~2 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/8939b6a23c816660a6c5366adb03fc0345c911ed?ds=inline;hp=ddeba8a8483dc73d0103030afe46fc5bce51d8a0 fixes --- diff --git a/src/librarian/builders/html.py b/src/librarian/builders/html.py index f2177ae..ac6b0a7 100644 --- a/src/librarian/builders/html.py +++ b/src/librarian/builders/html.py @@ -240,6 +240,8 @@ class AbstraktHtmlBuilder(HtmlBuilder): def build(self, document, element=None, **kwargs): if element is None: element = document.tree.find('//abstrakt') + if element is None: + return OutputFile.from_bytes(b'') element.attrib['_force'] = '1' return super().build(document, element, **kwargs) diff --git a/src/librarian/builders/txt.py b/src/librarian/builders/txt.py index 28fe709..92ddb46 100644 --- a/src/librarian/builders/txt.py +++ b/src/librarian/builders/txt.py @@ -115,7 +115,7 @@ class TxtBuilder: for translator in meta.translators ) ) - builder.push_margin(2) + self.push_margin(2) if meta.isbn_txt: self.push_margin(2) diff --git a/src/librarian/elements/comments/abstrakt.py b/src/librarian/elements/comments/abstrakt.py index f54a455..b5bf8d6 100644 --- a/src/librarian/elements/comments/abstrakt.py +++ b/src/librarian/elements/comments/abstrakt.py @@ -9,7 +9,7 @@ class Abstrakt(WLElement): pass def html_build(self, builder): - if not self.attrib['_force']: + if not self.attrib.get('_force', False): return return super().html_build(builder)