diff options
author | Sol Jerome <solj@ices.utexas.edu> | 2008-09-12 21:25:16 +0000 |
---|---|---|
committer | Sol Jerome <solj@ices.utexas.edu> | 2008-09-12 21:25:16 +0000 |
commit | 01e56e153fd83c0b51760cf4ec04cc07e39bcc1b (patch) | |
tree | 8999bb657bb258d41d83244c0506c43956775512 /src/lib/Server/Admin/Viz.py | |
parent | cd78f764f64ea2984c6382a20b7ffd7d44345995 (diff) | |
download | bcfg2-01e56e153fd83c0b51760cf4ec04cc07e39bcc1b.tar.gz bcfg2-01e56e153fd83c0b51760cf4ec04cc07e39bcc1b.tar.bz2 bcfg2-01e56e153fd83c0b51760cf4ec04cc07e39bcc1b.zip |
Improve help messages for bcfg2-admin (and modes)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4910 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Admin/Viz.py')
-rw-r--r-- | src/lib/Server/Admin/Viz.py | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/lib/Server/Admin/Viz.py b/src/lib/Server/Admin/Viz.py index 0afb6a121..0a5a8b9d6 100644 --- a/src/lib/Server/Admin/Viz.py +++ b/src/lib/Server/Admin/Viz.py @@ -1,17 +1,32 @@ - -import getopt, popen2, lxml.etree +import getopt, popen2 import Bcfg2.Server.Admin class Viz(Bcfg2.Server.Admin.MetadataCore): - __shorthelp__ = '''bcfg2-admin viz [--includehosts] [--includebundles] [--includekey] [-o output.png] [--raw]''' - __longhelp__ = __shorthelp__ + '\n\tProduce graphviz diagrams of metadata structures' + __shorthelp__ = "Produce graphviz diagrams of metadata structures" + __longhelp__ = (__shorthelp__ + "\n\nbcfg2-admin viz [--includehosts] " + "[--includebundles] [--includekey] " + "[-o output.png] [--raw]") + __usage__ = ("bcfg2-admin viz [options]\n\n" + " %-25s%s\n" + " %-25s%s\n" + " %-25s%s\n" + " %-25s%s\n" % + ("-H, --includehosts", + "include hosts in the viz output", + "-b, --includebundles", + "include bundles in the viz output", + "-k, --includekey", + "show a key for different digraph shapes", + "-o, --outfile <file>", + "write viz output to an output file")) colors = ['steelblue1', 'chartreuse', 'gold', 'magenta', 'indianred1', 'limegreen', 'orange1', 'lightblue2', 'green1', 'blue1', 'yellow1', 'darkturquoise', 'gray66'] def __init__(self, cfile): - Bcfg2.Server.Admin.MetadataCore.__init__(self, cfile) + Bcfg2.Server.Admin.MetadataCore.__init__(self, cfile, + self.__usage__) def __call__(self, args): Bcfg2.Server.Admin.MetadataCore.__call__(self, args) @@ -63,7 +78,8 @@ class Viz(Bcfg2.Server.Admin.MetadataCore): print "write to dot process failed. Is graphviz installed?" raise SystemExit(1) dotpipe.tochild.write('\trankdir="LR";\n') - dotpipe.tochild.write(self.metadata.viz(hosts, bundles, key, self.colors)) + dotpipe.tochild.write(self.metadata.viz(hosts, bundles, + key, self.colors)) if key: dotpipe.tochild.write("\tsubgraph cluster_key {\n") dotpipe.tochild.write('''\tstyle="filled";\n''') |