from tiddlyweb.store import Store from tiddlyweb.web.util import get_serialize_type from tiddlyweb.web.wsgi import HTMLPresenter class GuvPresenter(object): """ Take the core app output, see if it is text/html, and if it is, add some framework. """ def __init__(self, application): self.application = application def __call__(self, environ, start_response): output = self.application(environ, start_response) output = ''.join(output) if environ.has_key('tiddlyweb.title'): return [self._header(environ), output, self._footer(environ)] return output def _header(self, environ): links = '\n'.join(environ['tiddlyweb.links']) return """