Day 3 – Writing a Spring Python plugin manager
Yesterday, I visited three sessions: RESTful Web Applications with Spring 3.0, Terracotta, and The Dojo Toolkit. I admit that my mind was wandering during the web-based ones. That was because I wanted to work on my command-line, plug-in based tool. So I planted myself in the back of the room for the first and third presentation, plugged into some power, and worked on a plugin.
I managed to get a basic one completed called gen-cherrypy-app. Right now, you can only find it on one of my sandbox branches at https://src.springframework.org/svn/se-springpython-py/sandbox/gregturnquist/sespringpythonpy-83/src/plugins/. In that directory is a command line python tool called coily. If you need help, type:
Currently, it will load plugins found in the current directory. In this case, you can see two in subversion: gen-cherrypy-app as I mentioned before, and noop as a test plugin that takes no arguments. In the future, it would be useful to have official plugins living on SpringSource’s download site, perhaps split into officially supported ones, and others going through the Spring Extensions life cycle.
Back to coily. If you run:
./coily –install-plugin gen-cherrypy-app
…it creates a .springpython folder in your home directory, copies the entire directory of gen-cherrypy-app there, and then next time you run coily –help, it will list it as a viable command-line option.
What does this plugin do? The idea for this plugin was inspired by Graeme’s presentation on Grails where he built a twitter-like site in 40 minutes.
./coily –gen-cherrypy-app twitter
That will generate a directory called twitter, which contains a Spring Python-based CherrypPy skeleton app called twitter.py plus some support files. Several toolsets are proving the value of auto-skeleton apps: RoR, Grails, and Turbogears to name a few. Spring Python can use that too.
Spring Python hasn’t yet made it safe for the fairies, so I think users deserve all the help they can get wiring up spring python security.
But more than anything, this helps set the stage for other useful plugins that the community can identify as useful for adoption of Spring Python. I hope I have whetted your appetite. Now…time to get ready for a couple of presentations!