# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1239809006 -7200 # Node ID 3acc823121b6366fe2ae1db5e05abffe0c079fe3 # Parent d8f2c3953eb5b139e05b52eac83142bf7da72eeb can't compare date and datetime diff -r d8f2c3953eb5 -r 3acc823121b6 web/views/wdoc.py --- a/web/views/wdoc.py Wed Apr 15 17:22:57 2009 +0200 +++ b/web/views/wdoc.py Wed Apr 15 17:23:26 2009 +0200 @@ -16,7 +16,7 @@ from cubicweb.selectors import match_form_params from cubicweb.view import StartupView -from cubicweb.utils import strptime +from cubicweb.utils import strptime, todate from cubicweb.common.uilib import rest_publish from cubicweb.web import NotFound @@ -192,6 +192,7 @@ title = self.req._(self.title) restdata = ['.. -*- coding: utf-8 -*-', '', title, '='*len(title), ''] w = restdata.append + today = date.today() for fpath in self.config.locate_all_files(rid): cl = ChangeLog(fpath) encoding = 'utf-8' @@ -205,9 +206,9 @@ w(unicode(line, encoding)) for entry in cl.entries: if entry.date: - edate = strptime(entry.date, '%Y-%m-%d') + edate = todate(strptime(entry.date, '%Y-%m-%d')) else: - edate = date.today() + edate = today messages = [] for msglines, submsgs in entry.messages: msgstr = unicode(' '.join(l.strip() for l in msglines), encoding) @@ -225,7 +226,7 @@ fdate = self.format_date(edate) w(u'\n%s' % fdate) w('~' * len(fdate)) - latestdate = date + latestdate = edate for msg in messages: w(u'* %s' % msg) i += 1