# HG changeset patch # User igor # Date 1194807470 -7200 # Node ID e7b9761c03e8f2d095ed9ad887be68c57ab91c85 # Parent 9d54d94a7dffea5790b6a53045a13b4dc29f7c6c info() + logo() diff -r 9d54d94a7dff -r e7b9761c03e8 xendomain.py --- a/xendomain.py Sun Nov 11 19:46:27 2007 +0200 +++ b/xendomain.py Sun Nov 11 20:57:50 2007 +0200 @@ -35,6 +35,7 @@ hidden_bridges = [] broken_links = [] temporary_links = [] +cross_bridges=[] real_bridges=[] real_nodes=[] diff -r 9d54d94a7dff -r e7b9761c03e8 xentaur.py --- a/xentaur.py Sun Nov 11 19:46:27 2007 +0200 +++ b/xentaur.py Sun Nov 11 20:57:50 2007 +0200 @@ -1,5 +1,5 @@ #!/usr/bin/python - +# vim: set fileencoding=utf-8 : import sys,os,time @@ -158,11 +158,11 @@ #################################################### def screen(): - wait_seconds=5 + wait_seconds=1 screens=[] for domain in domains: screens.append("screen -t %s %s sh -c 'while true; do %s ; echo Retrying in %s secods...; sleep %s ; clear; done'" % - (domain,domains.index(domain),node_object[domain].console_string(),wait_seconds,wait_seconds)) + (domain,domains.index(domain)+1,node_object[domain].console_string(),wait_seconds,wait_seconds)) screenlist="\n".join(screens) hardstatus='hardstatus string "%{rk}Xentaur%{bk}@%H %{gk}%c %{yk}%d.%m %{wk}%?%-Lw%?%{bw}%n*%f%t%?(%u)%?%{wk}%?%+Lw%?"' @@ -173,9 +173,10 @@ hardstatus alwayslastline %s -screen -t console 0 bash +screen -t console 0 sh -c 'while true; do cd %s; ./xentaur.py shell ; echo Retrying in %s secods...; sleep %s ; clear; done' +#screen -t xentaur - sh -c 'while true; do bash ; echo Retrying in %s secods...; sleep %s ; clear; done' %s -""" % (hardstatus,screenlist)) +""" % (hardstatus,xentaur_path,wait_seconds,wait_seconds,wait_seconds,wait_seconds,screenlist)) f.close() print "# GNU Screen config file is written to: %s" % screenrc @@ -234,6 +235,38 @@ ipshell = IPShellEmbed() ipshell() +def version(): + print "Xentaur 0.1-PRE" + print "(Godzilla-mutant) _" + print " / * \\" + print " / .-" + print " / |" + print " | \\ \\\\ \\" + print " _ -------| \\ \\\\ \\" + print " / / \\_\\ -" + print "/ |\\ | |" + print "| | \\ .-----. | \\ |" + print " | / \\ \\ \\ \\" + print " \\/|.\\ \\ \\ \\ \\" + print " \\| - . \\_\\ \\_\\" + print "-----------------------------------------------" + + +def info(): + version() + + print "Network name: ", network + print "-----------------------------------------------" + print + print "Nodes: ", len(domains) + print " * virtual nodes: ", len(domains)-len(real_nodes) + print " * real nodes:", len(real_nodes) + print + print "Bridges:", len(bridges) + print " * virtual bridges:", len(bridges)-len(real_bridges)-len(cross_bridges) + print " * real switches:", len(real_bridges) + print " * direct links:", len(cross_bridges) + def show_usage(): print """Usage: xentaur [] @@ -703,6 +736,8 @@ graph() elif sys.argv[1] == 'shell': shell() + elif sys.argv[1] == 'info': + info() else: show_usage() sys.exit(1)