these commands seem to magically fix for at least 2 test cases:
:set filetype=xml
:filetype indent on
:e
gg=G
Genomics Programming
:set filetype=xml
:filetype indent on
:e
gg=G
#!/usr/bin/python
import web
import random
class hi(object):
def GET(self,who='world'):
web.header('Content-type','text/html')
print "hello %s" % who
class bye(object):
def GET(self,who='world'):
web.header('Content-type','text/plain')
print "bye %s" % who
for c in web.ctx.env:
print c, web.ctx.env[c]
class other(object):
def GET(self):
web.header('Content-type','text/plain')
for c in web.ctx:
print c, web.ctx[c]
urls = ( '/bye/(.*)', 'bye'
,'/hi/(.*)' , 'hi'
, '/.*' , 'other')
class RandomWare(object):
def __init__(self, app):
self.your_app = app;
def __call__(self,environ,start):
environ['hello'] = random.random()
return self.your_app(environ,start)
def random_mw(app):
return RandomWare(app)
if __name__ == "__main__":
web.run(urls,globals(),random_mw)
#!/usr/bin/python
import web
class hi(object):
def GET(self,who='world'):
web.header('Content-type','text/html')
print "hello %s" % who
class bye(object):
def GET(self,who='world'):
web.header('Content-type','text/html')
print "bye %s" % who
urls = ( '/bye/?(.*)', 'bye'
,'/hi/?(.*)' , 'hi' )
application = web.wsgifunc(web.webpyfunc(urls, globals()))