Modify

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#6922 closed enhancement (fixed)

[patch] support for trac 0.12 microsecond feature

Reported by: mwehr Owned by: martin_s
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)

plugin_usecond_0.12.patch (2.2 KB) - added by mwehr 5 years ago.

Download all attachments as: .zip

Change History (6)

Changed 5 years ago by mwehr

comment:1 Changed 5 years ago by mwehr

  • Type changed from defect to enhancement

comment:2 Changed 5 years ago by hasienda

  • Summary changed from Patch for trac 0.12 microsecond feature to [patch] support for trac 0.12 microsecond feature

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.

comment:3 Changed 4 years ago by Drops

Thanks! The patch helped me too for 0.12dev.

comment:4 Changed 4 years ago by martin_s

  • Resolution set to fixed
  • Status changed from new to closed

(In [7973]) tracwatchlist/plugin.py:: Applied patch plugin_usecond_0.12.patch from #6922. Fixes #6922.

comment:5 Changed 4 years ago by martin_s

Thanks for the patch. I created a 0.12 branch and included the patch.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.