[Checkins] SVN: grokcore.chameleon/trunk/ using components from chameleon directly and only use path and provider expressions from z3c.pt, upgrade to newes chameleon and zpt

Christian Klinger cklinger at novareto.de
Mon Dec 12 10:39:17 UTC 2011


Log message for revision 123712:
  using components from chameleon directly and only use path and provider expressions from z3c.pt, upgrade to newes chameleon and zpt

Changed:
  U   grokcore.chameleon/trunk/buildout.cfg
  U   grokcore.chameleon/trunk/src/grokcore/chameleon/README.txt
  U   grokcore.chameleon/trunk/src/grokcore/chameleon/components.py
  U   grokcore.chameleon/trunk/src/grokcore/chameleon/configure.zcml

-=-
Modified: grokcore.chameleon/trunk/buildout.cfg
===================================================================
--- grokcore.chameleon/trunk/buildout.cfg	2011-12-12 10:31:11 UTC (rev 123711)
+++ grokcore.chameleon/trunk/buildout.cfg	2011-12-12 10:39:17 UTC (rev 123712)
@@ -7,10 +7,10 @@
 
 [versions]
 grokcore.chameleon = 
-Chameleon = 2.0-rc9
+Chameleon = 2.6.2
 ordereddict = 1.1
 unittest2 = 0.5.1
-z3c.pt = 2.0-rc1
+z3c.pt = 2.1.5
 
 [interpreter]
 recipe = zc.recipe.egg
@@ -22,4 +22,4 @@
 eggs =
    grokcore.chameleon
    grokcore.chameleon[test]
-defaults = ['--tests-pattern', '^f?tests$', '-v']
+defaults = ['--tests-pattern', '^f?tests$', '-v', '-c']

Modified: grokcore.chameleon/trunk/src/grokcore/chameleon/README.txt
===================================================================
--- grokcore.chameleon/trunk/src/grokcore/chameleon/README.txt	2011-12-12 10:31:11 UTC (rev 123711)
+++ grokcore.chameleon/trunk/src/grokcore/chameleon/README.txt	2011-12-12 10:39:17 UTC (rev 123712)
@@ -350,8 +350,8 @@
         </div>
     <BLANKLINE>
         <!-- We support `not` -->
-        <div></div>
-        <div></div>
+        <div>False</div>
+        <div>False</div>
         <div>True</div>
         <div>True</div>
     <BLANKLINE>

Modified: grokcore.chameleon/trunk/src/grokcore/chameleon/components.py
===================================================================
--- grokcore.chameleon/trunk/src/grokcore/chameleon/components.py	2011-12-12 10:31:11 UTC (rev 123711)
+++ grokcore.chameleon/trunk/src/grokcore/chameleon/components.py	2011-12-12 10:39:17 UTC (rev 123712)
@@ -16,12 +16,20 @@
 from grokcore.component import GlobalUtility, implements, name
 from grokcore.view import interfaces
 from grokcore.view.components import GrokTemplate
-from z3c.pt.pagetemplate import ViewPageTemplate, ViewPageTemplateFile
+from chameleon.zpt.template import PageTemplate, PageTemplateFile
+from chameleon.tales import PythonExpr
+from chameleon.tales import StringExpr
+from chameleon.tales import NotExpr
+from chameleon.tales import ExistsExpr
+from chameleon.tales import ImportExpr
+from chameleon.tales import StructureExpr
+from z3c.pt.expressions import PathExpr, ProviderExpr
 
+
 #
 # Chameleon Zope Page Templates...
 #
-class PageTemplate(ViewPageTemplate):
+class PageTemplate(PageTemplate):
     """A `z3c.pt` page template suitable for use with views.
 
     This page template implementation is different from `z3c.pt`
@@ -32,17 +40,19 @@
     """
     default_expression = 'python' # Use the chameleon default
 
-    def _pt_get_context(self, view, request, kwargs):
-        """Get context vars for a template.
+    expression_types = {
+        'python': PythonExpr,
+        'string': StringExpr,
+        'not': NotExpr,
+        'path': PathExpr,
+        'provider': ProviderExpr,
+        'exists': ExistsExpr,
+        'import': ImportExpr,
+        'structure': StructureExpr,
+        }
 
-        Inject ``static`` var in template namespace.
-        """
-        context = super(PageTemplate, self)._pt_get_context(
-            view, request, kwargs)
-        context.update(kwargs)
-        return context
 
-class PageTemplateFile(PageTemplate, ViewPageTemplateFile):
+class PageTemplateFile(PageTemplate, PageTemplateFile):
     """A `z3c.pt` page template file suitable for use with views.
 
     This implementation is different from `z3c.pt` implementation in

Modified: grokcore.chameleon/trunk/src/grokcore/chameleon/configure.zcml
===================================================================
--- grokcore.chameleon/trunk/src/grokcore/chameleon/configure.zcml	2011-12-12 10:31:11 UTC (rev 123711)
+++ grokcore.chameleon/trunk/src/grokcore/chameleon/configure.zcml	2011-12-12 10:39:17 UTC (rev 123712)
@@ -4,7 +4,6 @@
 
   <include package="grokcore.view" file="meta-minimal.zcml" />
   <include package="grokcore.view" />
-  <include package="z3c.pt" />
   <grok:grok package="." />
 
 </configure>



More information about the checkins mailing list