Commits

roadrunner  committed 06065f0

[svn r4594] Added support for displaying build description instead of generic
"Build succesfully completed" message. Thanks to akihirox for the original
patch. This closes #3377.

  • Participants
  • Parent commits 6701a6d

Comments (0)

Files changed (1)

File 0.10/HudsonTrac/HudsonTracPlugin.py

 import time
 import calendar
 import feedparser
+import urllib
 from datetime import datetime
 from trac.core import *
 from trac.config import Option, BoolOption
 
                 href = entry.link
                 title = entry.title
-                comment = message + ' at ' + format_datetime(completed)
+
+                url = href + '/api/json'
+                line = urllib.urlopen(url).readline()
+                json = eval(line.replace('false', 'False').replace('true','True').replace('null', 'None'))
+
+                if json['description'] == None:
+                    comment = message + ' at ' + format_datetime(completed)
+                else:
+                    comment = unicode(json['description'], 'utf-8') + ' at ' + format_datetime(completed)
 
                 yield kind, href, title, completed, None, comment