> Anyone got a quick patch for workflow_parser.py (that's the code that
> converts a Trac Workflow into a pretty picture) that includes the
> resolution state in the titles for closed ticket transitions?
To answer my own question, here's what I ended up changing in
workflow_parser.py:
def actions2graphviz(actions, show_ops=False, show_perms=False):
"""Returns a list of lines to be fed to graphviz."""
# The size value makes it easier to create a useful printout.
color_scheme = ColorScheme()
digraph_lines = ['digraph G {\ncenter=1\nsize="10,8"\n']
for action, attributes in actions.items():
label = [attributes['name'], ]
if show_ops:
label += attributes['operations']
if show_perms:
label += attributes['permissions']
if 'set_resolution' in attributes:
label += ['(' + attributes['set_resolution'] + ')']
for oldstate in attributes['oldstates']:
color = color_scheme.get_color(attributes['name'])
digraph_lines.append(
'"%s" -> "%s" [label="%s" color=%s fontcolor=%s]\n' %
\
(oldstate, attributes['newstate'], '\\n'.join(label),
color,
color))
digraph_lines.append('}\n')
return digraph_lines
Basically I removed the "rotate" command from the initial 'Digraph' so
that the image came out right-side up (I'm not sure why you'd want it
rotated in the first place) and then added a couple of lines to add
the set_resolution state to the diagram (if it exists).
I find this useful -- perhaps somebody else will too.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---