About

Welcome to Panela, Matt Harrison's take on mostly Open Source, Linux, Python, innovation in those areas, other buzzwords and Dick Proenneke. It comes complete with the illustrations as needed. Note the opinions expressed here are merely my opinions and not the opinions of my employer.

about Matt

Calendar

««Jul 2009»»
SMTWTFS
    1234
567891011
12131415161718
19202122232425
262728293031

Mailing List

My RSS Feeds








New SAM release with AJAX!

posted 2005.10.29 Sat
I've updated SAM to now include a webserver. This brings along with it a new AJAXy interface (I guess this is sort of a followup to my AJAX post, Alex (dojo) and Bob (mochikit) were the only open source people who responded to my requests for comments (one commercial company started the interview process but ended up not responding...). I'll probably end up using both in the future, though right now I'm only using MochiKit). I think this architecture is pretty cool (and useful/necessary in SAM's case). Instead of adding a thick client to SAM (which has some drawbacks since SAM will happily run from the command line on Windows, Linux and Macs) which would increase the download by a significant amount as well as increase complexity, and in some cases (headless machines) not even work, I'm doing something a little different. This first developmental release (0.30) starts up a prototyped webserver (hacked out using WebStack) when passed in the "--ajax" parameter. It will also start up a browser and point it to "localhost:8080/index". The initial interface allows you to choose the components to run and see the results. This is all pure python right now (well, AJAX is compliments of MochiKit (javascript)), but I could envision other applications using this sort of architecture. For example, anything that one stores on a thumb drive could probably be adapted to use this sort of architecture. That way even though you run on different machines (Mac, Windows or Linux) you can still access the data in the same way (provided you have python installed on those machines (the only one where this is probably an issue is Windows and it's trivial to use py2exe in those cases and create a small ~2Meg exe)) as well as remotely if needed. For people who want to see a simple example of JSON/Ajax/MochiKit in action feel free to download the .30 release. This architecture should be really straightforward for people who want to understand and look under the hood of the server side of AJAX. I'm not suggesting using this server side code in any production environment. Basically I took WebStack and created a simple endpoint that dispatches everything through it (I'm pretty sure this is the wrong way to do it, but it took about 150 lines for the whole server, which includes the ajax endpoints). I need to look at Twisted (a good reason to buy the book?), or possibly stripped down versions of Django or TurboGears. I want to keep everything in pure python and as small as possible, but I'd like to re-use others code/best practices when possible. The end goal is the .40 release(SAM is adopting a even is stable odd is development numbering scheme). Hopefully one will be able to have SAM servers that can discover others (possibly through pyzeroconf) and allow IT folks to control multiple instances from a single browser. Anyway as you can tell, I think this could turn out to be pretty cool. Feel free to provide feedback (if you think I'm just jumping on the AJAX bandwagon) or if you like the mini-local-client-server-ajax-gui architecture.

tags:                      

links: digg this    del.icio.us    reddit




1. Paul Boddie left...
2005.10.31 Mon 1:01 pm

With WebStack there is no wrong way to do it! ;-) (Well, there could be, I suppose, but what you've done seems pretty good to me. Watch out for a new release of my XSLTools/XSLForms toolkit for some other relevant work, too.)


2. Shannon -jj Behrens left...
2005.10.31 Mon 2:30 pm :: http://jjinux.blogspot.com

Indeed, I do like the mini-local-client-server-ajax-gui architecture. If you optionally use XUL, you suddenly have a really nice, cross-platform, development environment for desktop GUI's. Since the server runs locally, you can access the local filesystem, etc. I wanted to write an article about this idea, but I think the rest of the world beat me to it :-/


3. Matt left...
2005.10.31 Mon 3:41 pm

Paul- I guess, I'd like to be able to give WebStack a directory (of static items like js, css or img) and just say "serve this directory". Whereas right now that kind of feels like a hack.

JJ- Thanks. I've heard about the xulrunner stuff, but I'd still like to not limit the end user on browsers (though they still have to use a recent "Web 2.0" enabled browser). Overall, I think that Javascript is still the weak point in the whole development cycle. It's still painful to debug, and seems hacky (object orientation seems like a afterthought much like php, mistyped variable names go through unnoticed (no errors!)). Oh and never have a "<div id="foo"/>" (single open/close div tag) cause you'll get wierd behavior! But I digress.....


4. Matt left...
2005.11.07 Mon 12:08 pm

Someone else is thinking along the same lines (but they call it a "kludge"). Here's their post on slashdot


5. Paul Boddie left...
2005.11.29 Tue 8:16 am

I really should check your blog more often! You can serve items from a directory using the DirectoryResource in WebStack.Resources.Static. This is better documented in the upcoming WebStack 1.1 release, but if you've any other comments or advice, I'd be happy to hear it!


6. Matt left...
2005.11.29 Tue 8:46 am

Paul - Thanks for the pointer. That sounds exactly like what I wanted.


7. Paul Boddie left...
2005.11.30 Wed 11:07 am

Here's a link to the relevant documentation:

http://www.boddie.org.uk/python/WebStack-docs/directory-resource.html

I was tempted to add some simple WebDAV support for such resources, but that's not at the top of my long list of things to do, I'm afraid.


8. Matt left...
2005.11.30 Wed 11:54 am

Great. Thanks Paul.

Re: WebDAV, it's not at the top of my list either. So I don't mind if you leave it off ;)


9. Matt left...
2005.12.01 Thu 6:36 pm

Seems like Miguel (of gnome fame) is also thinking along the same lines.... (though in some weird language... asp.net???)