On Wed, Jul 29, 2009 at 5:29 AM, Andrea Grandi<[email protected]> wrote: > Hi all, > > I was looking at this page about creating new types in Python: > http://docs.python.org/extending/newtypes.html > it looks quite clear, but what if I've to add this to an override file? > > In particular: how can I register the type?
When using codegen, you will almost create new types by yourself. You need to either (a) fix codegen to parse correctly some missing type that was in a public header or (b) write custom defs entries in mafw-extras.defs. This way, the code generated by codegen will already contain all the xxxType structs etc. You can always use existing defs entries as reference for writing your own entries. Just remember to put then in mafw-extras.defs , because any other .defs are overwritten when running mafw_gen_defs.sh to update the autogenerated defs. > the example uses: PyModule_AddObject(m, "Noddy", (PyObject > *)&noddy_NoddyType); > inside the init[modulename] function, but how can I modify the initmethod? As I said above, for type definitions codegen should be used. For other custom things that need to go in the init function, you need to edit mafwmodule.c (it is manually written). Regards, -- Anderson Lizardo OpenBossa Labs - INdT Manaus - Brazil _______________________________________________ maemo-developers mailing list [email protected] https://lists.maemo.org/mailman/listinfo/maemo-developers
