9/26/2004

Nevow 0.3!

Nevow 0.3 is now out! Go get it!



There has been a lot of development over the past five months, and I have been feeling overdue for doing a Nevow release for a while now. So finally today I mustered the strength to write all the ChangeLogs, READMEs, and update the examples and documentation needed for a release. And what a release it is. This release encompasses some pretty major refactorings and additions:





  • freeform-patterns: This branch rewrote almost all of the freeform form rendering code (now called webform). It makes use of the Nevow pattern/slot paradigm to allow customization of the automatically generated forms down to the finest detail.

  • ubiquitous-context: This branch focused on making the Nevow APIs more consistent by passing a context object to the URL traversal APIs. Nevow keeps track of the objects involved in URL traversal and page rendering using a stack of context objects which you can use to make information available to your components.

  • LivePage improvements: LivePage is now cross browser! Mozilla, Firefox, WinIE6, and Safari browsers are all supported. Adding support for browsers such as Opera and Konqueror should be possible as long as they support XmlHttpRequest. Also, some python-side APIs were added which make mutating the in-browser DOM a breeze: set, append, alert, and call. All these python-side objects take stan, so you can pass them XML fragments composed using Python code or extracted from XML/XHTML documents. No JavaScript skills required!

  • New Fragment class: Fragment is a Page base class which implements just those APIs required to expose data_* and render_* methods in a stan tree. It's now easy to break out your frequently used components into self-contained classes, instantiate and return them from a Page.render_* method or even another Fragment.render_* method.

  • url.URL improvements: Some new APIs make it easy to manage view state using query arguments rather than server-side sessions, which expire and aren't friendly with the back button.

  • nevow.canvas: In the tradition of LivePage comes the experimental Canvas module, which gives you a server-side Python API for drawing lines, curves, and text in the browser, with control over line thickness, border color, and opacity. Canvas gives you a socket you can keep open as long as you need to draw animations in the client browser.

  • XML Compliance: xmlfile and xmlstring now properly retain doctypes, comments, and xmlns attributes.

  • IFoo(ctx) syntax: ctx.locate(IFoo) has been deprecated in favor of the more uniform adaption syntax IFoo(ctx).

  • WSGI Implementation: This release contains a simple, incomplete WSGI application implementation. It is now possible to use Nevow to render CGI or WSGI pages without Twisted installed.

  • guard improvements: guard.SessionWrapper now works properly when it is installed in locations other than the root.

  • Chatola: Chatola, the LivePage demonstration application, has bloomed into a fully operational web-based chat server!

  • inevow.IQ: The Interface for Querying is the beginnings of a DOM querying API. Currently, it contains only the patternGenerator, onePattern, and allPatterns APIs.




Visit the web site for more information about Nevow.



7/05/2004

Canvas

Dave Hyatt has been writing about the features which have been added to WebKit to support the Dashboard in Tiger, and today he writes about a spookily familiar new feature -- the canvas.



I say it is spooky because a few weeks ago, I had the great idea to expose the Flash MX drawing API to Python on the server side using Nevow. It really was a great idea, too. In less than a week, I had a working implementation and a nice demo application, which I wrote about here.



The original idea was not to specifically have Flash glue, but to devise a server side api for drawing which would use whatever client side drawing technology was available. I originally thought of SVG as the non-flash example, but the WebKit canvas would be excellent glue to write a Nevow canvas implementation with. It would provide some things that Flash currently does not (if only on Safari), such as better integration with actual HTML.



6/13/2004

Weird Weather

A few days ago, we woke up to 96 degree weather, with 80% humidity. This is a very rare thing for up north here. It wasn't stifling, although it was much nicer outside than in, so I decided to go for a little swim. It turned into more of a wade than a swim. Lake Superior always stays cold, no matter how warm it is out, and I couldn't bring myself to jump all the way in.



Within an hour, the temperature had dropped to 80 degrees. Within another hour, the temperature was 70. The change was so fast that I went from having all the windows and doors in the house open to closing them all.



Unfortunately, this phenomenon hasn't repeated itself. It has been overcast and in the 60s for a few days now. Today, I am going to drive down to Midland to stay with my Dad for a month, while Ari goes to California to help her parents move. It's amazing what a difference a four hour drive makes. We'll certainly be needing the air conditioning this summer.



5/11/2004

Mr. Bald Eagle

A bald eagle lives somewhere around here. Arianna and I have seen him a few times. I saw him once last November, flying over the house on a blustery gust of wind. Ari saw him again in the middle of winter, along with my Dad, again flying directly over the house.


Today, Arianna spotted him again. He was flying low over the lake, being chased by a flock of seagulls. I ran downstairs and grabbed the binoculars, and went out on the breakwall to try to catch a glimpse of him. He was sitting on a sandbar a couple hundred yards north of the house, pecking at something on the ground and looking over his shoulder at the huge crowd of seagulls which were keeping their distance. I suspect he had caught a fish, and the seagulls were pretty pissed off about not getting any.


I wish we could have gotten a picture, but he was too far away. Hopefully Ari's next camera will be telephoto capable so we can get some nice shots of far-away stuff.



5/02/2004

Debugging JavaScript

One of the things I hate about web development is the absolute pain in the ass that is JavaScript. It's not a terribly bad language in itself, with a decent anonymous function syntax and prototype-based object system (even if it's completely useless because there is no object database). But the fact that errors often pass silently and the debugging tools available are tedious and a pain to use makes developing with JS almost unbearable. I have often wished for the staple, the crutch of development in tool-poor environments, of the 'print' statement.


Here is how to configure Mozilla so that calls to 'dump()' will show up in the console:


Fire up Mozilla and type 'about:config' in the url bar.


Right click and choose 'New->Boolean'


Type 'browser.dom.window.dump.enabled'


Type 'true'


Start Mozilla from a shell, and you will finally be able to debug complex javascripts by printing things to the console using the 'dump' function.


By the way, to start Mozilla from the Terminal on Mac OS X, execute the binary:


'Mozilla.app/Contents/MacOS/mozilla-bin'