)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9453,"name":"James Polley","email":"jp@jamezpolley.com","username":"tchaypo"},"change_message_id":"f0310caf41857e7a4784613dc56cf6ecccfa13d3","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add optional machine conversion into a pydot graph"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Both ironic and taskflow share this same code to convert"},{"line_number":10,"context_line":"there state machines into a pydot graph which then gets"},{"line_number":11,"context_line":"converted into SVG to form:"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"- http://docs.openstack.org/developer/taskflow/states.html"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa32b979_706367b2","line":10,"updated":"2015-06-15 00:27:23.000000000","message":"Nit: s/there/their (not worth a new revision just for this)","commit_id":"502c7ed0c5a35f69621d96ebf7a995ebde85cb61"}],"automaton/formatters.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"19616cda36203c857c94e6a7693ce68e5158a28b","unresolved":false,"context_lines":[{"line_number":24,"context_line":"def to_pydot(machine, graph_name,"},{"line_number":25,"context_line":"             graph_attrs\u003dNone, node_attrs_cb\u003dNone, edge_attrs_cb\u003dNone,"},{"line_number":26,"context_line":"             add_start_state\u003dTrue):"},{"line_number":27,"context_line":"    \"\"\"Translates the state machine into a pydot graph.\"\"\""},{"line_number":28,"context_line":"    if not PYDOT_AVAILABLE:"},{"line_number":29,"context_line":"        raise RuntimeError(\"pydot (or pydot2 or equivalent) is required\""},{"line_number":30,"context_line":"                           \" to convert a state machine into a pydot\""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_e697fa37","line":27,"updated":"2015-06-18 15:49:36.000000000","message":"it would be nice to have descriptions of the parameters and what is returned.","commit_id":"b2d71a49fdc0b0c8ab0903a591721993dcc5438a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"19616cda36203c857c94e6a7693ce68e5158a28b","unresolved":false,"context_lines":[{"line_number":61,"context_line":"            if node_attrs_cb is not None:"},{"line_number":62,"context_line":"                end_node_attrs.update(node_attrs_cb(end_state))"},{"line_number":63,"context_line":"            nodes[end_state] \u003d pydot.Node(end_state, **end_node_attrs)"},{"line_number":64,"context_line":"            g.add_node(nodes[end_state])"},{"line_number":65,"context_line":"        edge_attrs \u003d {}"},{"line_number":66,"context_line":"        if edge_attrs_cb is not None:"},{"line_number":67,"context_line":"            edge_attrs.update(edge_attrs_cb(start_state, event, end_state))"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_a6b33297","line":64,"updated":"2015-06-18 15:49:36.000000000","message":"don\u0027t know if it is worth it, but these two ifs (start_state \u0026 end_state) are quite similar; could put in a method\n\nAlso, start_node_attrs \u0026 end_node_attrs will always be the same, won\u0027t it? If so, only need to generate it once, outside the for loop.","commit_id":"b2d71a49fdc0b0c8ab0903a591721993dcc5438a"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"31efc8f0586d79347feef8aa157d83a26e6961f4","unresolved":false,"context_lines":[{"line_number":61,"context_line":"            if node_attrs_cb is not None:"},{"line_number":62,"context_line":"                end_node_attrs.update(node_attrs_cb(end_state))"},{"line_number":63,"context_line":"            nodes[end_state] \u003d pydot.Node(end_state, **end_node_attrs)"},{"line_number":64,"context_line":"            g.add_node(nodes[end_state])"},{"line_number":65,"context_line":"        edge_attrs \u003d {}"},{"line_number":66,"context_line":"        if edge_attrs_cb is not None:"},{"line_number":67,"context_line":"            edge_attrs.update(edge_attrs_cb(start_state, event, end_state))"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_4c7fe7df","line":64,"in_reply_to":"fa32b979_a6b33297","updated":"2015-06-18 16:13:13.000000000","message":"Probably could be a mini-method.\n\nAs far as being the same, that\u0027s up to the provided `node_attrs_cb` (callback) to decide.","commit_id":"b2d71a49fdc0b0c8ab0903a591721993dcc5438a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"19616cda36203c857c94e6a7693ce68e5158a28b","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        start \u003d pydot.Node(\"__start__\", shape\u003d\"point\", width\u003d\"0.1\","},{"line_number":72,"context_line":"                           xlabel\u003d\u0027start\u0027, fontcolor\u003d\u0027green\u0027, **node_attrs)"},{"line_number":73,"context_line":"        g.add_node(start)"},{"line_number":74,"context_line":"        g.add_edge(pydot.Edge(start, nodes[machine.default_start_state],"},{"line_number":75,"context_line":"                              style\u003d\u0027dotted\u0027))"},{"line_number":76,"context_line":"    return g"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_891401e9","line":74,"updated":"2015-06-18 15:49:36.000000000","message":"i\u0027m not sure I follow all this code but I assume it works :)\n\nThis assumes that the state machine was defined with the default_start_state as one of the states. I can\u0027t recall the automaton code; is it possible to create some \u0027not finalized\u0027 machine where this isn\u0027t true, yet someone may want to get a graph of it?","commit_id":"b2d71a49fdc0b0c8ab0903a591721993dcc5438a"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"31efc8f0586d79347feef8aa157d83a26e6961f4","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        start \u003d pydot.Node(\"__start__\", shape\u003d\"point\", width\u003d\"0.1\","},{"line_number":72,"context_line":"                           xlabel\u003d\u0027start\u0027, fontcolor\u003d\u0027green\u0027, **node_attrs)"},{"line_number":73,"context_line":"        g.add_node(start)"},{"line_number":74,"context_line":"        g.add_edge(pydot.Edge(start, nodes[machine.default_start_state],"},{"line_number":75,"context_line":"                              style\u003d\u0027dotted\u0027))"},{"line_number":76,"context_line":"    return g"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_ac579356","line":74,"in_reply_to":"fa32b979_891401e9","updated":"2015-06-18 16:13:13.000000000","message":"As for what it does: this creates a new node with \u0027private\u0027 name, and links it to the default starting node of the constructed dot graph and makes its edge a dotted line, so that there is a dotted line from a point to the default starting node.\n\nAs far as making a machine with start state not in states: hopefully not possible anymore...\n\nThe only way is the deprecated way @ https://github.com/openstack/automaton/blob/master/automaton/machines.py#L76 (I should probably remove that so it isn\u0027t possible anymore).\n\nThe other way to set the `default_start_state` validates the state being set actually exists @  https://github.com/openstack/automaton/blob/master/automaton/machines.py#L93","commit_id":"b2d71a49fdc0b0c8ab0903a591721993dcc5438a"}],"automaton/machines.py":[{"author":{"_account_id":9453,"name":"James Polley","email":"jp@jamezpolley.com","username":"tchaypo"},"change_message_id":"f0310caf41857e7a4784613dc56cf6ecccfa13d3","unresolved":false,"context_lines":[{"line_number":309,"context_line":"                 graph_attrs_cb\u003dNone, node_attrs_cb\u003dNone, edge_attrs_cb\u003dNone,"},{"line_number":310,"context_line":"                 add_start_state\u003dTrue):"},{"line_number":311,"context_line":"        \"\"\"Translates the state machine into a pydot graph.\"\"\""},{"line_number":312,"context_line":"        if not PYDOT_AVAILABLE:"},{"line_number":313,"context_line":"            raise RuntimeError(\"pydot (or pydot2 or equivalent) is required\""},{"line_number":314,"context_line":"                               \" to convert a state machine into a pydot\""},{"line_number":315,"context_line":"                               \" graph\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_1058dbf9","line":312,"updated":"2015-06-15 00:27:23.000000000","message":"I kinda want this to say \"if \u0027pydot\u0027 not in globals():\"\n\nBut I think that\u0027s just because I saw a similar code snippet yesterday and it stuck in my head. I think that explicitly setting PYDOT_AVAILABLE probably makes it more clear what\u0027s happening here (ie, it doesn\u0027t require the reader to know what globals() is).","commit_id":"502c7ed0c5a35f69621d96ebf7a995ebde85cb61"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"694027e1dc747d1a0911df0a5d7863b239085fab","unresolved":false,"context_lines":[{"line_number":309,"context_line":"                 graph_attrs_cb\u003dNone, node_attrs_cb\u003dNone, edge_attrs_cb\u003dNone,"},{"line_number":310,"context_line":"                 add_start_state\u003dTrue):"},{"line_number":311,"context_line":"        \"\"\"Translates the state machine into a pydot graph.\"\"\""},{"line_number":312,"context_line":"        if not PYDOT_AVAILABLE:"},{"line_number":313,"context_line":"            raise RuntimeError(\"pydot (or pydot2 or equivalent) is required\""},{"line_number":314,"context_line":"                               \" to convert a state machine into a pydot\""},{"line_number":315,"context_line":"                               \" graph\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_1cb0f4f3","line":312,"in_reply_to":"fa32b979_1058dbf9","updated":"2015-06-15 04:33:24.000000000","message":"Hmmm, ya, it\u0027s at least pretty clear what its doing here, although I think your way works also, either or :-P","commit_id":"502c7ed0c5a35f69621d96ebf7a995ebde85cb61"}]}
