• Welcome to Valhalla Legends Archive.
 

Beta release of my framework

Started by Banana fanna fo fanna, December 21, 2003, 11:34 PM

Previous topic - Next topic

Banana fanna fo fanna

http://st0rm.hopto.org/pwa-project.zip

Make sure you have python 2.3 installed, at www.python.org. It would be helpful to know Python, but here is a quick example "Hello World" type of thing:


import pwa

class Hello(pwa.Controller):
   def handle(self, req, name="St0rm"):
       req.write("Hello, " + name)

class Goodbye(pwa.Controller):
   def handle(self, req, name="St0rm"):
       req.write("Goodbye, " + name)

controller = Hello()
goodbye = Goodbye()


Try saving this as hi.pwa, and visiting the urls:
hi.pwa
hi.pwa?name=hax0r
hi.pwa/goodbye
hi.pwa/goodbye?name=hax0r

You get full session variable support by using req.session (a dictionary). There's many more features; once people (hopefully) install it and start playing with it, I'll show you some of the cooler things.