Changeset 4594

Show
Ignore:
Timestamp:
10/26/08 23:57:25 (2 months ago)
Author:
roadrunner
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • hudsontracplugin/0.10/HudsonTrac/HudsonTracPlugin.py

    r4593 r4594  
    77import calendar 
    88import feedparser 
     9import urllib 
    910from datetime import datetime 
    1011from trac.core import * 
     
    9091                href = entry.link 
    9192                title = entry.title 
    92                 comment = message + ' at ' + format_datetime(completed) 
     93 
     94                url = href + '/api/json' 
     95                line = urllib.urlopen(url).readline() 
     96                json = eval(line.replace('false', 'False').replace('true','True').replace('null', 'None')) 
     97 
     98                if json['description'] == None: 
     99                    comment = message + ' at ' + format_datetime(completed) 
     100                else: 
     101                    comment = unicode(json['description'], 'utf-8') + ' at ' + format_datetime(completed) 
    93102 
    94103                yield kind, href, title, completed, None, comment