Example #1
0
File: soa.py Project: climbus/rope
 def _Call(self, node):
     for child in rope.base.ast.get_child_nodes(node):
         rope.base.ast.walk(child, self)
     primary, pyname = evaluate.eval_node2(self.scope, node.func)
     if pyname is None:
         return
     pyfunction = pyname.get_object()
     if isinstance(pyfunction, pyobjects.AbstractFunction):
         args = arguments.create_arguments(primary, pyfunction, node, self.scope)
     elif isinstance(pyfunction, pyobjects.PyClass):
         pyclass = pyfunction
         if "__init__" in pyfunction:
             pyfunction = pyfunction["__init__"].get_object()
         pyname = rope.base.pynames.UnboundName(pyobjects.PyObject(pyclass))
         args = self._args_with_self(primary, pyname, pyfunction, node)
     elif "__call__" in pyfunction:
         pyfunction = pyfunction["__call__"].get_object()
         args = self._args_with_self(primary, pyname, pyfunction, node)
     else:
         return
     self._call(pyfunction, args)
Example #2
0
 def _Call(self, node):
     for child in rope.base.ast.get_child_nodes(node):
         rope.base.ast.walk(child, self)
     primary, pyname = evaluate.eval_node2(self.scope, node.func)
     if pyname is None:
         return
     pyfunction = pyname.get_object()
     if isinstance(pyfunction, pyobjects.AbstractFunction):
         args = arguments.create_arguments(primary, pyfunction,
                                           node, self.scope)
     elif isinstance(pyfunction, pyobjects.PyClass):
         pyclass = pyfunction
         if '__init__' in pyfunction:
             pyfunction = pyfunction['__init__'].get_object()
         pyname = rope.base.pynames.UnboundName(pyobjects.PyObject(pyclass))
         args = self._args_with_self(primary, pyname, pyfunction, node)
     elif '__call__' in pyfunction:
         pyfunction = pyfunction['__call__'].get_object()
         args = self._args_with_self(primary, pyname, pyfunction, node)
     else:
         return
     self._call(pyfunction, args)