From b997fc211b9d8eb1c592a5b28f55ff6522476c48 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Tue, 11 Mar 2008 22:11:42 +0000 Subject: [PATCH] Cleanup interface of BasePage.display_header and moving some attributes around. Also deleted some unused variables. * src/plugins/NarrativeWeb.py svn: r10271 --- src/plugins/NarrativeWeb.py | 97 ++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/src/plugins/NarrativeWeb.py b/src/plugins/NarrativeWeb.py index ddf0ecd7c..044cc2187 100644 --- a/src/plugins/NarrativeWeb.py +++ b/src/plugins/NarrativeWeb.py @@ -96,9 +96,11 @@ _HGAP = 30 _SHADOW = 5 _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. +# 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 = [ - + # First is used as default selection. [_("Basic - Ash"), 'NWeb-Screen_Basic-Ash.css'], [_("Basic - Cypress"), 'NWeb-Screen_Basic-Cypress.css'], [_("Basic - Lilac"), 'NWeb-Screen_Basic-Lilac.css'], @@ -110,6 +112,7 @@ _CSS_FILES = [ ] _CHARACTER_SETS = [ + # First is used as default selection. [_('Unicode (recommended)'), 'utf-8'], ['ISO-8859-1', 'iso-8859-1' ], ['ISO-8859-2', 'iso-8859-2' ], @@ -221,6 +224,11 @@ class BasePage: self.warn_dir = True self.cur_name = None # Internal use. The name of the output file, to be used for the tar archive. + self.author = get_researcher().get_name() + if self.author: + self.author = self.author.replace(',,,', '') + self.up = False + # TODO. All of these attributes are not necessary, because we have # als the options in self.options. Besides, we need to check which # are still required. @@ -290,8 +298,8 @@ class BasePage: self.cur_name = name + self.ext if self.archive: self.string_io = StringIO() - of = codecs.EncodedFile(self.string_io, 'utf-8', self.encoding, - 'xmlcharrefreplace') + of = codecs.EncodedFile(self.string_io, 'utf-8', + self.encoding, 'xmlcharrefreplace') else: page_name = os.path.join(self.html_dir, self.cur_name) of = codecs.EncodedFile(open(page_name, "w"), 'utf-8', @@ -371,7 +379,6 @@ class BasePage: of.write('\t\n') - elif self.copyright <=6: + elif self.copyright <= 6: of.write('\t