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

List:       pykde
Subject:    [PyKDE] Directory listing using IOSlaves
From:       jisaitua () covenco ! cl
Date:       2005-12-27 13:34:27
Message-ID: OF1E8AE100.3D96FEE6-ON842570E4.004A1D95-032570E4.004A4D29 () covenco ! cl
[Download RAW message or body]

This is a multipart message in MIME format.

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

Hi,

I want to list directory contents using IOSlaves so I can transparently 
use file://, fish:// or whatever. So my attempt looks like:

        #!/usr/bin/env python

        import sys
        from qt import QObject,SIGNAL
        from kdecore import KApplication,KURL
        from kio import KIO

        class App(KApplication):
                def slotEntries(self,listjob,entries):
                        print('slotEntries called...')
                        print 'entries:', type(entries)
                        #loop comes here to eval entries
                def slotResult(self,listjob):
                        print('slotResult called...')
                        self.quit()

        app=App(sys.argv, "KIO testing")
        urlDir = KURL("fish://jisaitua@localhost/home/")
        #jobs = KIO.listDir(urlDir)
        jobs = KIO.ListJob(urlDir,0)

        QObject.connect(jobs,SIGNAL("entries(KIO::Job*,const 
KIO::UDSEntryList&)"),app.slotEntries);
        QObject.connect(jobs,SIGNAL("result(KIO::Job*)"),app.slotResult);

        app.exec_loop()


When the slot slotEntries is executed, it throws the following:
        entries: <type 'NotImplementedType'>

So it seems that there is no class KIO::UDSEntryList mapped to PyKDE, but 
in the PyKDE documentation there IS documentation for KIO::ListJob, so 
maybe the problem is another one.

My technical specs:
        OS: Kubuntu/Breezy
        KDE: 3.5
        PyKDE: 3.11
        pyQT: 3.14
        SIP: 4.2

Any help is appreciated!
Thank you.
JIS.

P.D: This are my first steps in python and kde programming, so please be 
patient. Thank you!

 
--=_alternative 004A4D28032570E4_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="Courier New">Hi,</font>
<br>
<br><font size=2 face="Courier New">I want to list directory contents using
IOSlaves so I can transparently use file://, fish:// or whatever. So my
attempt looks like:</font>
<br>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; #!/usr/bin/env
python</font>
<br>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; import
sys</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; from
qt import QObject,SIGNAL</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; from
kdecore import KApplication,KURL</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; from
kio import KIO</font>
<br>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; class
App(KApplication):</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; def slotEntries(self,listjob,entries):</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print('slotEntries
called...')</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print
'entries:', type(entries)</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #loop
comes here to eval entries</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; def slotResult(self,listjob):</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print('slotResult
called...')</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.quit()</font>
<br>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; app=App(sys.argv,
&quot;KIO testing&quot;)</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; urlDir
= KURL(&quot;fish://jisaitua@localhost/home/&quot;)</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; #jobs
= KIO.listDir(urlDir)</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; jobs
= KIO.ListJob(urlDir,0)</font>
<br>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; \
QObject.connect(jobs,SIGNAL(&quot;entries(KIO::Job*,const \
KIO::UDSEntryList&amp;)&quot;),app.slotEntries);</font> <br><font size=2 \
face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; \
QObject.connect(jobs,SIGNAL(&quot;result(KIO::Job*)&quot;),app.slotResult);</font> \
<br> <br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; \
app.exec_loop()</font> <br>
<br>
<br><font size=2 face="Courier New">When the slot slotEntries is executed,
it throws the following:</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; entries:
&lt;type 'NotImplementedType'&gt;</font>
<br>
<br><font size=2 face="Courier New">So it seems that there is no class
KIO::UDSEntryList mapped to PyKDE, but in the PyKDE documentation there
IS documentation for KIO::ListJob, so maybe the problem is another one.</font>
<br>
<br><font size=2 face="Courier New">My technical specs:</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; OS:
Kubuntu/Breezy</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; KDE:
3.5</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; PyKDE:
3.11</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; pyQT:
3.14</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; SIP:
4.2</font>
<br>
<br><font size=2 face="Courier New">Any help is appreciated!</font>
<br><font size=2 face="Courier New">Thank you.</font>
<br><font size=2 face="Courier New">JIS.</font>
<br>
<br><font size=2 face="Courier New">P.D: This are my first steps in python
and kde programming, so please be patient. Thank you!</font>
<br>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; </font>
--=_alternative 004A4D28032570E4_=--



_______________________________________________
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