Edgewall Software

Ticket #7211: workflow_parser.py.patch

File workflow_parser.py.patch, 1.2 KB (added by scottb@…, 4 years ago)

Patch to add resolution states to diagrams

  • Z:\workflow_parser.py

    old new  
    4343        return self.coloruse.index(min(self.coloruse)) 
    4444 
    4545def actions2graphviz(actions, show_ops=False, show_perms=False): 
    4646    """Returns a list of lines to be fed to graphviz.""" 
    4747    # The size value makes it easier to create a useful printout. 
    4848    color_scheme = ColorScheme() 
    49     digraph_lines = ['digraph G {\nrotate=90\ncenter=1\nsize="10,8"\n'] 
     49    digraph_lines = ['digraph G {\ncenter=1\nsize="10,8"\n'] 
    5050    for action, attributes in actions.items(): 
    5151        label = [attributes['name'], ] 
    5252        if show_ops: 
    5353            label += attributes['operations'] 
    5454        if show_perms: 
    5555            label += attributes['permissions'] 
     56        if 'set_resolution' in attributes: 
     57            label += ['(' + attributes['set_resolution'] + ')'] 
    5658        for oldstate in attributes['oldstates']: 
    5759            color = color_scheme.get_color(attributes['name']) 
    5860            digraph_lines.append( 
    5961                '"%s" -> "%s" [label="%s" color=%s fontcolor=%s]\n' % \ 
    6062                (oldstate, attributes['newstate'], '\\n'.join(label), color, 
    6163                 color))