[PyKDE] How to pass UDSEntry to KIO.NetAccess.stat

jisaitua at covenco.cl jisaitua at covenco.cl
Mon Dec 4 17:32:57 GMT 2006


ok, let's wait for the next release then...

Thank you Jim for the info!

Regards,
Juan Ignacio Saitua.




Jim Bublitz <jbublitz at nwinternet.com> 
12/04/06 02:07 PM
Please respond to
jbublitz at nwinternet.com


To
pykde at mats.imk.fraunhofer.de
cc
jisaitua at covenco.cl
Subject
Re: [PyKDE] How to pass UDSEntry to KIO.NetAccess.stat






On Monday 04 December 2006 05:59, jisaitua at covenco.cl wrote:
> Hi,
>
> I'm a newbie in python and pyKde and was trying to use NetAccess.stat. 
My
> problem is, that the UDSEntry parameter returns always empty.
>
> I tried with the following sample code:
> ------------------------------------------------
> import sys
> from kio import KIO
> from kdecore import KApplication,KURL
>
> app=KApplication(sys.argv, "KIO.NetAccess Testing")
> myURL = KURL("/usr/bin/python")
>
> if KIO.NetAccess.exists(myURL):
>         udsEntry=[]
>         if KIO.NetAccess.stat(myURL, udsEntry):
>                 #It doesn't get any UDSAtom...len (udsEntry) is always 0
>                 print "Number of UDSAtoms in UDSEntry: ", len(udsEntry)
> ------------------------------------------------
>
> Maybe what I'm doing is completely wrong, I don't know, so please help! 
I
> really would appreciate any hint.
>
> P.D: I'm using kubuntu 6.10 with pykde-3.15.2, pyqt-3.16, sip-4.4.5 and
> kde-3.5.5

The KIO.NetAccess.stat methods in PyKDE aren't coded correctly. The list 
(your 
udsEntry variable) should be a return value, not an argument. It should 
be:

   result, udsEntry = KIO.NetAccess.stat (myURL)

where result is bool and udsEntry is a Python list. But the error is in 
PyKDE, 
and if you re-code that way it still won't work until I fix PyKDE.

I'm still trying to get a snapshot together with some other fixes, but it 
will 
be a while - not in the next few days at any rate.

Jim


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20061204/9a6f160f/attachment.html


More information about the PyQt mailing list