diff options
| author | Joshua Harlow <harlowja@gmail.com> | 2014-07-19 16:52:13 -0700 |
|---|---|---|
| committer | Joshua Harlow <harlowja@gmail.com> | 2014-10-18 13:24:12 -0700 |
| commit | 3a8a78ee647e43fa0386d4310a384e374d4ce0fa (patch) | |
| tree | 45707e7c55c2a2c1893d8c4d030e813f8593116c /taskflow/patterns/graph_flow.py | |
| parent | 8d1b936239630f5dcbc41e18cabe6570197eebc6 (diff) | |
| download | taskflow-3a8a78ee647e43fa0386d4310a384e374d4ce0fa.tar.gz | |
Use constants for link metadata keys
Instead of using strings (which can be easy to
mistype and get wrong), provide a set of constants
that can be used to attach and use these keys in
flows and at compilation.
This also helps make it more clear what the keys
do and where they are used.
Change-Id: I5283b27617961136a4582bbcfce4617f05e8dd1d
Diffstat (limited to 'taskflow/patterns/graph_flow.py')
| -rw-r--r-- | taskflow/patterns/graph_flow.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/taskflow/patterns/graph_flow.py b/taskflow/patterns/graph_flow.py index f07e743..f71f285 100644 --- a/taskflow/patterns/graph_flow.py +++ b/taskflow/patterns/graph_flow.py @@ -75,11 +75,11 @@ class Flow(flow.Flow): if not attrs: attrs = {} if manual: - attrs['manual'] = True + attrs[flow.LINK_MANUAL] = True if reason is not None: - if 'reasons' not in attrs: - attrs['reasons'] = set() - attrs['reasons'].add(reason) + if flow.LINK_REASONS not in attrs: + attrs[flow.LINK_REASONS] = set() + attrs[flow.LINK_REASONS].add(reason) if not mutable_graph: graph = gr.DiGraph(graph) graph.add_edge(u, v, **attrs) |
