def mread(s): """ Read module from string """ ast = parse(s) if opts.ddump_parse: logging.info(ast) return build_module(ast)
def mopen(f): """ Read module from file """ fd = open(f) contents = fd.read() ast = parse(contents) if opts.ddump_parse: logging.info(ast) return build_module(ast)