[PyKDE] IOSlaves in Python?

David Boddie david at boddie.org.uk
Fri Jun 27 19:40:00 BST 2003


On Thursday 26 June 2003 23:19, Jim Bublitz wrote:

> On Thursday June 26 2003 10:42, David Boddie wrote:

> > There are quite a few small examples in the kioslave
> > subdirectory in kdebase, including the minimal "about" slave.
> > As usual, a direct translation reveals some differences
> > between the way these things work in different environments.
>
> There are a couple of tutorials at:
>
> http://www.heise.de/ct/english/01/05/242/
> http://developer.kde.org/documentation/design/kde/ioslaves/framework.html
> http://developer.kde.org/documentation/design/kde/ioslaves/introduction.html

Yes, I'd seen these. They appeared to be aimed at the developer who will be
using rather than developing IOSlaves.

> The second is older and may be a little obsolete. If they don't
> help, they should at least give you an idea where to dig through
> the KDE source code (eg KIO::Job, KIO::Scheduler). The
> KIO::Scheduler docs also have a little more info. (I assume you
> have the KDE Libs Class Ref - if not you should get a copy. You
> can find it on www.kde.org under Documentation in the Developers
> sections). KIO::Job is in jobclasses.[h, cpp], along with a
> large number of KIO::Job subclasses.

Thanks for the tips. There appears to be a tool for testing IOSlaves in
kdelibs/kio/tests/ directory which I'll look at. It'll be easier than using
Konqueror to test with.

Initial results with kioslavetest indicate that I can return the MIME type and
some basic text in response to a "get" operation. I wonder what else Konqueror
is expecting that I can't see at the moment.

> I'm not sure if there's some sort of registration procedure. Just
> from the bits and pieces I've read, there are limits on the
> number of slaves, and they can be re-used. There does appear to
> be a requirement for a 'Protocol" file.

I was hoping that I could start up the IOSlave before it is required but
the SlaveBase class requires the names of two files which typically get
created in /tmp/ksocket-<user>/ which I believe are socket-related.

> It appears there are several different ways to access slaves, and
> some of this may be mixing up the different methods.

I need to learn more about this, clearly.

> > I link in the libkdecorecmodule and libkiocmodule at compile
> > time and they appear to be able to find what they need at run
> > time. Certainly, I don't experience ImportErrors as a result
> > of missing libraries or anything of that nature.
>
> That would seem to indicate you DON'T have a linking problem
> (like needing to expose symbols globally or some such, which is
> the main problem I've had with similar stuff).

My experience with the Netscape plugin protocol is that some shared library
Python modules are quite happy to be imported into that sort of embedded
environment; others take large amounts of time just to find roughly where
they fail. I notice that Qt allows Netscape plugins to be written but that
there are various limitations. Looking at the Qt source code reveals just
how involved that project would turn out to be.

> > I may have to send you what I've written but it'll require
> > modifying to work on another system because I've not used
> > autoconf for the project (I was just prototyping).
>
> I'm really short of time at the moment and not very knowledgeable
> about this anyway. A couple things I would suggest:
>
> a. google on "IOSlave" - it turns up some links both to docs and
> to people who have written IOSlaves. Might be worth contacting
> some of them to see if they can help. I've generally found
> people helpful for inquiries like this. Even if you have to get
> it working in C++ first, it might be worthwhile.

I've done some Googling already, but following up with enquiries is a good
idea as well. I may have to try it.

> b. Try some of the KDE lists - I'm not sure which (and there are
> quite a few). You can get to them via www.kde.org and then look
> around the "Developers" section.

I'll take another look, thanks.

> Despite the fact I'm not being of much help, I'd appreciate if
> you could post any successes or info to this list as I'm sure it
> will come up again in the future. I'd also like to be sure that
> PyKDE is providing everything needed to handle slaves. It seems
> like a nice application to do in Python.

Well, I have some stuff in Python that I'd like to use for this purpose.
If I had to rewrite it in C++ then it wouldn't get done at all.

David




More information about the PyQt mailing list