def main(): global SOURCE read_options() deps, nodes = get_compile_order() if TRANSLATE: source = SOURCE if os.path.exists(TRANSLATE): shutil.rmtree(TRANSLATE) shutil.copytree(source, TRANSLATE) SOURCE = TRANSLATE for fullname in map(get_fullname, deps): print 'translating', fullname new_code = process_imports(fullname, local=False) with open(fullname, 'w') as f: f.write(new_code) if os.path.exists(LOCAL): shutil.rmtree(LOCAL) shutil.copytree(source, LOCAL) SOURCE = LOCAL for fullname in map(get_fullname, deps): print 'translating for local use:', fullname new_code = process_imports(fullname, local=True) with open(fullname, 'w') as f: f.write(new_code) return 0 if CONTRACT is not None: deps = optimize_deps(deps, nodes) for fullname in map(get_fullname, deps): print "compiling", os.path.normpath(fullname) sys.stdout.flush() compile(fullname) rpc.save_db(DB)
def main(): read_options() deps, nodes = get_compile_order() if CONTRACT is not None: deps = optimize_deps(deps, nodes) for fullname in map(get_fullname, deps): print "compiling", fullname compile(fullname) rpc.save_db(DB)
def main(): read_options() deps, nodes = get_compile_order() if TRANSLATE: global SOURCE shutil.copytree(SOURCE, TRANSLATE) SOURCE = TRANSLATE for fullname in map(get_fullname, deps): print "translating", fullname new_code = process_imports(fullname) with open(fullname, "w") as f: f.write(new_code) sys.exit(0) if CONTRACT is not None: deps = optimize_deps(deps, nodes) for fullname in map(get_fullname, deps): print "compiling", fullname sys.stdout.flush() compile(fullname) rpc.save_db(DB)
def main(): read_options() deps, nodes = get_compile_order() if TRANSLATE: global SOURCE shutil.copytree(SOURCE, TRANSLATE) SOURCE = TRANSLATE for fullname in map(get_fullname, deps): print 'translating', fullname new_code = process_imports(fullname) with open(fullname, 'w') as f: f.write(new_code) sys.exit(0) if CONTRACT is not None: deps = optimize_deps(deps, nodes) for fullname in map(get_fullname, deps): print "compiling", fullname sys.stdout.flush() compile(fullname) rpc.save_db(DB)