Author: jvloothuis
Date: Mon May 14 10:02:49 2007
New Revision: 43343

Added:
   kukit/kss.pylons/trunk/kss/pylons/rendering.py
Modified:
   kukit/kss.pylons/trunk/kss/pylons/__init__.py
   kukit/kss.pylons/trunk/kss/pylons/rendering.txt
   kukit/kss.pylons/trunk/kss/pylons/tests.py
Log:
Added rendering function. This makes it easier to render a response from a
commandset.


Modified: kukit/kss.pylons/trunk/kss/pylons/__init__.py
==============================================================================
--- kukit/kss.pylons/trunk/kss/pylons/__init__.py       (original)
+++ kukit/kss.pylons/trunk/kss/pylons/__init__.py       Mon May 14 10:02:49 2007
@@ -4,3 +4,5 @@
 except ImportError:
     from pkgutil import extend_path
     __path__ = extend_path(__path__, __name__)
+
+from rendering import render_kss_response

Added: kukit/kss.pylons/trunk/kss/pylons/rendering.py
==============================================================================
--- (empty file)
+++ kukit/kss.pylons/trunk/kss/pylons/rendering.py      Mon May 14 10:02:49 2007
@@ -0,0 +1,7 @@
+from paste.wsgiwrappers import WSGIResponse
+
+def render_kss_response(commands):
+    response = WSGIResponse()
+    response.write(commands.render())
+    response.headers['Content-Type'] = 'text/xml'
+    return response

Modified: kukit/kss.pylons/trunk/kss/pylons/rendering.txt
==============================================================================
--- kukit/kss.pylons/trunk/kss/pylons/rendering.txt     (original)
+++ kukit/kss.pylons/trunk/kss/pylons/rendering.txt     Mon May 14 10:02:49 2007
@@ -26,4 +26,4 @@
 It will also render the commands.
 
   >>> ''.join(list(response.get_content()))
-  some kss stuff
+  '...commands...'

Modified: kukit/kss.pylons/trunk/kss/pylons/tests.py
==============================================================================
--- kukit/kss.pylons/trunk/kss/pylons/tests.py  (original)
+++ kukit/kss.pylons/trunk/kss/pylons/tests.py  Mon May 14 10:02:49 2007
@@ -4,7 +4,7 @@
 def test_suite():
     suite = unittest.TestSuite((
         doctest.DocFileSuite(
-            'helpers.txt', 'middleware.txt',
+            'helpers.txt', 'middleware.txt', 'rendering.txt',
             package='kss.pylons',
             optionflags=doctest.ELLIPSIS,
         ),
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to