[PyKDE] Directory listing using IOSlaves

jisaitua at covenco.cl jisaitua at covenco.cl
Tue Dec 27 13:34:27 GMT 2005


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!

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20051227/868f4d1c/attachment.html


More information about the PyQt mailing list