Exemplo n.º 1
0
def find_PYZ_dependencies(config):
    print "I: computing PYZ dependencies..."
    a = mf.ImportTracker([os.path.join(HOME, 'support')])
    a.analyze_r('archive')
    mod = a.modules['archive']
    toc = Build.TOC([(mod.__name__, mod.__file__, 'PYMODULE')])
    for i in range(len(toc)):
        nm, fnm, typ = toc[i]
        mod = a.modules[nm]
        tmp = []
        for importednm, isdelayed, isconditional, level in mod.imports:
            if not isconditional:
                realnms = a.analyze_one(importednm, nm)
                for realnm in realnms:
                    imported = a.modules[realnm]
                    if not isinstance(imported, mf.BuiltinModule):
                        tmp.append((imported.__name__, imported.__file__, imported.typ))
        toc.extend(tmp)
    toc.reverse()
    config['PYZ_dependencies'] = toc.data
Exemplo n.º 2
0
config['hasUPX'] = hasUPX

# now write out config, so Build can load
outf = open(configfile, 'w')
import pprint
pprint.pprint(config, outf)
outf.close()

import Build

# PYZ_dependencies
print "I: computing PYZ dependencies..."
a = mf.ImportTracker([os.path.join(HOME, 'support')])
a.analyze_r('archive')
mod = a.modules['archive']
toc = Build.TOC([(mod.__name__, mod.__file__, 'PYMODULE')])
for i in range(len(toc)):
    nm, fnm, typ = toc[i]
    mod = a.modules[nm]
    tmp = []
    for importednm, isdelayed, isconditional in mod.imports:
        if not isconditional:
            realnms = a.analyze_one(importednm, nm)
            for realnm in realnms:
                imported = a.modules[realnm]
                if not isinstance(imported, mf.BuiltinModule):
                    tmp.append((imported.__name__, imported.__file__, imported.typ))
    toc.extend(tmp)
toc.reverse()
config['PYZ_dependencies'] = toc.data