diff --git a/pybindgen/functionwrapper.py b/pybindgen/function.py similarity index 96% rename from pybindgen/functionwrapper.py rename to pybindgen/function.py index 0e2c2f8..5519065 100644 --- a/pybindgen/functionwrapper.py +++ b/pybindgen/function.py @@ -5,7 +5,7 @@ from typehandlers.base import ForwardWrapperBase from typehandlers import codesink -class FunctionWrapper(ForwardWrapperBase): +class Function(ForwardWrapperBase): """ Class that generates a wrapper to a C function. """ @@ -16,7 +16,7 @@ class FunctionWrapper(ForwardWrapperBase): function_name -- name of the C function parameters -- the function parameters """ - super(FunctionWrapper, self).__init__( + super(Function, self).__init__( return_value, parameters, parse_error_return="return NULL;", error_return="return NULL;") diff --git a/pybindgen/module.py b/pybindgen/module.py index e27d4b4..229aed1 100644 --- a/pybindgen/module.py +++ b/pybindgen/module.py @@ -2,7 +2,7 @@ Code to generate code for a C/C++ Python extension module. """ -from functionwrapper import FunctionWrapper +from function import Function from typehandlers.base import CodeBlock class Module(object): @@ -48,14 +48,14 @@ class Module(object): """ Add a function to the module. - wrapper -- a FunctionWrapper instance that can generate the wrapper + wrapper -- a Function instance that can generate the wrapper name -- name of the module function as it will appear from Python side; if not given, the c_function_name_transformer callback, or strip_prefix, will be used to guess the Python name. """ assert name is None or isinstance(name, str) - assert isinstance(wrapper, FunctionWrapper) + assert isinstance(wrapper, Function) if name is None: name = self.c_function_name_transformer(wrapper.function_name) self.functions.append((name, wrapper)) diff --git a/tests/test-generation.py b/tests/test-generation.py index 24258c6..79f0366 100755 --- a/tests/test-generation.py +++ b/tests/test-generation.py @@ -11,7 +11,7 @@ sys.path.insert(0, path) from pybindgen import typehandlers from pybindgen.typehandlers import codesink from pybindgen.typehandlers.base import Parameter, ReturnValue -from pybindgen.functionwrapper import FunctionWrapper +from pybindgen.function import Function from pybindgen.module import Module @@ -69,8 +69,8 @@ def test(): param_name = 'param_inout' elif direction == (Parameter.DIRECTION_OUT): param_name = 'param_out' - wrapper = FunctionWrapper(return_handler(return_type), function_name, - [param_handler(param_type, param_name, direction)]) + wrapper = Function(return_handler(return_type), function_name, + [param_handler(param_type, param_name, direction)]) module.add_function(wrapper)