Modify

Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#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)

plugin_usecond_0.12.patch (2.2 KB) - added by Mario 15 years ago.

Download all attachments as: .zip

Change History (6)

Changed 15 years ago by Mario

Attachment: plugin_usecond_0.12.patch added

comment:1 Changed 15 years ago by Mario

Type: defectenhancement

comment:2 Changed 15 years ago by Steffen Hoffmann

Summary: Patch for trac 0.12 microsecond feature[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 15 years ago by Ivan

Thanks! The patch helped me too for 0.12dev.

comment:4 Changed 14 years ago by Martin Scharrer

Resolution: fixed
Status: newclosed

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

comment:5 Changed 14 years ago by Martin Scharrer

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Martin Scharrer.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.