def buildflowgraph(self, func, mute_dot=False): """Get the flow graph for a function.""" if not isinstance(func, types.FunctionType): raise TypeError("buildflowgraph() expects a function, " "got %r" % (func,)) if func in self._prebuilt_graphs: graph = self._prebuilt_graphs.pop(func) else: if self.config.translation.verbose: log(nice_repr_for_func(func)) graph = build_flow(func) simplify.simplify_graph(graph) if self.config.translation.list_comprehension_operations: simplify.detect_list_comprehension(graph) if not self.config.translation.verbose and not mute_dot: log.dot() self.graphs.append(graph) # store the graph in our list return graph
def buildflowgraph(self, func, mute_dot=False): """Get the flow graph for a function.""" if not isinstance(func, types.FunctionType): raise TypeError("buildflowgraph() expects a function, " "got %r" % (func, )) if func in self._prebuilt_graphs: graph = self._prebuilt_graphs.pop(func) else: if self.config.translation.verbose: log(nice_repr_for_func(func)) graph = build_flow(func) simplify.simplify_graph(graph) if self.config.translation.list_comprehension_operations: simplify.detect_list_comprehension(graph) if not self.config.translation.verbose and not mute_dot: log.dot() self.graphs.append(graph) # store the graph in our list return graph
def __str__(self): if hasattr(self, 'func'): return nice_repr_for_func(self.func, self.name) else: return self.name