From 43a1f64baec49c267bc95874054f309826e9737e Mon Sep 17 00:00:00 2001 From: Robert Tonsing Date: Sat, 14 Jan 2023 06:09:30 -0600 Subject: [PATCH 1/2] Implement new PG HTML field format --- pphtml.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/pphtml.py b/pphtml.py index 803afde..b613fe8 100644 --- a/pphtml.py +++ b/pphtml.py @@ -64,7 +64,7 @@ class initialization self.sdir = "" # to find the images self.encoding = "" self.NOW = strftime("%A, %Y-%m-%d %H:%M:%S") - self.VERSION = "2022.12.28" + self.VERSION = "2023.01.14" self.onlyfiles = [] # list of files in images folder self.filedata = [] # string of image file information self.fsizes = [] # image tuple sorted by decreasing size @@ -749,17 +749,7 @@ def h1Title(self): if "Gutenberg" not in t3: r.append("[☰warn☷] title should be of the form") - r.append( - " The Project Gutenberg eBook of Alice's Adventures in Wonderland," - + " by Lewis Carroll" - ) - # avoid trap in WWer's software (addhd.c) - if "end" not in t3: - r.append(" or") - r.append( - " Alice's Adventures in Wonderland, by Lewis Carroll—A" - + " Project Gutenberg eBook" - ) + r.append(" Alice's Adventures in Wonderland | Project Gutenberg") if t3.endswith("."): r.append(" Information: title ends with full stop") self.apl(r) From d32e6fd2d4a0be2b71a78ff1f8a6c21387217519 Mon Sep 17 00:00:00 2001 From: Robert Tonsing <rtsweng-sw@yahoo.com> Date: Sat, 14 Jan 2023 10:09:44 -0600 Subject: [PATCH 2/2] Check for new title format --- pphtml.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pphtml.py b/pphtml.py index b613fe8..29a4176 100644 --- a/pphtml.py +++ b/pphtml.py @@ -747,11 +747,9 @@ def h1Title(self): r.append(" title: {}".format(t3)) r.append(" h1: {}".format(t4)) - if "Gutenberg" not in t3: + if not t3.endswith(" | Project Gutenberg"): r.append("[☰warn☷] title should be of the form") r.append(" Alice's Adventures in Wonderland | Project Gutenberg") - if t3.endswith("."): - r.append(" Information: title ends with full stop") self.apl(r) def langCheck(self):