diff --git a/pybindgen/cppclass.py b/pybindgen/cppclass.py index b7feab6..645aafc 100644 --- a/pybindgen/cppclass.py +++ b/pybindgen/cppclass.py @@ -775,7 +775,7 @@ typedef struct { static_getsets = self.static_attributes.generate(code_sink) ## --- register the class type in the module --- - module.after_init.write_code("/* Register the '%s' class */" % self.name) + module.after_init.write_code("/* Register the '%s' class */" % self.full_name) ## generate a metaclass if needed if static_getsets == '0': @@ -901,14 +901,14 @@ typedef struct { code_sink.writeln() method_defs.extend(parent_caller_methods) ## generate the method table - code_sink.writeln("static PyMethodDef %s_methods[] = {" % (self.name,)) + code_sink.writeln("static PyMethodDef %s_methods[] = {" % (self.pystruct,)) code_sink.indent() for methdef in method_defs: code_sink.writeln(methdef) code_sink.writeln("{NULL, NULL, 0, NULL}") code_sink.unindent() code_sink.writeln("};") - self.slots.setdefault("tp_methods", "%s_methods" % (self.name,)) + self.slots.setdefault("tp_methods", "%s_methods" % (self.pystruct,)) def _generate_gc_methods(self, code_sink): """Generate tp_clear and tp_traverse""" diff --git a/pybindgen/cppmethod.py b/pybindgen/cppmethod.py index def98b7..73645b7 100644 --- a/pybindgen/cppmethod.py +++ b/pybindgen/cppmethod.py @@ -72,7 +72,7 @@ class CppMethod(ForwardWrapperBase): """set the class object this method belongs to""" self._class = class_ self.wrapper_base_name = "_wrap_%s_%s" % ( - class_.name, self.mangled_name) + class_.pystruct, self.mangled_name) def get_class(self): """get the class object this method belongs to""" return self._class @@ -230,7 +230,7 @@ class CppConstructor(ForwardWrapperBase): "Set the class wrapper object (CppClass)" self._class = class_ self.wrapper_base_name = "_wrap_%s__tp_init" % ( - class_.name,) + class_.pystruct,) def get_class(self): "Get the class wrapper object (CppClass)" return self._class @@ -336,7 +336,7 @@ class CppNoConstructor(ForwardWrapperBase): #assert isinstance(class_, CppClass) wrapper_function_name = "_wrap_%s__tp_init" % ( - class_.name,) + class_.pystruct,) code_sink.writeln("static int") code_sink.writeln("%s(void)" % wrapper_function_name) code_sink.writeln('{')