[Checkins] SVN: zc.resourcelibrary/trunk/src/zc/resourcelibrary/ Added support for KSS-resources (.kss); fixed a broken import in the tests.

Malthe Borch mborch at gmail.com
Mon Jan 21 06:40:09 EST 2008


Log message for revision 83055:
  Added support for KSS-resources (.kss); fixed a broken import in the tests.

Changed:
  U   zc.resourcelibrary/trunk/src/zc/resourcelibrary/publication.py
  A   zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests/example/3.kss
  A   zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests/example/my-lib/included.kss
  U   zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests/ftesting.zcml
  U   zc.resourcelibrary/trunk/src/zc/resourcelibrary/zcml.py

-=-
Modified: zc.resourcelibrary/trunk/src/zc/resourcelibrary/publication.py
===================================================================
--- zc.resourcelibrary/trunk/src/zc/resourcelibrary/publication.py	2008-01-21 11:29:30 UTC (rev 83054)
+++ zc.resourcelibrary/trunk/src/zc/resourcelibrary/publication.py	2008-01-21 11:40:08 UTC (rev 83055)
@@ -98,6 +98,8 @@
                                     % (baseURL, lib, file_name))
                         html.append('  -->')
                         html.append('</style>')
+                    elif file_name.endswith('.kss'):
+                        html.append('<link type="text/kss" href="%s/@@/%s/%s" rel="kinetic-stylesheet" />' % (baseURL, lib, file_name))
                     else:
                         # shouldn't get here; zcml.py is supposed to check includes
                         raise RuntimeError('Resource library doesn\'t know how to '

Added: zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests/example/3.kss
===================================================================

Added: zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests/example/my-lib/included.kss
===================================================================
--- zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests/example/my-lib/included.kss	                        (rev 0)
+++ zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests/example/my-lib/included.kss	2008-01-21 11:40:08 UTC (rev 83055)
@@ -0,0 +1,3 @@
+body:click {
+    action-client: alert;
+}
\ No newline at end of file

Modified: zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests/ftesting.zcml
===================================================================
--- zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests/ftesting.zcml	2008-01-21 11:29:30 UTC (rev 83054)
+++ zc.resourcelibrary/trunk/src/zc/resourcelibrary/tests/ftesting.zcml	2008-01-21 11:40:08 UTC (rev 83055)
@@ -20,7 +20,7 @@
   <include package="zope.app.securitypolicy" file="meta.zcml"/>
 
   <securityPolicy
-      component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+      component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
 
   <role id="zope.Anonymous" title="Everybody"
         description="All users have this role implicitly" />

Modified: zc.resourcelibrary/trunk/src/zc/resourcelibrary/zcml.py
===================================================================
--- zc.resourcelibrary/trunk/src/zc/resourcelibrary/zcml.py	2008-01-21 11:29:30 UTC (rev 83054)
+++ zc.resourcelibrary/trunk/src/zc/resourcelibrary/zcml.py	2008-01-21 11:40:08 UTC (rev 83055)
@@ -76,7 +76,7 @@
         factory, required, provided, adapter_name, info)
 
 
-INCLUDABLE_EXTENTIONS = ('.js', '.css')
+INCLUDABLE_EXTENTIONS = ('.js', '.css', '.kss')
 
 class ResourceLibrary(object):
 



More information about the Checkins mailing list