[PyKDE] mysterious dcopext bug
Kovid Goyal
kovid at theory.caltech.edu
Sat Feb 3 08:43:57 GMT 2007
I figured out that this happens because the method getTorrentNumbers returns a
QValueList<int>. Does anyone know how I can unmarshall that? dcop_next
doesn't seem to work.
b = QByteArray()
s = QDataStream (b, IO_WriteOnly)
dcop_add(s, 1, 'int')
ok, rtype, arr = dcop.call('ktorrent', 'KTorrent', 'getTorrentNumbers(int)',
b)
s = QDataStream(arr, IO_ReadOnly)
print dcop_next(s, rtype)
gives None. I've verified that there are bytes in arr by read rawbytes from s.
Thanks,
Kovid
On Friday 02 February 2007 10:42:52 Kovid Goyal wrote:
> Hi,
>
> Calling a particular method using dcopext yields a different result from
> calling it using the dcop commandline client. Here's a test script that
> calls the method (requires ktorrent)
>
> from kdecore import KApplication
> import dcopext, sys, subprocess
>
> app = KApplication(sys.argv, 'test')
> dcop = app.dcopClient()
> kt = dcopext.DCOPApp('ktorrent', dcop).KTorrent
> print kt.maxUploadRate()
> print kt.getTorrentNumbers(3)
> subprocess.call('dcop ktorrent KTorrent getTorrentNumbers 3', shell=True)
>
> The call to getTorrentNumbers produces a (True, None) when called via
> dcopext. However when called via the commandline client it produces a list
> of torrent numbers as expected.
>
> Using kde 3.5.6. Other method calls on ktorrent work as shown by the call
> to maxUploadRate.
>
> Thanks,
>
> Kovid.
--
_____________________________________
Kovid Goyal MC 452-48
California Institute of Technology
1200 E California Blvd
Pasadena, CA 91125
home : +01 626 390 8699
office: +01 626 395 6595 (449 Lauritsen)
email : kovid at theory.caltech.edu
web : http://www.kovidgoyal.net
_____________________________________
More information about the PyQt
mailing list