Changeset 438 in main


Ignore:
Timestamp:
11/02/11 14:16:29 (8 years ago)
Author:
pcosquer
Message:

lifecycle: remove unused method 'draw_graph'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openPLM/plmapp/lifecycle.py

    r261 r438  
    4747        lifecycles[name] = LifecycleList(name, "official", *cycles) 
    4848""" 
    49  
    50 try: 
    51     import pygraphviz as pgv 
    52 except ImportError: 
    53     print "ImportError : Please install pygraphviz." 
    54     print "It's used to generate graphes from lifecycle" 
    5549 
    5650 
     
    136130        return self[index - 1] 
    137131 
    138     def draw_graph(self, current_state, output_path, 
    139                    normal_color="#7a7af8", current_color="#0808fa"): 
    140         u""" 
    141         Draws a graph (with pygraphviz) of the lifecycle.  
    142  
    143         :param current_state: current state to highlight, may be empty 
    144         :type cuurent_state: str 
    145         :param output_path: pathname of the generated png 
    146         :type output_path: str 
    147         :param normal_color: fill color of normal states 
    148         :type normal_color: an html color (like ``cyan`` or ``#110011``) 
    149         :param current_color: fill color of current state 
    150         :type current_color: an html color (like ``cyan`` or ``#110011``) 
    151  
    152         """ 
    153         graph = pgv.AGraph(directed=True) 
    154         graph.graph_attr["rankdir"] = "LR" 
    155         graph.graph_attr["bgcolor"] = "#00000000" # transparent 
    156         graph.node_attr["style"] = "filled" 
    157         graph.node_attr["fillcolor"] = normal_color 
    158         graph.add_edges_from(zip(self, self[1:])) 
    159         if current_state: 
    160             node = graph.get_node(current_state) 
    161             node.attr["fillcolor"] = current_color 
    162         graph.draw(path=output_path, format="png", prog="dot") 
    163132 
    164133if __name__ == "__main__": 
Note: See TracChangeset for help on using the changeset viewer.