2 # -*- coding: utf-8 -*-
6 from utils import authenticated, templated
8 web.config.debug = False
14 app = web.application(urls, globals())
15 session = web.session.Session(app, web.session.DiskStore('sessions'))
18 render = web.template.render('templates')
20 template = templated(title="ERROR")
22 return web.internalerror(body)
24 #app.internalerror = internalerror
28 modules = kisspi.load_modules()
32 This is the default handler. All petitions goes trouth this
36 def default(self, args, method="GET"):
38 if url is like /methodname/arg1/arg2...
39 returns the method page
41 returns the default page
44 #TODO pages goes inside a layaout, in body
46 args = args.split('/')
48 m = modules.get(args[0], None)
50 #return m.body().GET()
51 f = kisspi.parse_url(m, '/'.join(args[1:]))
52 # adding kisspi to module class (sessions and others stuff)
54 function = getattr(f, method)
56 returned = function(*args[1:])
63 return self.default(args, method="GET")
65 return self.default(args, method="POST")
67 if __name__ == '__main__':