summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2013-09-24 23:55:46 +0200
committerJan Pokorný <jpokorny@redhat.com>2013-09-24 23:55:46 +0200
commit7194b691d333f8eb3c4eead3209428f98b80ed1f (patch)
treecce76a0d83057f99e7bb04c72ae57823251081d4
parent7eccf40188a2326bec49d67f92ce0ca3d8919cec (diff)
downloadcluster-overview-7194b691d333f8eb3c4eead3209428f98b80ed1f.zip
cluster-overview-7194b691d333f8eb3c4eead3209428f98b80ed1f.tar.gz
cluster-overview-7194b691d333f8eb3c4eead3209428f98b80ed1f.tar.xz
Move invisible elements to lib_$class.py
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rwxr-xr-xcluster-cman.py2
-rw-r--r--lib.py21
-rw-r--r--lib_edges.py7
-rw-r--r--lib_nodes.py6
-rw-r--r--lib_subgraphs.py6
5 files changed, 21 insertions, 21 deletions
diff --git a/cluster-cman.py b/cluster-cman.py
index a24339b..5972a96 100755
--- a/cluster-cman.py
+++ b/cluster-cman.py
@@ -17,7 +17,7 @@ conveniently using XDot: http://code.google.com/p/jrfonseca/wiki/XDot
from sys import argv
from os.path import splitext
-from lib import LibDot, SubgraphInvisible, EdgeInvisible, main
+from lib import LibDot, main
from lib_subgraphs import *
from lib_nodes import *
from lib_edges import *
diff --git a/lib.py b/lib.py
index ff40240..d2025b0 100644
--- a/lib.py
+++ b/lib.py
@@ -95,36 +95,17 @@ class LibSubgraph(Subgraph):
def __init__(self, *args, **kwargs):
super(LibSubgraph, self).__init__(*args, **kwargs)
- #self.set_suppress_disconnected(True)
-
-
-class SubgraphInvisible(LibSubgraph):
- def __init__(self, *args, **kwargs):
- kwargs.setdefault('style', 'invis')
- super(SubgraphInvisible, self).__init__(*args, **kwargs)
+ #self. set_suppress_disconnected(True)
class LibNode(Node):
__metaclass__ = LibMeta
-class NodeInvisible(LibNode):
- def __init__(self, *args, **kwargs):
- kwargs.setdefault('style', 'invis')
- super(LibNode, self).__init__(*args, **kwargs)
-
-
class LibEdge(Edge):
__metaclass__ = LibMeta
-class EdgeInvisible(LibEdge):
- def __init__(self, *args, **kwargs):
- kwargs.setdefault('style', 'invis')
- kwargs.setdefault('arrowhead', 'none')
- super(EdgeInvisible, self).__init__(*args, **kwargs)
-
-
# Attributes
class LibAttributeMeta(type):
diff --git a/lib_edges.py b/lib_edges.py
index 19617eb..06402ef 100644
--- a/lib_edges.py
+++ b/lib_edges.py
@@ -9,6 +9,13 @@ from lib import LibEdge
from lib_attributes import *
+class EdgeInvisible(LibEdge):
+ defaults = dict((
+ STYLE.invis,
+ ARROWHEAD.none,
+ ))
+
+
class DBUS(LibEdge):
defaults = dict((
STYLE.dotted,
diff --git a/lib_nodes.py b/lib_nodes.py
index 20b5c66..0a044b9 100644
--- a/lib_nodes.py
+++ b/lib_nodes.py
@@ -9,6 +9,12 @@ from lib import LibNode
from lib_attributes import *
+class NodeInvisible(LibNode):
+ defaults = dict((
+ STYLE.invis,
+ ))
+
+
class Program(LibNode):
defaults = dict((
SHAPE.box,
diff --git a/lib_subgraphs.py b/lib_subgraphs.py
index fd233b0..c374274 100644
--- a/lib_subgraphs.py
+++ b/lib_subgraphs.py
@@ -10,6 +10,12 @@ from lib import LibSubgraph
from lib_attributes import *
+class SubgraphInvisible(LibSubgraph):
+ defaults = dict((
+ STYLE.invis,
+ ))
+
+
class SubgraphImportant(LibSubgraph):
defaults = dict((
FILLCOLOR('#eaeaea'),