From 7eccf40188a2326bec49d67f92ce0ca3d8919cec Mon Sep 17 00:00:00 2001 From: Jan Pokorný Date: Tue, 24 Sep 2013 23:46:20 +0200 Subject: Refactor attributes handling: conciseness and flexibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan Pokorný --- lib_subgraphs.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'lib_subgraphs.py') 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'), + )) -- cgit