aboutsummaryrefslogtreecommitdiffstats
path: root/bin/oeread
blob: 8b84b21409df8dfa9e0bece102d8f1ead613c793 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/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 = oe.data.init()
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)))