From d425133e8e9c549f8fe90031272aee1d8d76ae26 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sat, 8 Mar 2008 11:30:59 +0000 Subject: [PATCH] Solved a problem with
  • ..
  • Reorganized the of.write() statements so that the text won't have multiple newlines in them. And introduced so for-loops instead of repetition of multiple lines of code. * src/plugins/NarrativeWeb.py svn: r10222 --- src/plugins/NarrativeWeb.py | 546 ++++++++++++++++++++---------------- 1 file changed, 300 insertions(+), 246 deletions(-) diff --git a/src/plugins/NarrativeWeb.py b/src/plugins/NarrativeWeb.py index 6591ebda3..acdf76c04 100644 --- a/src/plugins/NarrativeWeb.py +++ b/src/plugins/NarrativeWeb.py @@ -100,14 +100,14 @@ _XOFFSET = 5 #This information defines the list of styles in the Narrative Web options dialog as well as the location of the corresponding SCREEN stylesheets. _CSS_FILES = [ - [_("Basic - Ash"), 'NWeb-Screen_Basic-Ash.css'], - [_("Basic - Cypress"), 'NWeb-Screen_Basic-Cypress.css'], - [_("Basic - Lilac"), 'NWeb-Screen_Basic-Lilac.css'], - [_("Basic - Peach"), 'NWeb-Screen_Basic-Peach.css'], - [_("Basic - Spruce"), 'NWeb-Screen_Basic-Spruce.css'], - [_("Mainz"), 'NWeb-Screen_Mainz.css'], - [_("Nebraska"), 'NWeb-Screen_Nebraska.css'], - [_("No style sheet"), ''], + [_("Basic - Ash"), 'NWeb-Screen_Basic-Ash.css'], + [_("Basic - Cypress"), 'NWeb-Screen_Basic-Cypress.css'], + [_("Basic - Lilac"), 'NWeb-Screen_Basic-Lilac.css'], + [_("Basic - Peach"), 'NWeb-Screen_Basic-Peach.css'], + [_("Basic - Spruce"), 'NWeb-Screen_Basic-Spruce.css'], + [_("Mainz"), 'NWeb-Screen_Mainz.css'], + [_("Nebraska"), 'NWeb-Screen_Nebraska.css'], + [_("No style sheet"), ''], ] _CHARACTER_SETS = [ @@ -175,8 +175,8 @@ wrapper = TextWrapper() wrapper.break_log_words = True wrapper.width = 20 -#This list of characters defines which hexadecimal entity certain 'special characters' with be transformed into for valid HTML rendering. -#The variety of quotes with spaces are to assist in appropriately typesetting curly quotes and apostrophes. +# This list of characters defines which hexadecimal entity certain 'special characters' with be transformed into for valid HTML rendering. +# The variety of quotes with spaces are to assist in appropriately typesetting curly quotes and apostrophes. html_escape_table = { "&": "&", ' "': " “", @@ -189,7 +189,7 @@ html_escape_table = { ">": ">", "<": "<", } -#This command then defines the 'html_escape' option for escaping special characters for presentation in HTML based on the above list. +# This command then defines the 'html_escape' option for escaping special characters for presentation in HTML based on the above list. def html_escape(text): """Produce entities within text.""" L=[] @@ -264,8 +264,8 @@ class BasePage: self.photo_list[handle] = [lnk] ext = os.path.splitext(photo.get_path())[1] - real_path = "%s/%s" % (self.build_path(handle,'images'), handle+ext) - thumb_path = "%s/%s.png" % (self.build_path(handle,'thumb'), handle) + real_path = "%s/%s" % (self.build_path(handle, 'images'), handle+ext) + thumb_path = "%s/%s.png" % (self.build_path(handle, 'thumb'), handle) return (real_path,thumb_path) def create_file(self, name): @@ -320,16 +320,18 @@ class BasePage: return md5.new(text).hexdigest() def display_footer(self, of,db): - of.write('\n\n') of.write('