Modify ↓
Opened 12 years ago
Last modified 10 years ago
#10169 new enhancement
[PATCH] improve compatibility with Trac 0.12 / 1.0
Reported by: | Genie | Owned by: | |
---|---|---|---|
Priority: | high | Component: | TracMetrixPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.0 |
Description
Hi~, This is patch for Trac 0.12 / 1.0 compatibility.
-
tracmetrixplugin/web_ui.py
28 28 from trac.util.datefmt import to_datetime, utc 29 29 from trac.web import IRequestFilter, IRequestHandler, ITemplateStreamFilter 30 30 from trac.web.chrome import add_stylesheet, INavigationContributor, ITemplateProvider 31 from trac import __version__ 31 32 32 33 from tracmetrixplugin.model import ChangesetsStats, TicketGroupMetrics 33 34 … … 86 87 milestoneName = u"".join(e[1] for e in self.buffer.events) 87 88 title = "Go to TracMetrix for %s" % milestoneName 88 89 href = self.baseHref.mdashboard(milestoneName) 90 func = ( __version__ < '1.0') and tag.dd or tag.span # Trac >= 1.0dev 89 91 90 return iter( tag.dd('[', tag.a('TracMetrix', href=href, title=title), ']'))92 return iter( func('[', tag.a('TracMetrix', href=href, title=title), ']')) 91 93 92 94 93 95 … … 104 106 105 107 if filename in ('roadmap.html', ): 106 108 109 tag = ( __version__ < '0.12.1') and 'li' or 'div' # Trac >= 0.12.1 110 cls = ( __version__ < '1.0') and '' or ' trac-progress' # Trac >= 1.0dev 111 obj = ( __version__ < '1.0') and 'dl' or 'p[@class="legend"]' # Trac >= 1.0dev 112 107 113 buffer = StreamBuffer() 108 t = Transformer('// li[@class="milestone"]/div[@class="info"]/h2/a/em/text()')114 t = Transformer('//'+ tag +'[@class="milestone"]/div[@class="info'+ cls +'"]/h2/a/em/text()') 109 115 t = t.copy(buffer).end() 110 t = t.select('// li[@class="milestone"]/div[@class="info"]/dl')116 t = t.select('//'+ tag +'[@class="milestone"]/div[@class="info'+ cls +'"]/'+ obj) 111 117 t = t.append(GenerateMetrixLink(buffer, req.href)) 112 118 stream |= t 113 119 … … 125 131 126 132 if filename in ('milestone_view.html', ): 127 133 134 cls = ( __version__ < '1.0') and '' or ' trac-progress' # Trac >= 1.0dev 135 obj = ( __version__ < '1.0') and 'dl' or 'p[@class="legend"]' # Trac >= 1.0dev 136 128 137 buffer = StreamBuffer() 129 138 t = Transformer('//div[@class="milestone"]/h1/text()[2]') 130 139 t = t.copy(buffer).end() 131 t = t.select('//div[@class="milestone"]/div[@class="info "]/dl')140 t = t.select('//div[@class="milestone"]/div[@class="info'+ cls +'"]/'+ obj) 132 141 t = t.append(GenerateMetrixLink(buffer, req.href)) 133 142 stream |= t
Attachments (0)
Change History (6)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Roadmap(Milestone) view Layout has changed.
Trac >= 0.12.1:
. roadmap.html ( li[@class="milestone"] -> div[@class="milestone"] )
comment:3 Changed 12 years ago by
comment:4 Changed 12 years ago by
Priority: | normal → high |
---|---|
Status: | new → assigned |
comment:5 Changed 12 years ago by
Status: | assigned → new |
---|
comment:6 Changed 10 years ago by
Owner: | Ryan J Ollos deleted |
---|
Note: See
TracTickets for help on using
tickets.
Thanks for the patch! Could you give a brief explanation of what the patch accomplishes or the changes in 0.12/1.0 that you are trying to address?