Tuesday, December 20, 2005

Mantissa 0.4.1 Released!

I bet you thought I was done! Well, this is the last one for tonight, I promise, and believe me, I saved the best for last. Mantissa 0.4.1 brings some really fantastic features.

First up is the Tabular Data Browser. This is some pretty awesome stuff. Basically it is not even worth trying to describe with words. Go signup for a free ClickChronicle account and see for yourself. After you have accumulated a few clicks, you'll be able to browse them and page around and so forth: the HTML interface which allows you to do this is the TDB Controller. It is an Athena Widget that lets one page through the results of an Axiom query. The columns are customizable. The actions are customizable. The skin is customizable. All you have to do to get one of these things in your Mantissa application is instantiate TabularDataView with the customizations you desire and drop it onto a page someplace. Bam.

So now you're really excited about using the TDB. You need to write a Mantissa application before you can take advantage of it, though. Fortunately, the other big improvement in this release is that writing a Mantissa application has gotten way easier. What you do now is write an IOffering plugin. It looks something like this:

from axiom import iaxiom, scheduler, userbase
from xmantissa import website, offering, provisioning
from clickchronicle import clickapp, publicpage, prods
import clickchronicle

chronicler = provisioning.BenefactorFactory(
name = u'clickchronicle',
description = u'An application with which to chronicle the clicks of you.',
benefactorClass = clickapp.ClickChronicleBenefactor)

clicks = provisioning.BenefactorFactory(
name = u'clickchronicle-clicks',
description = u'Add some clicks to the click limit',
benefactorClass = prods.ClickIncreaser,
dependencies = [chronicler])

plugin = offering.Offering(
name = u"ClickChronicle",

description = u"""
To-morrow, and to-morrow, and to-morrow,
Creeps in this petty pace from day to day,
To the last syllable of recorded time;
And all our yesterdays have lighted fools
The way to dusty death. Out, out, brief candle!
Life's but a walking shadow; a poor player,
That struts and frets his hour upon the stage,
And then is heard no more: it is a tale
Told by an idiot, full of sound and fury,
Signifying nothing.

siteRequirements = [
(iaxiom.IScheduler, scheduler.Scheduler),
(userbase.IRealm, userbase.LoginSystem),
(None, website.WebSite)],

appPowerups = [

benefactorFactories = [chronicler, clicks])

Actually, it might look exactly like this. This is the actual ClickChronicle IOffering plugin. Note that it is essentially all content: the boilerplate consists almost exclusively of importing modules and appeasing the Gods of Python syntax. This plugin assembles all the pieces which make up ClickChronicle into a coherent unit which can be deployed on a Mantissa server.

siteRequirements enumerate which must be available from the "site store", which contains such things as the credentials database and the webserver configuration. appPowerups defines which Powerups are required by the "app store", at least one of which is created for each application (ie, ClickChronicle); these can (and in this case, do) define the look of the public page for this application, as well as any other behavior which is not clearly attributable to a particular user.

benefactorFactories, predictably, defines a list of factories which create benefactor objects. A benefactor in Mantissa is an Item responsible for endowing a user with new functionality. In the case of ClickChronicle, there are two kinds of benefactors: one endows a user with the application itself, letting them record clicks and later browse them; the other raises the limit on the number of clicks the user is allowed to store. Note also that the latter depends on the former, indicating that benefactors produced by clicks cannot endow a user who has not first been endowed by a benefactor produced by chronicler.

Confused yet? If not, awesome. Go write some kick-ass Mantissa application. If so, don't worry. I'm going to be writing some more in-depth documentation about the Offering system in the days to come.

Axiom 0.4.0 released!

In an effort to overwhelm you (that's right, you buddy), Divmod is happy to announce the release of version 0.4.0 of Axiom, an object-relational database built on the excellent SQLite. Since the last release, Axiom has seen numerous improvements. These include, but are not limited to:

  • A floating point attribute type (use with caution)

  • Support for associating multiple sets of credentials with a single account.

  • Command-line support for interrogating a database regarding its running state as well as support for stopping a running database.

  • Command-line support for extricating an entire user account (credentials, application data, everything) from a site database. Additionally, support for the reverse operation. Taken together these represent an effective user-migration tool.

  • Improved support for certain SQL operations, including sorting by multiple columns, support for DISTINCT queries, and a bug-fix in the sum() aggregate.

Download Axiom 0.4.0 right this very moment.

Divmod Athena Released!

Okay it is not really called Divmod Athena but I am excited so cut me some slack. It is with no small amount of personal satisfaction that I bring you news of the latest and greatest (thus far) Nevow release. Nevow 0.7.0 brings several minor bugfixes and feature enhancements over 0.6.0, but by far the most outstanding change is the work that has been done on nevow.athena.

Athena has two new related features that are really slick. The first is LiveFragment. As Fragments allowed you to define rendering behavior in units smaller than a page, and then combine multiple Fragments to make up a complete page, LiveFragments allow you to define behavior for Client-to-Server and Server-to-Client events which can then be mixed and matched to form the complete page. The second is Nevow.Athena.Widget, a JavaScript class, subclasses of which can be used to track client-side state, handle input events, handle events from the server, and manipulate the portion of the DOM (ie, the UI) for which they are responsible.

I could jabber on for hours at this point, but I'll save that for later. Go look at the examples I linked above, or try them out. Then download Nevow 0.7.0 and write some kick-ass software. I command it.

Divmod Epsilon 0.4.0 released

Dear Intarweb,

Today Divmod released its Epsilon package. Divmod Epsilon is a Python package with some useful stuff. It has a library for doing time. It also has a module for running jobs. And it has some other things like a metaclass for defining modal types and also a Version class.

Epsilon 0.4.0 has two new features. The first new feature is for creating folders with files in them. It uses a string to define the folders and what's in them.

The second new feature is a library for patching old versions of third-party libraries so they have new features or bugfixes. This feature is called hotfix. It does helpful stuff like check versions and only apply the fixes if the library is too old.

I hope you have fun with Epsilon 0.4.0!



Monday, December 19, 2005

Daddy, What Is A Coroutine?

Some people have gotten the idea that Python 2.5 will have coroutines.

Let me just be blunt. Python 2.5 will not have coroutines. PEP 342 even says so. Coroutines can be switched between regardless of their position in the call stack. Python's generators can only switch to the frame directly above them in the stack. The PEP suggests that it will allow coroutines to be implemented using a trampoline (with which, by the way, Guido doesn't even think anyone important will bother). Well, this may be true in the strictest sense - PEP 342 won't prevent you from implementing such a trampoline, but it is already possible to do so.

Don't misinterpret: PEP 342 corrects a long-standing mistake in Python's generators (yield definitely makes sense as an expression). Insofar as it corrects a syntactic inequity in the language, this is a fine PEP. It just has nothing to do with coroutines.

Thursday, December 15, 2005

My Superpower

I have a superpower. Without forethought or planning, I can arrive at a bus station at precisely the moment a bus is preparing to leave, so that I board it and it departs without any delay.

I may have other superpowers: I'm not certain. Among the superpowers I do not possess are:

  • Speed greater than that of a speeding bullet; power greater than that of a locomotive; prowess to leap such that tall buildings are negotiated in one or fewer bounds (all these tested in the proximity of a yellow star; research under the influence of other celestial bodies is ongoing).

  • I am not physically incapable of being drunk.

  • Probably something to do with lemurs. Reports here are sketchy.

That sums up the current state of my superpowers. If you were looking for technical content on Axiom or Mantissa, stay tuned: there is some on the way.