[PyKDE] kdebindings 3.2.91 and bytearray.sip

Jim Bublitz jbublitz at nwinternet.com
Tue Jul 13 19:02:01 BST 2004


On Tuesday 13 July 2004 04:38, Michael Franz Aigner wrote:
> Regarding the python bindings in the sources of the recently released
> kde beta... please can somebody knowledgeable of the matter tell me
> the reason why the file sip/kdecore/bytearray.sip is not included any
> more in the kde python bindings?
>
> The two functions provided by this file were dcop_add and dcop_next,
> which marshal data into and out of a QByteArray. I need them for a
> DCOP service implemented in Python which uses this two functions to
> marshal incoming / outgoing data.
>
> If it is the case that those functions will not be contained in PyKDE
> any more, is there any substitute for them which will allow me to read
> from / write to a QByteArray? Or, even better would be if there is a
> possibility of implementing a DCOP service without having to take of
> marshaling the data manually?
>
> Of course, the last resort would be to implement the functionality of
> dcop_add and dcop_next completely in Python, but i try to avoid that.

bytearray.sip and the dcop*.py files are relatively new  and Simon probably 
just hasn't put them into KDE CVS yet. It will definitely continue to be a 
part of PyKDE, and I'm glad you find it useful. 

Simon has only recently done the work necessary to include PyKDE in the KDE 
CVS and release builds, so those versions are likely to lag a bit initially.

They're still included in the PyKDE3.11.1 tarball, so if you don't need 
KDE3.3beta1 support you can use that.  It's possible to get PyKDE3.11.1 (from 
the tarball) to build against KDE3.3beta1, but there are a lot of small 
details to doing that. If you wanted to modify the CVS source, you just need 
to add bytearray.sip to the sip/kdecore directory and then add "%Include 
bytearray.sip" to sip/kdecore/kdecoremod.sip.in and recompile. You can 
recompile only kdecore by doing:

    python configure.py -lkdecore  

(the switch is "ell") and then make and make install.

Alternatively, I can send you an untested tarball of PyKDE that includes both 
bytearray.sip and all new classes and methods for KDE 3.3beta1. I'll be 
making that available as a snapshot as soon as I find time to test it, which 
unfortunately will be at least a few days or more from now.

It's pretty easy to do the marshalling as part of the bindings - not so easy 
in Python. You might also want to look at dcopext.py and dcopexport.py 
(they're in PyKDE/extensions and covered in the docs and should install into 
site-packages so you can just import them like any other PyKDE modules). 
Those take care of most of the other DCOP housekeeping and you don't need to 
marshall args directly at all. They still need bytearray.sip though.

Jim




More information about the PyQt mailing list