File: configapps.py

package info (click to toggle)
python-plaster-pastedeploy 0.5-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 316 kB
  • sloc: python: 639; makefile: 12
file content (14 lines) | stat: -rw-r--r-- 467 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class SimpleApp(object):
    def __init__(self, global_conf, local_conf, name):
        self.global_conf = global_conf
        self.local_conf = local_conf
        self.name = name

    def __call__(self, environ, start_response):
        start_response('200 OK', [('Content-type', 'text/html')])
        return ['I am: ', name]
        
    def make_app(cls, global_conf, **conf):
        return cls(global_conf, conf, 'basic')
    make_app = classmethod(make_app)