Python Programming, news on the Voidspace Python Projects and all things techie.
As you probably know, Armin Rigo has been working on PyPY. Armin is the genius behind psyco - the Python specializing compiler, which speeds up the execution of most Python programs with a single extension module.
His efforts to improve Python have now switched to PyPY and psyco is not being actively developed. Added to which the latest stable version of psyco is only available from SVN - and not as a precompiled binary. The psyco website says :
"...use the Subversion repository, which is now considered as the most official and stable (and probably ultimate) version of Psyco."
I've compiled the one from SVN for Windoze. Currently only Python 2.3 - but tonight I'll build it for Python 2.4. The Python 2.3 windoze installer is built using MingW32 . The one for Python 2.4 will be built using the Microsoft optimising compiler.
To download, go to my Python Modules Page.
Python 2.4 installer is now available as well.
|||Done by following the instructions at Building Python Extensions Using MingW32.|
Goodness and Badness
The release of ConfigObj/Pythonutils updates was better than expected. Two hundred downloads in the first twenty-four hours. It's hardly a Turbogears - but it's still better than expected. The four mentions I got on Daily-Python URL (yes, four - count 'em) certainly helped.
So that's all the goodness. The badness is that I have some kind of annoying concurrency problem with my CGIs.
Someone has been spamming my guestbooks (time to put in that DNS blacklist check). Some of the posts must have hit at the same time - and caused both my guestbook files  to get overwritten. Bang goes a years worth of guestbook entries.
Luckily I've got a backup of most of them. I'm getting a similar problem on the downman stats which tell me how many downloads I'm getting. They keep resetting - the data file must be getting wiped by simultaneous writes.
sigh - time to think about using a database maybe ? The trouble is that plain text is so much easier....
|||Stored as plain text files.|
Firedrop and Podcasting
The next step is that Ron Stephens and I are working on a Podcasting plugin. This will allow you to generate proper RSS for podcasts from the Firedrop GUI.
It shouldn't be too tricky and is a nice little extension of the usefulness of Firedrop. I haven't done any podcasting myself... but if there was a simple toolchain I would be tempted...
I Love the Smell of a Fresh Release
Ok you Python junkies - I've just done a fresh release.
ConfigObj has two bug fixes - one trivial, and one worth updating for. ConfigObj is pretty thoroughly tested now, so I've marked it stable .
|||Caveat Emptor notwithstanding......|
|||cgiutils isn't just useful for CGI programming. It has some handy functions for sending emails for example.|
Wrestling a Tortoise
I edit my code in three different physical locations, on three different machines. The main workstation (my computer at home) has no connection to the internet.
Unfortunately some of the svn files are system files, and on my work machine (where I upload from) I run as power user, not administrator. I think this means that DirWatcher is failing to properly copy across changed svn files (or they're getting out of sync because path names don't match). Anyway, whatever the reason I sometimes end up in a position where TortoiseSVN will report that a resource appears to be out of date and point blank refuse to commit changes.
I tried umpteen things and tore out great clumps of hair. I've just found a solution.
- Get SVN to create a patch against the whole working copy.
- Check out a fresh working copy.
- Apply the patch.
- Commit the changes and delete the old working copy.
|||Thanks to those friendly folk at Python-Hosting.com, rest2web and ConfigObj have a repository.|
|||To be fair, I doubt it's at all the fault of TortoiseSVN. Even if I was hitting the command line directly I'd probably still have the same problems.|
Voidspace Competition Winner
I've just announced the winners of the Voidspace MirrorMask competition.
To see the results - check out the Voidspace Blogspot.
I've finally managed to spend some time on rest2web - and productive time it was too.
I've just checked in the changes to SVN. Since the last release the following changes have now been made. They're not yet documented because I'm refactoring the documentation substantially.
The changes include :
You can now specify files to be copied from the source directory to your build directory (the file keyword in your restindex, which can be used multiple times). Paths are relative to the source file and will always be copied into the same directory as the target file.
You can now specify the order that pages appear in the sections and the indextree data structure. This is the section-pages keyword.
It takes a comma separated list as the argument. The first one must be the section followed by a list of pages. You use the filename (minus the '.txt') to specify a page. You don't have to list all the pages - but including a page that doesn't exist will raise an error.
To specify the default section do :
section-pages: ,page1, page2, page3
Over the weekend I found and squashed four bugs. All of these were discovered in the process of making the updates. They were all bugs in obscure places - but nasty enough if they ever bit you. Note that this means that the arguments taken by the print_crumbs function has changed (it still has sensible defaults though).
- Fixed bug where some restindex options from one section could leak into another.
- Fixed bug where having include: No for an index page would cause a crash.
- Fixed bug where subsections with a different file-extension were broken.
- Bugfix (and change) to the print_crumbs function. It now takes an 'item' value - this means the last item is also a list item.
Create a file called __prune__ in a directory and it won't be scanned or included. This messes up auto-built indexes of course, but can be used to stop rest2web rebuilding certain parts of your site.
Hmm.. I didn't actually do much here, but amidst all the changes (including moving to py2exe 0.6.3) - rest2web now builds and works using py2exe. The appropriate py2exe-setup.py is in SVN.
This work is licensed under a Creative Commons Attribution-Share Alike 2.0 License.