def analizeFuncCall(file): try: ast = getPHPAst(file) funcCalls = reduce(add, (node.find('Expr_FuncCall') for node in ast), []) return Counter(call.name.parts[0] for call in funcCalls) except: # todo:fix print 'analizeFuncCall talk that something was wrong with file %s ' % file return Counter()
def generate(file): processor = Processor(stdScope) phpAst = getPHPAst(file) pythonAst = processor.translate(phpAst) return to_source(pythonAst)