from fab import Fabricator

from job import Job

from macrolib.columnize import columnize

 

f = Fabricator()

attrList = dir(f)

cw = max([len(attr) for attr in attrList])+4

print "%s%s" % (columnize("ATTRIBUTE", cw), columnize("VALUE OR METHOD", cw))

print "-"*cw*2

for attr in attrList:

    print "%s%s" % (columnize(attr, cw), columnize(str(getattr(f, attr, "Not available")), cw))

 

 

f = Job()

attrList = dir(f)

cw = max([len(attr) for attr in attrList])+4

print "%s%s" % (columnize("ATTRIBUTE", cw), columnize("VALUE OR METHOD", cw))

print "-"*cw*2

for attr in attrList:

    try:

        print "%s%s" % (columnize(attr, cw), columnize(str(getattr(f, attr, "Not available")), cw))

    except:

        print "%s%s" % (columnize(attr, cw), columnize("Not available", cw))