diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2013-09-24 23:46:20 +0200 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2013-09-24 23:55:04 +0200 |
commit | 7eccf40188a2326bec49d67f92ce0ca3d8919cec (patch) | |
tree | a54e8a3578a3e0f27481336301a713d9322d07e5 /lib_subgraphs.py | |
parent | 2cee66ec06d192decd7dd8836daf7c4917b36aeb (diff) | |
download | cluster-overview-7eccf40188a2326bec49d67f92ce0ca3d8919cec.tar.gz cluster-overview-7eccf40188a2326bec49d67f92ce0ca3d8919cec.tar.xz cluster-overview-7eccf40188a2326bec49d67f92ce0ca3d8919cec.zip |
Refactor attributes handling: conciseness and flexibility
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'lib_subgraphs.py')
-rw-r--r-- | lib_subgraphs.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib_subgraphs.py b/lib_subgraphs.py index 9d74e42..fd233b0 100644 --- a/lib_subgraphs.py +++ b/lib_subgraphs.py @@ -7,17 +7,18 @@ """Subgraph library incl. visual aspects""" from lib import LibSubgraph +from lib_attributes import * class SubgraphImportant(LibSubgraph): - def __init__(self, *args, **kwargs): - kwargs.setdefault('fillcolor', '#eaeaea') - kwargs.setdefault('style', 'bold, filled, rounded') - super(SubgraphImportant, self).__init__(*args, **kwargs) + defaults = dict(( + FILLCOLOR('#eaeaea'), + STYLE('bold, filled, rounded'), + )) class SubgraphStandard(LibSubgraph): - def __init__(self, *args, **kwargs): - kwargs.setdefault('fillcolor', '#f5f5f5') - kwargs.setdefault('style', 'filled, rounded') - super(SubgraphStandard, self).__init__(*args, **kwargs) + defaults = dict(( + FILLCOLOR('#f5f5f5'), + STYLE('filled, rounded'), + )) |