[PyKDE] [PATCH] Add sip api method api_find_module

Matt Newell newellm at blur.com
Wed Dec 13 19:59:42 GMT 2006


Lately I've been writing some code to call python functions and pass objects 
that are wrapped using sip.  This is relatively easy when linking directly to 
a sip module and using it's generated api methods, however it is currently 
impossible(afaik) by only linking to sip, because there is no way to retrieve 
a pointer to a sipExportedModuleDef for a given module.

I propose this patch that adds the function api_find_module to the sipAPIDef 
struct.   With this patch you can get the sipAPIDef * from the sip modules 
python dictionary, then use api_find_module to get the registered sip module.  
From here I can get to the sipWrapperType's for the module, and use them with 
api_convert_from_new_instance, etc.

I also attached a small file showing how i use the new function.

Matt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: api_find_module.patch
Type: text/x-diff
Size: 1444 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20061213/2a0f575f/api_find_module.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: api_find_module_usage.cpp
Type: text/x-c++src
Size: 1689 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20061213/2a0f575f/api_find_module_usage.bin


More information about the PyQt mailing list