[PyKDE] Re: IOSlaves in Python?

Phil Thompson phil at riverbankcomputing.co.uk
Sun Jun 29 11:08:00 BST 2003


On Sunday 29 June 2003 7:30 am, Jim Bublitz wrote:
> On Saturday June 28 2003 15:13, David Boddie wrote:
> > It's bad form to reply to one's own messages, I know, but I've
> > made some progress and the topic is still warm...
> >
> > > On Fri, 27 Jun 2003 18:35:19, David Boddie wrote:
> > >
> > > On Thursday 26 June 2003 23:19, Jim Bublitz wrote:
> > > > 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.h tml
> > >
> > > Yes, I'd seen these. They appeared to be aimed at the
> > > developer who will be using rather than developing IOSlaves.
> >
> > The c't tutorial actually turned out to be quite useful in the
> > end, although I haven't really found a definitive reference on
> > the subject.
> >
> > > 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 what exactly I did to get through to Konqueror
> > but I can now browse an imaginary directory structure stored
> > in a hierarchical list in my SlaveBase subclass.
>
> Cool!
>
> > I'll try implementing a reasonable example IOSlave which
> > provides all the main operations (get, put, copy, etc.) before
> > doing anything really serious.
> >
> > I'd like to distribute this initial IOSlave as an example but
> > it'll need to be configured using autoconf or DistUtils. I
> > once used some sort of KDE project template builder to
> > generate configuration files for a project; can anyone point
> > me in the direction of this tool or even tell me where I'm
> > likely to find it?!
>
> There was a project builder for KDE that bit the dust when they
> changed autoconf versions a while back (a little over a year ago
> I think). I don't know if it's been updated.  Both PyKDE and
> PyQt use qmake and I'm not aware of any problems due to that
> choice - qmake supports a wide array of platforms (if you're not
> familiar with, it's free from TrollTech and the docs are
> included with the rest of the Qt docs). It's considerably easier
> than autoconf and IMHO easier than distutils too.
>
> PyKDE and PyQt use similar versions of build.py to essentially
> replace ./configure and rewrite the qmake files (and then
> generate Makefile via qmake) You're welcome to borrow from
> build.py if you follow the license (GPL'd), although you
> probably won't need to be as complicated. PyQt's version is
> easier to follow; PyKDE's version adds KDE directory locating
> and versioning (and steals a lot of code from the PyQt version).

BTW, having wrapped a simple library for somebody the other week and finding 
that hacking the build.py took longer than writing the .sip files, I realised 
that I had to give more help to extension writers.

The plan is that SIP will also install a sipconfig module that will be 
imported by PyQt's build.py and include, for example, utility functions for 
patching qmake files and Makefiles as well as the obvious information about 
pathnames, version numbers etc. PyQt's build.py will then install a 
pyqtconfig module that will contain additional PyQt specific configuration 
information and can be used by the build/installation scripts of packages 
that import PyQt (eg. PyKDE, PyQwt).

I've only recently started this, but you can have a look by commenting out the 
call to _create_config() in the build.py of the current SIP snapshot.

Phil




More information about the PyQt mailing list