From a3b9d78c4469fbdb9d1ac2cfac35734ed27b41f1 Mon Sep 17 00:00:00 2001 From: Andrew Paseltiner Date: Fri, 21 Jun 2024 16:47:33 -0400 Subject: [PATCH] Disable M-035 for white-label productions Such productions may contain a colophon, but don't necessarily use the same identifier format as Standard Ebooks. Arguably all of these special-file checks could be disabled for white-label productions, but this one stands out as not applying. --- se/se_epub_lint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/se/se_epub_lint.py b/se/se_epub_lint.py index 543a59c8..5f432c75 100644 --- a/se/se_epub_lint.py +++ b/se/se_epub_lint.py @@ -1349,7 +1349,7 @@ def _lint_special_file_checks(self, filename: Path, dom: se.easy_xml.EasyXmlTree messages.append(LintMessage("s-016", "Incorrect [text]the[/] before Google Books link.", se.MESSAGE_TYPE_ERROR, filename, ["the
\n" + node.to_string() for node in nodes])) se_url = self.generated_identifier.replace("url:", "") - if not dom.xpath(f"/html/body//a[@href='{se_url}' and text()='{se_url.replace('https://', '')}']"): + if self.is_se_ebook and not dom.xpath(f"/html/body//a[@href='{se_url}' and text()='{se_url.replace('https://', '')}']"): messages.append(LintMessage("m-035", f"Unexpected S.E. identifier in colophon. Expected: [url]{se_url}[/].", se.MESSAGE_TYPE_ERROR, filename)) if self.metadata_dom.xpath("/package/metadata/meta[@property='role' and text()='trl']") and "translated from" not in file_contents: