Wed, 25 Jun 2003
Docutils 0.3 is out!

Big thanks to David Goodger for releasing docutils 0.3 (the software that implements reStructuredText). This makes it a lot easier to integrate docutils into a project since there's now an up-to-date static version (for a while we've had to worry about the CVS changing underneath us, which is a pain).

path: /python | permanent link |
Tue, 24 Jun 2003
Handy debugging snippets

From Anthony, btw, for debugging purposes, I recommend the following snippet:

import traceback
def compact_stack():
    stack = traceback.extract_stack()
    stack = [ '%s:%d'%(x[0], x[1]) for x in stack ]
    return "Stack\n" + "\n".join(stack)

I've also used the following as a generic debug() call in Zope code (though any logging package could replace zLOG here):

def debug(*args):
    module, line, function, info = traceback.extract_stack()[-2]
    if len(args) == 1:
        s = pprint.pformat(args[0])
    else:
        s = pprint.pformat(args)
    file = os.path.split(module)
    LOG('\n%s\n in %s, line %s, debug info:'%(module, function, line),
        INFO, '\n'+s)

That traceback.extract_stack function is so useful :)

path: /python | permanent link |
Fri, 20 Jun 2003
Project planning, Python- and now free-software-style

I got enough people bugging me to see the code, so here it is.

path: /python | permanent link |
Web Shootout comments

I've had a couple of emails regarding my posting of the web framework shootout yesterday. It's been pointed out that that page is quite a nice overview in some respects (the examples give a nice up-front indication of what you're in for) but it is not complete and doesn't necessarily present the complete feature set that each framework provides. A more complete overview is available at the python.org wiki Web Programming page. It would be nice to have the examples from the first in the wiki page :)

path: /python | permanent link |
Thu, 19 Jun 2003
New release of WebUnit

If anyone's interested, I just put out version 1.2.2 of WebUnit, my "website unit/regression testing tool". This release has a couple of patches from Roché Compaan.

path: /python | permanent link |
woot! Konqueror native on OSX!

This is some very good news. More Qt/Mac goodness, meaning:

Sam Magnuson from Trolltech already got much of KDE building on Qt/Mac a while ago (screenshots showing Konqueror, Kontact, Games and KOffice). The new license now offered allows to distribute binary builds of KDE for Qt/Mac soon.

from the dot

path: /stuff | permanent link |
Looking to do web stuff with Python?

I just pointed a friend at The Web Framework Shootout which I'd known about but never actually looked at until now. It's definitely my next stop before I develop my next web application. PyPI would probably have turned out slightly differently if I'd gone there first (and had a vague idea of how much web interface I'd end up developing for it - which was obviously more than I'd orignally anticipated ;)

path: /python | permanent link |
Wed, 11 Jun 2003
Project planning, Python-style

I'm leading the development team at Common Ground - both in terms of spec / design and planning the project. I've done this before, and am fairly comfortable doing it, but in this instance I didn't have M$ Project readily at hand when it came to estimating the project timeline. This turned out to be a good thing since I ended up writing a simple task planner in Python. The initial cut took a few hours, and I've been refining it small since then (adding Milestores, and Stuart wrote a gantt chart HTML renderer too).

Stuff the code does:

So it's pretty rough & simple stuff, and modifying the dependencies is a bit of a pain without the visual cues that M$ Project gives (writing a GUI or at least instant-feedback rendering of dependencies would be a next step, and not at all difficult). But even with its simplicity, I've been able to give esitmates of the project's timeline - including being able to trivially pull out or add new team members and quickly show the result (ie. add in anew 'web' capable person). I might look into making an SF project for this... I dunno... I already have too many :)

path: /python | permanent link |
Fri, 06 Jun 2003
Hydra is a very cool product

Collaborative editing over a LAN. Very nice. But I want to do it over a WAN. Does anyone know of a tool like Hydra that will work over a WAN? Linux and/or Mac OSX...

path: /stuff | permanent link |
Thu, 05 Jun 2003
OzZope meeting notes

I gave a presentation about reStructuredText (and ZReST) to the OzZope meeting last night. The presentation went well (there was about a dozen people in attendance, and none appeared to fall asleep). I'll make it available some time soon - well, as soon as I get it out of PowerPoint.

I wanted to write the presentation using my old ReST → PythonPoint tool, and revamped it accordingly. Unfortunately, the handling of images is very poor in PythonPoint (it seems to want to scale them up or something) so I had to ditch that. I was running out of time, and powerpoint was the only viable alternative. An ReST → SlideML converter would be quite possible, I'm sure, so maybe some rainy day soon...

In other news, the OzZope meeting went well, discussing the upcoming Zope3 Sprint and some moves in the schools to get Plone installed for intranet use. We also had a demo of Silva and IRC chat with its creators. That was fun (I was forced to blush at one point when someone realised that I was the Roundup Richard Jones ;)

I'm thinking about adding a BackTalk-like extension to the ZReST product. I've always thought BackTalk is very powerful, and the Zope Book(s) are a testament to that power.

path: /python | permanent link |
Tue, 03 Jun 2003
ZConfig continued, and undo-less stores...

Day two of the ZConfig saga, and I've made some tweaks to the zconfig_schema2html.py script (adding default values, nicer display of python objects) - see the Zope configuration schema.

On the other front, I've determined that there is indeed an undo-less store in Zope 2.7, the BDBMinimalStorage (it even appears in the above cofig schema :). Unfortunately, Zope 2.7 is currently unable to mount the store. I could fall back on DBTab, but I can wait for the support in Zope itself (saving myself the effort of implementing the mounting twice).

I found some documentation for the config vars for BDBMinimalStorage and I'll copy them over to the ZConfig schema. Or perhaps not. The descriptions will appear in three places then, and that seems a little suboptimal.

path: /python | permanent link |
Mon, 02 Jun 2003
Uravelling the ZConfig schema mess

ZConfig is the brand-spanky-new configuration system for Zope 2.7 (and ZODB/ZEO) which cleans up the previously limited, dogs-breakfast approach of configuration that we've all come to love in Zope.

Unfortunately, it's a bit difficult to get into as an end user - there's a whole lot of configuration flexibility now, and there's no real way to actually discover the shape of it all. Nobody seems to have thought it important to actually document all those wonderful new configuration options. OK, that's harsh - they're still in a bit of a state of flux, and there's other more important things to be doing at the moment, I'm sure.

Specifically, I need to figure how to configure a ZODB to be undo-less, then how to configure a ZEO server to serve that and finally how to have a bunch of Zope servers connect to that ZEO server. So far the zope.org site and associated documentation seems to indicate that it's possible, just not how to do it.

So I wrote an introspection tool - after spending a number of hours deciphering the internal storage system of the ZConfig system. The result is zconfig_schema2html.py and a dump of the Zope configuration vars as in the current (today, 2 June 2003) CVS. Run the script in your Zope lib/python directory (or at least have that dir in your Python search path). Some examples:

zconfig_schema2html.py Zope/Startup/zopeschema.xml >Zope_schema.html
zconfig_schema2html.py ZEO/schema.xml >ZEO_schema.html

Can't dump individual components yet - the ZConfig schema parser won't let us. Other enhancements to the dumper would include displaying default values and an indication of where the component XML files for the schema are located. Not sure I can access the information about the latter. It's generally pretty obvious from the data type in question.

Unfortunately my efforts didn't actually help with the question at hand: how to config up an undo-less database in a Zope/ZEO instance. Poking somewhat more I get the distinct impression that the undo-less store doesn't exist anymore, which seems a little wrong. I think (hope) I'm just reading the code wrong. I've never used them before, but I was sure they existed...

Oh, and as per usual I fixed a couple of bugs in Zope along the way ;)

path: /python | permanent link |