Skip to content

Commit

Permalink
Merge pull request #1 from tsmanner/dot_serializer
Browse files Browse the repository at this point in the history
Dot serializer
  • Loading branch information
dansvo authored Jun 9, 2019
2 parents 3489c3b + f25e561 commit ebb2586
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions bazaarci/runner/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .node import Node
from .graph import Graph
from .product import Product
from .step import Step
Expand Down
10 changes: 6 additions & 4 deletions bazaarci/serializers/dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ def product_to_dot(product):
color = "green" if product.is_set() else "yellow"
return f"\"{product.name}\" [style=filled color={color}]"

apply_serializer(Graph, "to_dot", graph_to_dot)
apply_serializer(Step, "to_dot", step_to_dot)
apply_serializer(SubprocessStep, "to_dot", subprocess_step_to_dot)
apply_serializer(Product, "to_dot", product_to_dot)

def initialize():
apply_serializer(Graph, "to_dot", graph_to_dot)
apply_serializer(Step, "to_dot", step_to_dot)
apply_serializer(SubprocessStep, "to_dot", subprocess_step_to_dot)
apply_serializer(Product, "to_dot", product_to_dot)

0 comments on commit ebb2586

Please sign in to comment.