[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] How to pass UDSEntry to KIO.NetAccess.stat
From:       jisaitua () covenco ! cl
Date:       2006-12-04 17:32:57
Message-ID: OF027A6D34.B399D373-ON8425723A.0060403C-0325723A.0060DC9B () covenco ! cl
[Download RAW message or body]

This is a multipart message in MIME format.

This is a multipart message in MIME format.
--=_alternative 0060DC990325723A_=
Content-Type: text/plain; charset="US-ASCII"

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

Thank you Jim for the info!

Regards,
Juan Ignacio Saitua.




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


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






On Monday 04 December 2006 05:59, jisaitua@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



--=_alternative 0060DC990325723A_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="Courier New">ok, let's wait for the next release
then...</font>
<br>
<br><font size=2 face="Courier New">Thank you Jim for the info!</font>
<br>
<br><font size=2 face="Courier New">Regards,</font>
<br><font size=2 face="Courier New">Juan Ignacio Saitua.</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Jim Bublitz &lt;jbublitz@nwinternet.com&gt;</b>
</font>
<p><font size=1 face="sans-serif">12/04/06 02:07 PM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
jbublitz@nwinternet.com</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td valign=top><font size=1 face="sans-serif">pykde@mats.imk.fraunhofer.de</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td valign=top><font size=1 face="sans-serif">jisaitua@covenco.cl</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td valign=top><font size=1 face="sans-serif">Re: [PyKDE] How to pass UDSEntry
to KIO.NetAccess.stat</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>On Monday 04 December 2006 05:59, jisaitua@covenco.cl
wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I'm a newbie in python and pyKde and was trying to use NetAccess.stat.
My<br>
&gt; problem is, that the UDSEntry parameter returns always empty.<br>
&gt;<br>
&gt; I tried with the following sample code:<br>
&gt; ------------------------------------------------<br>
&gt; import sys<br>
&gt; from kio import KIO<br>
&gt; from kdecore import KApplication,KURL<br>
&gt;<br>
&gt; app=KApplication(sys.argv, &quot;KIO.NetAccess Testing&quot;)<br>
&gt; myURL = KURL(&quot;/usr/bin/python&quot;)<br>
&gt;<br>
&gt; if KIO.NetAccess.exists(myURL):<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; udsEntry=[]<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; if KIO.NetAccess.stat(myURL, udsEntry):<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #It doesn't
get any UDSAtom...len (udsEntry) is always 0<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;Number
of UDSAtoms in UDSEntry: &quot;, len(udsEntry)<br>
&gt; ------------------------------------------------<br>
&gt;<br>
&gt; Maybe what I'm doing is completely wrong, I don't know, so please
help! I<br>
&gt; really would appreciate any hint.<br>
&gt;<br>
&gt; P.D: I'm using kubuntu 6.10 with pykde-3.15.2, pyqt-3.16, sip-4.4.5
and<br>
&gt; kde-3.5.5<br>
<br>
The KIO.NetAccess.stat methods in PyKDE aren't coded correctly. The list
(your <br>
udsEntry variable) should be a return value, not an argument. It should
be:<br>
<br>
 &nbsp; result, udsEntry = KIO.NetAccess.stat (myURL)<br>
<br>
where result is bool and udsEntry is a Python list. But the error is in
PyKDE, <br>
and if you re-code that way it still won't work until I fix PyKDE.<br>
<br>
I'm still trying to get a snapshot together with some other fixes, but
it will <br>
be a while - not in the next few days at any rate.<br>
<br>
Jim<br>
<br>
</tt></font>
<br>
--=_alternative 0060DC990325723A_=--



_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic