[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"> \
#!/usr/bin/env python</font>
<br>
<br><font size=2 face="Courier New"> import
sys</font>
<br><font size=2 face="Courier New"> from
qt import QObject,SIGNAL</font>
<br><font size=2 face="Courier New"> from
kdecore import KApplication,KURL</font>
<br><font size=2 face="Courier New"> from
kio import KIO</font>
<br>
<br><font size=2 face="Courier New"> class
App(KApplication):</font>
<br><font size=2 face="Courier New">
def slotEntries(self,listjob,entries):</font>
<br><font size=2 face="Courier New">
print('slotEntries
called...')</font>
<br><font size=2 face="Courier New">
print
'entries:', type(entries)</font>
<br><font size=2 face="Courier New">
#loop
comes here to eval entries</font>
<br><font size=2 face="Courier New">
def slotResult(self,listjob):</font>
<br><font size=2 face="Courier New">
print('slotResult
called...')</font>
<br><font size=2 face="Courier New">
self.quit()</font>
<br>
<br><font size=2 face="Courier New"> \
app=App(sys.argv, "KIO testing")</font>
<br><font size=2 face="Courier New"> urlDir
= KURL("fish://jisaitua@localhost/home/")</font>
<br><font size=2 face="Courier New"> #jobs
= KIO.listDir(urlDir)</font>
<br><font size=2 face="Courier New"> jobs
= KIO.ListJob(urlDir,0)</font>
<br>
<br><font size=2 face="Courier New"> \
QObject.connect(jobs,SIGNAL("entries(KIO::Job*,const \
KIO::UDSEntryList&)"),app.slotEntries);</font> <br><font size=2 \
face="Courier New"> \
QObject.connect(jobs,SIGNAL("result(KIO::Job*)"),app.slotResult);</font>
<br>
<br><font size=2 face="Courier New"> \
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"> entries:
<type 'NotImplementedType'></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"> OS:
Kubuntu/Breezy</font>
<br><font size=2 face="Courier New"> KDE:
3.5</font>
<br><font size=2 face="Courier New"> PyKDE:
3.11</font>
<br><font size=2 face="Courier New"> pyQT:
3.14</font>
<br><font size=2 face="Courier New"> 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"> </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