From 2472d94621f3bc3d376814b2f05193fa322e0a37 Mon Sep 17 00:00:00 2001 From: "Rob G. Healey" Date: Tue, 10 Feb 2009 01:38:08 +0000 Subject: [PATCH] Removed partial year from WebCal. Clean up and documenting for PEP compliance of 8.36 svn: r11944 --- src/plugins/webreport/WebCal.py | 144 ++++++++++++++------------------ 1 file changed, 65 insertions(+), 79 deletions(-) diff --git a/src/plugins/webreport/WebCal.py b/src/plugins/webreport/WebCal.py index 197f276d5..ba044d158 100644 --- a/src/plugins/webreport/WebCal.py +++ b/src/plugins/webreport/WebCal.py @@ -196,7 +196,6 @@ class WebCalReport(Report): self.country = menu.get_option_by_name('country').get_value() self.start_dow = menu.get_option_by_name('start_dow').get_value() - self.partyear = menu.get_option_by_name('partyear').get_value() self.multiyear = menu.get_option_by_name('multiyear').get_value() self.start_year = menu.get_option_by_name('start_year').get_value() @@ -232,9 +231,6 @@ class WebCalReport(Report): self.author = self.author.replace(',,,', '') self.email = researcher.email - self.start_month = 1 # set to January, and it can change - self.end_month = 12 # set to December, this value never changes - today = time.localtime() # set to today's date self.today = datetime.date(today[0], today[1], today[2]) @@ -375,7 +371,7 @@ class WebCalReport(Report): if use_home: navs.append((self.home_link, _('Home'), True)) - for month in range(self.start_month, self.end_month + 1): + for month in range(1, 13): navs.append((month, month, True)) # Add a link for year_glance() if requested @@ -386,7 +382,7 @@ class WebCalReport(Report): for url_fname, nav_text, cond in navs: url = '' - cs = False + currentsection = False if cond: subdirs = ['..'] * nr_up @@ -394,14 +390,14 @@ class WebCalReport(Report): # Note. We use '/' here because it is a URL, not a OS dependent pathname if type(url_fname) == int: - url_fname = _get_full_month_name(url_fname) + url_fname = get_full_month_name(url_fname) if type(nav_text) == int: - nav_text = _get_short_month_name(nav_text) + nav_text = get_short_month_name(nav_text) # Figure out if we need
  • or just plain
  • if url_fname == currentsection: - cs = True + currentsection = True url = url_fname if not url.startswith('http:'): @@ -409,8 +405,12 @@ class WebCalReport(Report): if not url.endswith(self.ext): url += self.ext - cs = cs and ' id="CurrentSection"' or '' - of.write('\t\t%s
  • \n' % (cs, url, nav_text)) + if currentsection: + section = ' id="CurrentSection"' + else: + section = '' + of.write('\t\t%s\n' + % (section, url, nav_text)) of.write('\t\n') of.write('\n\n') @@ -428,21 +428,17 @@ class WebCalReport(Report): of.write('\t