Author: jvloothuis
Date: Sun May 13 23:37:22 2007
New Revision: 43324

Added:
   kukit/kss.pylons/trunk/kss/
   kukit/kss.pylons/trunk/kss/__init__.py
   kukit/kss.pylons/trunk/kss/pylons/
   kukit/kss.pylons/trunk/kss/pylons/__init__.py
   kukit/kss.pylons/trunk/kss/pylons/helpers.py
   kukit/kss.pylons/trunk/kss/pylons/helpers.txt
   kukit/kss.pylons/trunk/kss/pylons/middleware.txt
   kukit/kss.pylons/trunk/kss/pylons/rendering.txt
   kukit/kss.pylons/trunk/kss/pylons/tests.py
   kukit/kss.pylons/trunk/setup.py
Log:
Start of Pylons integration code


Added: kukit/kss.pylons/trunk/kss/__init__.py
==============================================================================
--- (empty file)
+++ kukit/kss.pylons/trunk/kss/__init__.py      Sun May 13 23:37:22 2007
@@ -0,0 +1,6 @@
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+    __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+    from pkgutil import extend_path
+    __path__ = extend_path(__path__, __name__)

Added: kukit/kss.pylons/trunk/kss/pylons/__init__.py
==============================================================================
--- (empty file)
+++ kukit/kss.pylons/trunk/kss/pylons/__init__.py       Sun May 13 23:37:22 2007
@@ -0,0 +1,6 @@
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+    __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+    from pkgutil import extend_path
+    __path__ = extend_path(__path__, __name__)

Added: kukit/kss.pylons/trunk/kss/pylons/helpers.py
==============================================================================
--- (empty file)
+++ kukit/kss.pylons/trunk/kss/pylons/helpers.py        Sun May 13 23:37:22 2007
@@ -0,0 +1,28 @@
+def kss_javascripts():
+    tag = '<script type="text/javascript" src="/kss/%s"></script>'
+    scripts = [
+        'utils.js',
+        'kukit.js',
+        'actionreg.js',
+        'base2-dom-fp.js',
+        'commandprocessor.js',
+        'commandreg.js',
+        'cssQuery.js',
+        'dom.js',
+        'errors.js',
+        'eventreg.js',
+        'MochiKit.js',
+        'oper.js',
+        'plugin.js',
+        'providerreg.js',
+        'requestmanager.js',
+        'resourcedata.js',
+        'sarissa.js',
+        'selectorreg.js',
+        'serveraction.js',
+        'tokenizer.js',
+        'forms.js',
+        'kssparser.js',
+    ]
+
+    return ''.join([tag % script for script in scripts])

Added: kukit/kss.pylons/trunk/kss/pylons/helpers.txt
==============================================================================
--- (empty file)
+++ kukit/kss.pylons/trunk/kss/pylons/helpers.txt       Sun May 13 23:37:22 2007
@@ -0,0 +1,11 @@
+=======
+Helpers
+=======
+
+The KSS helpers for Pylons generate can be used to easily generate templates.
+
+One of the most important helpers is the KSS Javascript include generater.
+
+  >>> from kss.pylons.helpers import kss_javascripts
+  >>> kss_javascripts()
+  '<script type="text/javascript"...</script>'

Added: kukit/kss.pylons/trunk/kss/pylons/middleware.txt
==============================================================================
--- (empty file)
+++ kukit/kss.pylons/trunk/kss/pylons/middleware.txt    Sun May 13 23:37:22 2007
@@ -0,0 +1,12 @@
+==========
+Middleware
+==========
+
+Middleware in this case referes to WSGI middleware.
+
+KSS Javascripts
+===============
+
+Because KSS is in part a client framework we need to load some Javascript on
+the client side. This middleware component makes sure that all lookups for KSS
+related scripts are properly loaded from disk.

Added: kukit/kss.pylons/trunk/kss/pylons/rendering.txt
==============================================================================
--- (empty file)
+++ kukit/kss.pylons/trunk/kss/pylons/rendering.txt     Sun May 13 23:37:22 2007
@@ -0,0 +1,29 @@
+=========
+Rendering
+=========
+
+Because a KSS response differs from a normal HTML page we need to setup the
+response object just right. To make this easier for the developer we provide a
+simple function to render a command structure directly to a Pylons response.
+
+The following code shows you how to use such a system.
+
+  >>> from kss.commands import KSSCommands
+  >>> commands = KSSCommands()
+
+Now you should normally add some commands here using a command set (for more
+information see kss.commands). We will render the (empty) commands object
+directly to a response.
+
+  >>> from kss.pylons import render_kss_response
+  >>> response = render_kss_response(commands)
+
+A KSS response should have a content-type set.
+
+  >>> response.headers['Content-Type']
+  'text/xml'
+
+It will also render the commands.
+
+  >>> ''.join(list(response.get_content()))
+  some kss stuff

Added: kukit/kss.pylons/trunk/kss/pylons/tests.py
==============================================================================
--- (empty file)
+++ kukit/kss.pylons/trunk/kss/pylons/tests.py  Sun May 13 23:37:22 2007
@@ -0,0 +1,12 @@
+import unittest
+import doctest
+
+def test_suite():
+    suite = unittest.TestSuite((
+        doctest.DocFileSuite(
+            'helpers.txt',
+            package='kss.pylons',
+            optionflags=doctest.ELLIPSIS,
+        ),
+    ))
+    return suite

Added: kukit/kss.pylons/trunk/setup.py
==============================================================================
--- (empty file)
+++ kukit/kss.pylons/trunk/setup.py     Sun May 13 23:37:22 2007
@@ -0,0 +1,38 @@
+from setuptools import setup, find_packages
+import sys, os
+
+version = '0.1'
+
+setup(name='kss.pylons',
+      version=version,
+      description="Pylons integration for KSS (Kinetic Style Sheets)",
+      long_description="""\
+""",
+      # Get more strings from 
http://www.python.org/pypi?%3Aaction=list_classifiers
+      classifiers=[
+        "Programming Language :: Python",
+        "Topic :: Software Development :: Libraries :: Python Modules",
+        ],
+      keywords='',
+      author='KSS Project',
+      author_email='[EMAIL PROTECTED]',
+      url='http://kssproject.org',
+      license='GPL',
+      packages=find_packages(exclude=['ez_setup']),
+      namespace_packages=['kss'],
+      include_package_data=True,
+      zip_safe=False,
+      install_requires=[
+          'setuptools',
+          'kss.pluginregistry>=dev',
+          'kss.commands>=dev',
+      ],
+      entry_points="""
+      # -*- Entry points: -*-
+      """,
+      test_suite='kss.pylons.tests.test_suite',
+      dependency_links=[
+        
'https://codespeak.net/svn/kukit/kss.commands/trunk#egg=kss.commands-dev',
+        
'https://codespeak.net/svn/kukit/kss.pluginregistry/trunk#egg=kss.pluginregistry-dev',
+      ]
+)
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to