Being a Geek, Python, Flash and a flashticle
I was just recently talking to a friend about an old project that i keep hacking on, never releaseing anything, when he showed some interest. Well, this fired me all up and i’ve been going crazy looking into all kinds of web application tools again. One thing that i have been looking for is a remoting package that runs via Python. While there are several open source implementations with AMFPHP being the most well known, there is only this alpha version for python. Its old, unsupported and just doesn’t look that appealing.
While searching around, i rediscovered flashticle, which i actually already knew about, but had never taken the time to check out. Foolish me!
At first the plug-in for TurboGears was the most interesting thing, but, unfortunatly, TG has undergone some major changes, and the TG plugin is no longer working. All was not lost, i had also noticed a wsgi gateway, and i decided to see if i could figure out how to get it running.
With Python 2.5 including a wsgi server in the standard library, i was able to get the server (wsgiref) from the cheeseshop.
With these in hand, a little experimentation and some time, i was able to get it running with a minimum of fuss. Wicked! Flash remoting using a Python backend!
This was not, however, enough. I was also thinking about other web-related applications which i might want to deploy. Having read a bunch about how wsgi makes it so easy to create your own web-framework, i decided to give it a go - the best way to learn something is to actually try it out.
So far i’ve only included a basic dispatcher (selector), but hooking it in with the already working flash remoting gateway was a no brainer. Here is the current code::
from wsgiref.simple_server import make_server, demo_app
import flashticle.wsgigateway
gate = flashticle.wsgigateway.paste_app({'service HelloWorld':"HelloWorld:HelloWorld"})
from selector import Selector
s = Selector()
s.add('/flashgateway', GET=gate, POST=gate)
httpd = make_server('', 8000, s)
print "Serving HTTP on port 8000..."
httpd.serve_forever()
Anyway, this is pretty cool shit, and i’m pumped about having remoting available in Python. Thank you Bob!
That is all.

Leave a comment