From 82dabaaeb1d39ce7314b2468058a7778865ece67 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Mon, 11 Aug 2008 20:19:51 +0000 Subject: [PATCH] Solved an issue with konqueror, which was in fact incorrect HTML that is kindly accepted by all other browsers. Moved calendar.setfirstweekday so that it is set only once. * src/plugins/WebCal.py svn: r10978 --- src/plugins/WebCal.py | 54 ++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 31 deletions(-) diff --git a/src/plugins/WebCal.py b/src/plugins/WebCal.py index d2bf34b69..cd1815ca1 100644 --- a/src/plugins/WebCal.py +++ b/src/plugins/WebCal.py @@ -216,7 +216,7 @@ class WebCalReport(Report): self.birthday = menu.get_option_by_name('birthdays').get_value() self.anniv = menu.get_option_by_name('anniversaries').get_value() self.title_text = menu.get_option_by_name('title').get_value() - self.home_link = menu.get_option_by_name('home_link').get_value() + self.home_link = menu.get_option_by_name('home_link').get_value().strip() self.month_notes = [menu.get_option_by_name('note_jan').get_value(), menu.get_option_by_name('note_feb').get_value(), @@ -234,6 +234,8 @@ class WebCalReport(Report): self.warn_dir = True # Only give warning once. self.has_arrow_gif = False # Set to True after copying to destination + calendar.setfirstweekday(_dow_gramps2iso[self.start_dow]) + def copy_file(self, from_fname, to_fname, to_dir=''): """ Copy a file from a source to a (report) destination. @@ -422,9 +424,6 @@ class WebCalReport(Report): year = self.year - # This calendar has first column sunday. Do not use locale! - calendar.setfirstweekday(_dow_gramps2iso[start_dow]) - # monthinfo is filled using standard Python library calendar.monthcalendar # It fills a list of 7-day-lists. The first day of the 7-day-list is # determined by calendar.firstweekday @@ -443,7 +442,7 @@ class WebCalReport(Report): of.write(' \n') for day_col in range(7): dayclass = get_class_for_daycol(day_col) - of.write(' %s\n' % (dayclass, get_name_for_daycol(day_col))) + of.write(' %s\n' % (dayclass, get_name_for_daycol(day_col))) of.write(' \n') of.write(' \n') @@ -452,12 +451,8 @@ class WebCalReport(Report): # Compute the first day to display for this month. # It can also be a day in the previous month. - # Count number of days in first 7-day-list of monthinfo. current_date = datetime.date(year, month, 1) # first day of the month - current_ord = current_date.toordinal() - for i in range(7): - if monthinfo[0][i] == 0: - current_ord = current_ord - 1 + current_ord = current_date.toordinal() - monthinfo[0].count(0) # get last month's last week for previous days in the month if month == 1: @@ -558,8 +553,7 @@ class WebCalReport(Report): of.write(' \n' % self.encoding) of.write(' \n') - of.write(' \n') + of.write(' \n') author = get_researcher().get_name() of.write(' \n' % author) @@ -704,10 +698,9 @@ class WebCalReport(Report): of.write('