Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Trac: Users

Displaying closed resolutions in workflow_parser.py?

 

 

Trac users RSS feed   Index | Next | Previous | View Threaded


scottb at opto-pps

May 2, 2008, 2:15 PM

Post #1 of 7 (120 views)
Permalink
Displaying closed resolutions in workflow_parser.py?

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?

For example in the first image on http://trac.edgewall.org/wiki/TracWorkflow
(the original workflow for Trac) there are 3 lines all marked
"resolve". It'd be nice if it included the resolutions (like wontfix,
duplicate, fixed, etc.) for those cases. Otherwise it's a pretty graph
but you can't really tell what's going on.

For instance, in the graph for my workflow there are 3 parallel lines
from "new" to "closed". They look the same on the graph (they just say
"Close Ticket"), but they're for "wontfix", "fixed", and "worksforme".
It'd be nice if the lines were each different and said something like
"Close Ticket (wontfix)".

Thanks for any help!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users[at]googlegroups.com
To unsubscribe from this group, send email to trac-users-unsubscribe[at]googlegroups.com
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


scottb at opto-pps

May 4, 2008, 1:24 PM

Post #2 of 7 (107 views)
Permalink
Re: Displaying closed resolutions in workflow_parser.py? [In reply to]

> 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 trac-users[at]googlegroups.com
To unsubscribe from this group, send email to trac-users-unsubscribe[at]googlegroups.com
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


chris at reemergemedia

May 5, 2008, 4:11 AM

Post #3 of 7 (104 views)
Permalink
Re: Displaying closed resolutions in workflow_parser.py? [In reply to]

Scott,

I find this very useful. Was going to chime in early, but didn't have
much to say other than, yea, this is a good idea. I'll let you know
how it goes for me.

Chris

On May 4, 4:24 pm, Scott Bussinger <sco...@opto-pps.com> wrote:
> > 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 trac-users[at]googlegroups.com
To unsubscribe from this group, send email to trac-users-unsubscribe[at]googlegroups.com
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


chris at reemergemedia

May 6, 2008, 7:10 AM

Post #4 of 7 (99 views)
Permalink
Re: Displaying closed resolutions in workflow_parser.py? [In reply to]

Scott,

I used your modified version from above and processed all the sample
workflows. Being able to see them visually like this is awesome.
Perfect for the rest of the team and management to visualize the
process. Not to mention it makes it easier to modify them if you're
new to configuring your own workflow.

Thanks!
Chris

On May 4, 4:24 pm, Scott Bussinger <sco...@opto-pps.com> wrote:
> > 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 trac-users[at]googlegroups.com
To unsubscribe from this group, send email to trac-users-unsubscribe[at]googlegroups.com
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


retracile at gmail

May 6, 2008, 8:17 PM

Post #5 of 7 (101 views)
Permalink
Re: Displaying closed resolutions in workflow_parser.py? [In reply to]

On Sunday 04 May 2008 03:24:04 pm Scott Bussinger wrote:
> > 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.

If you don't mind, could you file an enhancement ticket, attach a patch to it,
and assign it to me? That will keep this from getting lost. :)

As for the rotate, IIRC, I was sending it to a pdf, and the rotate undid a
rotation that output format was doing for no obvious reason.

The scripts in the contrib/workflow directory are more... "guidelines" than
real code. ;)

Eli
------------------. "If it ain't broke now,
Eli Carter \ it will be soon." -- crypto-gram
retracile[at]gmail.com `-------------------------------------------------

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users[at]googlegroups.com
To unsubscribe from this group, send email to trac-users-unsubscribe[at]googlegroups.com
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


scottb at opto-pps

May 8, 2008, 11:37 AM

Post #6 of 7 (94 views)
Permalink
Re: Displaying closed resolutions in workflow_parser.py? [In reply to]

> If you don't mind, could you file an enhancement ticket, attach a patch to it,
> and assign it to me?  That will keep this from getting lost. :)

Hi Eli,

I think I got it entered right. It's ticket #7211 and I attempted to
assign it to you (hopefully I got the right username). I attached a
patch file, but I'm not particularly familiar with patch files so
hopefully it's the correct format (I used Beyond Compare to create the
patch file and it supports 4 different patch file formats). Let me
know if it doesn't make sense and I'll post the changes themselves (as
you saw, it's just a couple of lines of code).

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users[at]googlegroups.com
To unsubscribe from this group, send email to trac-users-unsubscribe[at]googlegroups.com
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


retracile at gmail

May 8, 2008, 5:05 PM

Post #7 of 7 (94 views)
Permalink
Re: Displaying closed resolutions in workflow_parser.py? [In reply to]

On Thursday 08 May 2008 01:37:54 pm Scott Bussinger wrote:
> > If you don't mind, could you file an enhancement ticket, attach a patch
> > to it, and assign it to me?  That will keep this from getting lost. :)
>
> Hi Eli,
>
> I think I got it entered right. It's ticket #7211 and I attempted to
> assign it to you (hopefully I got the right username). I attached a
> patch file, but I'm not particularly familiar with patch files so
> hopefully it's the correct format (I used Beyond Compare to create the
> patch file and it supports 4 different patch file formats). Let me
> know if it doesn't make sense and I'll post the changes themselves (as
> you saw, it's just a couple of lines of code).

Looks fine.

Thanks,

Eli
------------------. "If it ain't broke now,
Eli Carter \ it will be soon." -- crypto-gram
retracile[at]gmail.com `-------------------------------------------------

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users[at]googlegroups.com
To unsubscribe from this group, send email to trac-users-unsubscribe[at]googlegroups.com
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Trac users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.