comparison contenttransformer/transformers.py @ 0:29805d442afc

initial commit of contenttransformer; still in the stub stage
author k0s <k0scist@gmail.com>
date Mon, 11 Jan 2010 11:32:24 -0500
parents
children 1e2c475015d8
comparison
equal deleted inserted replaced
-1:000000000000 0:29805d442afc
1 import docutils.core
2 from webob import Response
3
4 class Graphviz(object):
5 def __init__(self, content):
6 """create a Graphviz object"""
7
8 def __call__(self, environ, start_response):
9 """return a WSGI response"""
10
11
12 class RestructuredText(object):
13 settings = { 'report_level': 5 }
14
15 def __init__(self, content):
16 """template: genshi(?) template to use (???)"""
17 self.html = docutils.core.publish_string(content,
18 writer_name='html',
19 settings_overrides=self.settings)
20
21 def __call__(self, environ, start_response):
22 """return a WSGI response"""
23 return Response(content_type='text/html', body=self.html)