Modify ↓
#6922 closed enhancement (fixed)
[patch] support for trac 0.12 microsecond feature
Reported by: | Mario | Owned by: | Martin Scharrer |
---|---|---|---|
Priority: | normal | Component: | WatchlistPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description
This is a patch for getting the WatchPlugin working with trac 0.12
--- ./plugin1.py Sat Apr 03 17:20:18 2010 +++ ./plugin.py Sat Apr 03 16:56:17 2010 @@ -26,6 +26,7 @@ from trac.env import IEnvironmentSetupParticipant from trac.util import format_datetime, pretty_timedelta +from trac.util.datefmt import from_utimestamp, to_utimestamp from trac.web.chrome import INavigationContributor from trac.web.api import IRequestFilter, IRequestHandler, RequestDone from trac.web.chrome import ITemplateProvider, add_ctxtnav, add_link, add_script, add_notice @@ -38,6 +39,7 @@ from trac.wiki.model import WikiPage from trac.ticket.model import Ticket + __DB_VERSION__ = 3 class WatchlistError(TracError): @@ -347,9 +349,9 @@ 'name' : name, 'author' : author, 'version' : version, - 'datetime' : format_datetime( time ), - 'timedelta' : pretty_timedelta( time ), - 'timeline_link' : timeline_link( time ), + 'datetime' : from_utimestamp( time ), + 'timedelta' : pretty_timedelta( from_utimestamp(time) ), + 'timeline_link' : timeline_link( from_utimestamp(time) ), 'comment' : comment, 'notify' : notify, }) @@ -426,9 +428,9 @@ 'author' : author, 'commentnum': to_unicode(self.commentnum), 'comment' : len(self.comment) <= 250 and self.comment or self.comment[:250] + '...', - 'datetime' : format_datetime( changetime ), - 'timedelta' : pretty_timedelta( changetime ), - 'timeline_link' : timeline_link( changetime ), + 'datetime' : from_utimestamp( changetime ), + 'timedelta' : pretty_timedelta( from_utimestamp( changetime ) ), + 'timeline_link' : timeline_link( from_utimestamp( changetime ) ), 'changes' : changes, 'summary' : summary, 'notify' : notify,
have fun
regards
Mario
Attachments (1)
Change History (6)
Changed 15 years ago by
Attachment: | plugin_usecond_0.12.patch added |
---|
comment:1 Changed 15 years ago by
Type: | defect → enhancement |
---|
comment:2 Changed 15 years ago by
Summary: | Patch for trac 0.12 microsecond feature → [patch] support for trac 0.12 microsecond feature |
---|
comment:4 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:5 Changed 14 years ago by
Thanks for the patch. I created a 0.12 branch and included the patch.
Note: See
TracTickets for help on using
tickets.
Thanks a lot for this. I recently upgraded past r9210, where this change was done. Actually now on r9443, and this is required for the plugin to continue it's work. So it's actually both, an enhancement to the plugin, a fixed defect to the user.