#!/usr/bin/env python # ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- import sys, copy, oe, oe.parse, oe.build #from oe import * d = {} d = oe.parse.handle("conf/oe.conf", d) if len(sys.argv) == 2: try: d = oe.parse.handle(sys.argv[1], d) except Exception, e: oe.fatal("%s" % e) # emit variables and shell functions oe.data.emit_env(sys.__stdout__, d, True) # emit the metadata which isnt valid shell for e in d.keys(): if oe.data.getVarFlag(e, 'python', d): sys.__stdout__.write("\npython %s () {\n%s}\n" % (e, oe.data.getVar(e, d, 1))) elif oe.data.getVarFlag(e, 'func', d): sys.__stdout__.write("\n%s () {\n%s}\n" % (e, oe.data.getVar(e, d, 1))) else: sys.__stdout__.write("%s=%s\n" % (e, oe.data.getVar(e, d, 1)))