Trac, Watchlist plugin support for trac 0.12 microsecond feature

This is a patch for getting the WatchPlugin working with trac 0.12.

01+++ ./plugin.py    Sat Apr 03 16:56:17 2010
02@@ -26,6 +26,7 @@
03 
04 from  trac.env         import  IEnvironmentSetupParticipant
05 from  trac.util        import  format_datetime, pretty_timedelta
06+from trac.util.datefmt import  from_utimestamp, to_utimestamp
07 from  trac.web.chrome  import  INavigationContributor
08 from  trac.web.api     import  IRequestFilter, IRequestHandler, RequestDone
09 from  trac.web.chrome  import  ITemplateProvider, add_ctxtnav, add_link, add_script, add_notice
10@@ -38,6 +39,7 @@
11 from  trac.wiki.model  import  WikiPage
12 from  trac.ticket.model import Ticket
13 
14+
15 __DB_VERSION__ = 3
16 
17 class WatchlistError(TracError):
18@@ -347,9 +349,9 @@
19 'name' : name,
20 'author' : author,
21 'version' : version,
22-                        'datetime' : format_datetime( time ),
23-                        'timedelta' : pretty_timedelta( time ),
24-                        'timeline_link' : timeline_link( time ),
25+                        'datetime' : from_utimestamp( time ),
26+                        'timedelta' : pretty_timedelta( from_utimestamp(time) ),
27+                        'timeline_link' : timeline_link( from_utimestamp(time) ),
28 'comment' : comment,
29 'notify'  : notify,
30 })
31@@ -426,9 +428,9 @@
32 'author' : author,
33 'commentnum': to_unicode(self.commentnum),
34 'comment' : len(self.comment) <= 250 and self.comment or self.comment[:250] + '...',
35-                        'datetime' : format_datetime( changetime ),
36-                        'timedelta' : pretty_timedelta( changetime ),
37-                        'timeline_link' : timeline_link( changetime ),
38+                        'datetime' : from_utimestamp( changetime ),
39+                        'timedelta' : pretty_timedelta( from_utimestamp( changetime ) ),
40+                        'timeline_link' : timeline_link( from_utimestamp( changetime ) ),
41 'changes' : changes,
42 'summary' : summary,
43 'notify'  : notify,

This patch applies to rev 7710, you can download the patch from trac-Hacks

Have fun 🙂

(Visited 166 times, 1 visits today)

One thought on “Trac, Watchlist plugin support for trac 0.12 microsecond feature”

Leave a Reply to webagentur Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.