Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > e5dacb39141c2088e2c30e21fa0b2b06 > files > 37

nagios-check_mk-doc-1.2.3i1-3.mga4.noarch.rpm

#!/usr/bin/python

import os, sys

if sys.argv[1] == '--css':
    first = "/*-"
    sep   = "+"
    cont  = ""
    last  = "'"
    end   = "*/"
elif sys.argv[1] == '--c++':
    first = "// ."
    cont  = "// "
    sep  = "// +"
    last  = "// '"
    end   = "'"
else:
    first = "#   .-"
    sep   = "#   +"
    cont  = "#   "
    last  = "#   '-"
    end   = "'"

if sys.argv[1].startswith("-"):
    sys.argv = sys.argv[1:]

width = 76
sepmid = sep + '-' * (width - len(sep) - 1) + '+'

title = " ".join(sys.argv[1:])
first_line = first + "-" + title
print first_line + '-' * (width - len(first_line) - 1) + '.'
for line in os.popen("figlet -c -w %d '%s'" % (width - 7, title), "r"):
    line = line[:-1]
    print (cont + "|%-" + str(width - len(cont) - 2) + "s|") % line
print sepmid
print cont + "|" + " " * (width - len(cont) - 2) + "|"
print last + '-' * (width - len(last) - len(end)) + end