Python Programming, news on the Voidspace Python Projects and all things techie.

Images & Wax

emoticon:pill In getting the new themes plugin [1] to work for Firedrop2, we needed to update an image displayed on a panel. (We use the Wax GUI toolkit.) At first it didn't work, at least not on Windoze. Sad

The answer (of course!) was to remove the old image object before adding the new one. Lest this be of interest to anyone else, the following code will display images from a subdirectory (called images). To display a new image, press the "update" button. Smile

import os
from wax import *

the_dir = 'images'

class MainFrame(Frame):

    def Body(self):
        p = FlexGridPanel(self, rows=6, cols=3, hgap=5, vgap=2)

        b = Button(p, 'update')
        b.OnClick = self.update

        p[0, 0] = Label(p, "  ", border=5)
        p[1, 0] = Label(p, "An Image:", border=5)
        p[2, 0] = Label(p, "  ", border=5)
        p[1, 1] = b

        self.vp = vp = VerticalPanel(p)
        p[1, 5] = vp

        self.AddComponent(p, expand='both')

        self.p = p

        self.files = [os.path.join(the_dir, e) for e in os.listdir(the_dir)]
        self.count = 1

    def update(self, event=None):
        index = self.count % len(self.files)
        image = self.files[index]

        self.bitmap = Image(image).ConvertToBitmap()
        bmp = Bitmap(self.vp, self.bitmap)

        items = self.vp.GetSizerItems()
        if items:
            self.vp.ReplaceComponent(items[0], bmp, destroy=1)

        self.count += 1

app = Application(MainFrame, direction='v')


This requires Wax 0.3.32 (or more recent) which added GetSizerItems.

[1]It has several themes to choose from when creating a new blog, and shows a preview of all the different themes.

Like this post? Digg it or it.

Posted by Fuzzyman on 2006-06-02 23:02:11 | |

Categories: , ,

Look in my Toolbox

emoticon:programs The last time I had to re-install windows remembering all the programs I needed was a nightmare. Confused

I've put together a list of all the programs and utilities that I use regularly. This list serves two purposes. First I hope it is either useful, interesting or provocative. Second, it is a place for me to keep a list of all the programs I use.

Programs & Tools

Most of these tools are shareware or freeware, but there are one or two commercial programs I use regularly. I obviously choose free and open source code wherever possible.

Like this post? Digg it or it.

Posted by Fuzzyman on 2006-06-01 22:50:25 | |

Categories: , ,

Mobile VoIP

emoticon:mobile Rene Tse has written a new article on VoIP.

Mobile VoIP - Voice Over Wi-Fi

VoIP really is about mobility. This article is about using Wi-Fi enabled devices capable of Voice Over IP. It provides a mini tutorial on how to install four VoIP applications on Linux, Apple Mac or Windows operating systems.


Oh and by the way, my insomnia has caused a 'possibly interesting' blog entry about two factoids from my childhood, over in my Personal Blog.

It doesn't deserve an entry here, but it's kind-of-almost-techie, so I thought I would mention it.

Like this post? Digg it or it.

Posted by Fuzzyman on 2006-05-31 23:55:58 | |

Categories: , ,

Haloscan Comments

emoticon:globepage I use Haloscan to enable (and manage) comments on this blog.

The major advantage of Haloscan is that it is very easy to integrate with Firedrop2 (or any other blog system for that matter). I also get very few spam comments.

Up until recently I thought that the major downside was that comments only lasted a few months. Stewart Midwinter recently pointed out to me that for only $12 you can upgrade your account which has all sorts of benefits. (Including email notification of comments and the ability to customize the comments pages). Upgrading even brings previously deceased comments back from the dead. Laughing

I'm still vaguely looking for a solution I can run on my server (that doesn't use PHP and is easy to run behind lighttpd).

This is because Haloscan still has the following limitations :

  • Comments are included via a javascript link, which means they aren't crawled by search engines [1]
  • Comments pages aren't integrated into the rest of my site
  • Threaded comments would be nicer
  • I'd still rather have control of the data myself

Suggestions welcomed. Very Happy

[1]Perhaps this is why spam is low ?

Like this post? Digg it or it.

Posted by Fuzzyman on 2006-05-30 10:46:23 | |

Categories: ,

Planet Firedrop

emoticon:note Planet Firedrop is now online. This is an aggregator for blogs powered by the Firedrop2 Blog Client.

If you're using Firedrop, give me a heads-up and I'll add your feed.

I've just added Digg it and it links to all of my entries. You can do the same by adding the following snippets to your entry_template.html :

<small>Like this post? <a
<% permalink(entry.get_id()) %>">Digg it</a> or < a
<% permalink(entry.get_id()) %>"> it</a>.</small>

The lines here are split to fit on the page: rejoin them to make it work.

I'm still hoping to a new release out real soon, hopefully tomorrow. The new release will include a Themes Plugin created by Stewart Midwinter. This has several pre-created (and damn fine looking) styles for new blogs. There are also separate RSS feeds generated for each category, contributed by Davy Mitchell.

You can see the page (html) it generates at :

RSS Feeds by Category

The code that does this is already in subversion.

Shortly after this will be another release, hopefully including a podcast plugin created by Ron Stephens and myself, blog statistics by Davy Mitchell [1], and possibly a tagging plugin by Davy Mitchell and myself. Smile

[1]Blog statistics like these.

Like this post? Digg it or it.

Posted by Fuzzyman on 2006-05-29 01:23:33 | |

Categories: ,

A Few Bits of News

emoticon:file1 Ok, so this is a rubbish title for a blog entry. The alternative was me making all these snippets separate entries and thinking up witty and incisive titles for each one.

Found It

I've finally found out why the PyPy folks are working on an LLVM backend.

From Getting Started with PyPy :

The emphasis of the LLVM backend is to compile standalone executables.

My interest was piqued when I realised the LLVM compiled bytecode to C. This is very interesting (although hardly news to the rest of you I guess...).

Google Summer of Code

The PSF Google Summer of Code Projects have been announced. They're even more exciting than last year. Smile

There is a good mix of "domain specific" projects, and ones of general interest. Particularly interesting ones include :

Other slightly more esoteric projects include :

  • Enhancing ShedSkin, the Python to C++ compiler.
  • Work on a PyPy CLI backend (for .NET).
  • Work involving the javascript backend of PyPy.

It looks like both Shedskin and PyPy are scarily close to becoming useful projects. Smile

Slightly worrying is the project to integrate cheesecake with the cheeseshop. This seems to add extra hoops for package creators to jump through. (On top of the setuptools overhead we're already acquiring.) For example, from a naive reading, it looks like packages that use doctests rather than unittests will be penalised. Confused


The cheesecake team assure me that doctests will be supported. I should have guessed. Smile

One Laptop Per Child

The One Laptop Per Child group have announced a working prototype.

There is an interesting pledge at the Pledge Bank, with lots of people committing to buy one for $300. That's only if they are made available commercially of course. Smile

The point of the pledge is both to support the project, and to encourage them to make it available to buy.

You will be delighted to know that Python is used extensively in the project, particularly in the user interface IIUC.

Wireless Fun

After my recent experiences with bluetooth, it was with some trepidation that I bought a Linksys Compact Wireless G Router.

This gives me wireless networking and as a router, is a first step to a home network. But how much of a nightmare would it be to get it working ?

Amazingly it worked first time. NTL, for all their administrative incompetence, make it very easy to connect via a router and setting up the Linksys device (including encrypting and protecting the wireless network) was extremely easy. Phew. Smile

Learning Python

ResolverSystems is looking to hire a senior developer. The main qualification is the ability of the candidate to fit in with our development methodology.

Previous knowledge of Python is not a requirement. Why not ? Well, the other developers (none of whom used Python prior to this project, other than me of course) have found Python so straightforward that they think any competent programmer can learn Python in a matter of days. Cool

Firedrop On the Move

There are now two more developers actively working on Firedrop2, the blog program. There ought to be several new plugins and other improvements soon.

In fact the main reason for this blog entry was to test the code currently in the subversion repository.

If you're reading this, then it works fine. Wink

Like this post? Digg it or it.

Posted by Fuzzyman on 2006-05-28 23:37:05 | |

Categories: ,

IronPython & Windows Forms, Part III


This article has moved.

You can find the whole tutorial series at IronPython & Windows Forms.

Like this post? Digg it or it.

Posted by Fuzzyman on 2006-05-27 01:41:33 | |

Categories: , ,

Hosted by Webfaction