root/galaxy-central/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/paster_templates/paste_deploy/+package+/sampleapp.py_tmpl @ 3

リビジョン 3, 0.8 KB (コミッタ: kohda, 14 年 前)

Install Unix tools  http://hannonlab.cshl.edu/galaxy_unix_tools/galaxy.html

行番号 
1import cgi
2from paste.deploy import CONFIG
3
4def application(environ, start_response):
5    # Note that usually you wouldn't be writing a pure WSGI
6    # application, you might be using some framework or
7    # environment.  But as an example...
8    start_response('200 OK', [('Content-type', 'text/html')])
9    greeting = CONFIG['greeting']
10    content = [
11        '<html><head><title>%s</title></head>\n' % greeting,
12        '<body><h1>%s!</h1>\n' % greeting,
13        '<table border=1>\n',
14        ]
15    items = environ.items()
16    items.sort()
17    for key, value in items:
18        content.append('<tr><td>%s</td><td>%s</td></tr>\n'
19                        % (key, cgi.escape(repr(value))))
20    content.append('</table></body></html>')
21    return content
22
23                       
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。