summaryrefslogtreecommitdiffstats
path: root/lib_subgraphs.py
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2013-09-24 23:46:20 +0200
committerJan Pokorný <jpokorny@redhat.com>2013-09-24 23:55:04 +0200
commit7eccf40188a2326bec49d67f92ce0ca3d8919cec (patch)
treea54e8a3578a3e0f27481336301a713d9322d07e5 /lib_subgraphs.py
parent2cee66ec06d192decd7dd8836daf7c4917b36aeb (diff)
downloadcluster-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.py17
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'),
+ ))