bindings/python/ns3modulegen_core_customizations.py
changeset 3412 518719e905a0
parent 3408 2cc40b3e4fa5
child 3421 b9424c43753d
equal deleted inserted replaced
3411:eca46ea15a04 3412:518719e905a0
   143     def __init__(self, return_value, parameters):
   143     def __init__(self, return_value, parameters):
   144         super(CallbackImplProxyMethod, self).__init__(return_value, parameters)
   144         super(CallbackImplProxyMethod, self).__init__(return_value, parameters)
   145 
   145 
   146     def generate_python_call(self):
   146     def generate_python_call(self):
   147         """code to call the python method"""
   147         """code to call the python method"""
   148         build_params = self.build_params.get_parameters()
   148         build_params = self.build_params.get_parameters(force_tuple_creation=True)
   149         if build_params[0][0] == '"':
   149         if build_params[0][0] == '"':
   150             build_params[0] = '(char *) ' + build_params[0]
   150             build_params[0] = '(char *) ' + build_params[0]
   151         args = self.before_call.declare_variable('PyObject*', 'args')
   151         args = self.before_call.declare_variable('PyObject*', 'args')
   152         self.before_call.write_code('%s = Py_BuildValue(%s);'
   152         self.before_call.write_code('%s = Py_BuildValue(%s);'
   153                                     % (args, ', '.join(build_params)))
   153                                     % (args, ', '.join(build_params)))