Changeset 4134
- Timestamp:
- 08/12/08 11:34:35 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
detailedrssfeedplugin/ReportToDetailedRSS/ReportToDetailedRSS.py
r4133 r4134 40 40 'application/rss+xml', 'rss') 41 41 return handler 42 42 43 43 # for ClearSilver templates 44 44 def post_process_request(self, req, template, content_type): … … 46 46 unchanged.""" 47 47 return (template, content_type) 48 48 49 49 # for Genshi templates 50 50 def post_process_request(self, req, template, data, content_type): … … 52 52 values to the template `data` dictionary, or changing template or 53 53 mime type. 54 55 Always returns a tuple of (template, data, content_type), even if56 unchanged.57 54 """ 58 55 59 56 if template == "report.rss" and req.args.get('detailed','false') == 'true': 57 self.env.log.debug("Detailed Feed Requested.") 60 58 return self.intercept_report_rss(req,data) 61 59 return (template, data, content_type) … … 77 75 ticket_ids = set() 78 76 ticket_ids.update([row['resource'].id for (_, row_group) in data['row_groups'] for row in row_group]) 77 self.env.log.debug("Tickets in Report: %s" % ticket_ids) 79 78 80 79 #generate data based on the headers and the ticket ids … … 89 88 90 89 idstring = ','.join([str(s) for s in ticket_ids]) 91 limit = self.config.getint('report','items_per_page_rss',0) 90 91 #if their limit is set to '0', sqlite will return 0 rows. thus, make it -1 instead 92 limit = self.config.getint('report','items_per_page_rss',-1) or -1 92 93 93 94 #all the fields starting with 'tc_' will get printed for *all* changes. … … 135 136 else: 136 137 items[rowAsDict['id']] = {rowAsDict['changetime']:[rowAsDict]} 137 138 self.env.log.debug('Tickets in Feed: %s' % items.values()) 138 139 #because we're using our own template, we can just blow away the current data structure 139 140 # - keep the report's title, and description, and, uh, report (report is a dictionary that has an id and a resource object pointing to the report) 140 for key in data.keys(): 141 if key not in ('title','description','report','context'): 142 del(data[key]) 143 data['items'] = items 141 # - context lets us use wiki_to_html 142 data = {'items':items, 143 'title':data['title'], 144 'description':data['description'], 145 'report':data['report'], 146 'context':data['context']} 144 147 145 148 return ('detailedrss.rss',data,'application/rss+xml') detailedrssfeedplugin/ReportToDetailedRSS/templates/detailedrss.rss
r4114 r4134 1 1 <?xml version="1.1"?> 2 <?xml-stylesheet type="text/css" href="http://localhost/trac/chrome/common/css/ticket.css"?>3 2 <rss version="2.0" xmlns:py="http://genshi.edgewall.org/" 4 3 xmlns:xi="http://www.w3.org/2001/XInclude">
