changeset 2:1e2c475015d8

restructured text now works
author k0s <k0scist@gmail.com>
date Thu, 14 Jan 2010 00:09:06 -0500
parents aa491070ccf3
children 1a267297f779
files contenttransformer/transformers.py example.ini
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/contenttransformer/transformers.py
+++ b/contenttransformer/transformers.py
@@ -1,23 +1,25 @@
 import docutils.core
+import subprocess
 from webob import Response
 
 class Graphviz(object):
     def __init__(self, content):
         """create a Graphviz object"""
+        raise NotImplementedError # TODO
 
     def __call__(self, environ, start_response):
         """return a WSGI response"""
    
 
 class RestructuredText(object):
     settings = { 'report_level': 5 }
 
     def __init__(self, content):
         """template: genshi(?) template to use (???)"""
         self.html = docutils.core.publish_string(content,
                                                  writer_name='html',
                                                  settings_overrides=self.settings)
 
     def __call__(self, environ, start_response):
         """return a WSGI response"""
-        return Response(content_type='text/html', body=self.html)
+        return Response(content_type='text/html', body=self.html)(environ, start_response)
--- a/example.ini
+++ b/example.ini
@@ -15,8 +15,9 @@ port = 6666
 use = egg:Paste#urlmap
 / = contenttransformer
 
 set debug = false
 
 [app:contenttransformer]
 paste.app_factory = contenttransformer.factory:factory
 transformer.directory = %(here)s/example
+transformer.transforms = *.txt=ReST
\ No newline at end of file