Example #1
0
 def _build_graph(self, req, tkt_id):
     links = TicketLinks(self.env, tkt_id)
     
     g = graphviz.Graph()
     
     node_default = g['node']
     node_default['style'] = 'filled'
     
     edge_default = g['edge']
     edge_default['style'] = ''
     
     # Force this to the top of the graph
     g[tkt_id] 
     
     links = sorted(links.walk(), key=lambda link: link.tkt.id)
     for link in links:
         tkt = link.tkt
         node = g[tkt.id]
         node['label'] = u'#%s'%tkt.id
         node['fillcolor'] = tkt['status'] == 'closed' and 'green' or 'red'
         node['URL'] = req.href.ticket(tkt.id)
         node['alt'] = u'Ticket #%s'%tkt.id
         node['tooltip'] = tkt['summary']
         
         for n in link.blocking:
             node > g[n]
     
     return g
Example #2
0
    def _build_graph(self, req, tkt_id):
        links = TicketLinks(self.env, tkt_id)

        g = graphviz.Graph()

        node_default = g['node']
        node_default['style'] = 'filled'

        edge_default = g['edge']
        edge_default['style'] = ''

        # Force this to the top of the graph
        g[tkt_id]

        links = sorted(links.walk(), key=lambda link: link.tkt.id)
        for link in links:
            tkt = link.tkt
            node = g[tkt.id]
            node['label'] = u'#%s' % tkt.id
            node['fillcolor'] = tkt['status'] == 'closed' and 'green' or 'red'
            node['URL'] = req.href.ticket(tkt.id)
            node['alt'] = u'Ticket #%s' % tkt.id
            node['tooltip'] = tkt['summary']

            for n in link.blocking:
                node > g[n]

        return g