[Checkins] SVN: grok/trunk/ incorporate grokcore.chameleon

Jan-Wijbrand Kolman janwijbrand at gmail.com
Thu Jul 14 09:51:30 EDT 2011


Log message for revision 122230:
  incorporate grokcore.chameleon

Changed:
  U   grok/trunk/CHANGES.txt
  U   grok/trunk/setup.py
  U   grok/trunk/src/grok/configure.zcml
  A   grok/trunk/src/grok/ftests/chameleon/
  A   grok/trunk/src/grok/ftests/chameleon/__init__.py
  A   grok/trunk/src/grok/ftests/chameleon/chameleon_available.py
  A   grok/trunk/src/grok/ftests/chameleon/templates/
  A   grok/trunk/src/grok/ftests/chameleon/templates/available.cpt
  U   grok/trunk/src/grok/ftests/test_grok_functional.py

-=-
Modified: grok/trunk/CHANGES.txt
===================================================================
--- grok/trunk/CHANGES.txt	2011-07-14 13:49:37 UTC (rev 122229)
+++ grok/trunk/CHANGES.txt	2011-07-14 13:51:30 UTC (rev 122230)
@@ -4,6 +4,8 @@
 1.8 (unreleased)
 ================
 
+- Incorporate grokcore.chameleon and have it configured by default.
+
 - Expose the Layout, Page, AddFormPage, EditFormPage, DisplayFormPage and
   FormPage components that are brought by grokcore.layout. The grok variants
   mixin application_url() and flash() functionality typically found in grok's

Modified: grok/trunk/setup.py
===================================================================
--- grok/trunk/setup.py	2011-07-14 13:49:37 UTC (rev 122229)
+++ grok/trunk/setup.py	2011-07-14 13:51:30 UTC (rev 122230)
@@ -42,6 +42,7 @@
     zip_safe=False,
     install_requires=[
         'grokcore.annotation >= 1.1',
+        'grokcore.chameleon',
         'grokcore.component >= 2.3',
         'grokcore.content',
         'grokcore.formlib >= 1.4',

Modified: grok/trunk/src/grok/configure.zcml
===================================================================
--- grok/trunk/src/grok/configure.zcml	2011-07-14 13:49:37 UTC (rev 122229)
+++ grok/trunk/src/grok/configure.zcml	2011-07-14 13:51:30 UTC (rev 122230)
@@ -39,6 +39,7 @@
   <include package="zope.app.wsgi" />
 
   <include package="grokcore.annotation" />
+  <include package="grokcore.chameleon" />
   <include package="grokcore.formlib" />
   <include package="grokcore.json" />
   <include package="grokcore.layout" />

Added: grok/trunk/src/grok/ftests/chameleon/__init__.py
===================================================================
--- grok/trunk/src/grok/ftests/chameleon/__init__.py	                        (rev 0)
+++ grok/trunk/src/grok/ftests/chameleon/__init__.py	2011-07-14 13:51:30 UTC (rev 122230)
@@ -0,0 +1 @@
+# make this directory a package

Added: grok/trunk/src/grok/ftests/chameleon/chameleon_available.py
===================================================================
--- grok/trunk/src/grok/ftests/chameleon/chameleon_available.py	                        (rev 0)
+++ grok/trunk/src/grok/ftests/chameleon/chameleon_available.py	2011-07-14 13:51:30 UTC (rev 122230)
@@ -0,0 +1,22 @@
+"""
+Demonstrate the grokcore.chameleon template component has been registered.
+
+
+  >>> from zope.app.wsgi.testlayer import Browser
+  >>> getRootFolder()["mammoth"] = Mammoth()
+  >>> browser = Browser()
+  >>> browser.open("http://localhost/mammoth/@@index")
+  >>> print browser.contents
+  <html>Mammoth</html>
+
+"""
+import grok
+
+grok.templatedir('templates')
+
+class Mammoth(grok.Model):
+    pass
+
+class Index(grok.View):
+    grok.context(Mammoth)
+    grok.template('available')

Added: grok/trunk/src/grok/ftests/chameleon/templates/available.cpt
===================================================================
--- grok/trunk/src/grok/ftests/chameleon/templates/available.cpt	                        (rev 0)
+++ grok/trunk/src/grok/ftests/chameleon/templates/available.cpt	2011-07-14 13:51:30 UTC (rev 122230)
@@ -0,0 +1 @@
+<html tal:content="context.__class__.__name__"></html>
\ No newline at end of file

Modified: grok/trunk/src/grok/ftests/test_grok_functional.py
===================================================================
--- grok/trunk/src/grok/ftests/test_grok_functional.py	2011-07-14 13:49:37 UTC (rev 122229)
+++ grok/trunk/src/grok/ftests/test_grok_functional.py	2011-07-14 13:51:30 UTC (rev 122230)
@@ -62,6 +62,7 @@
     for name in [
         'application',
         'catalog',
+        'chameleon',
         'errorviews',
         'form',
         'lifecycle',



More information about the checkins mailing list