import sys
from Ft.Ods import Database
from Ft.Ods.MetaData import MetaKind

def pprint(ds,indent = ''):
    print indent + ds.absolute_name()
    for d in ds.defines:
        if d.meta_kind in [MetaKind.mk_module,
                           MetaKind.mk_class]:
            pprint(d,indent + '  ')

def run():

    db = Database.Database()
    db.open('test')

    tx = db.new()
    tx.begin()

    repo = db.schema()
    pprint(repo)

    tx.abort()
    db.close()


if __name__ == '__main__':
    run()
