[Checkins] SVN: five.pt/trunk/ Upgrade to z3c.pt 2.1.

Malthe Borch mborch at gmail.com
Thu Jul 28 15:19:06 EDT 2011


Log message for revision 122402:
  Upgrade to z3c.pt 2.1.

Changed:
  U   five.pt/trunk/CHANGES.txt
  U   five.pt/trunk/setup.py
  U   five.pt/trunk/src/five/pt/expressions.py

-=-
Modified: five.pt/trunk/CHANGES.txt
===================================================================
--- five.pt/trunk/CHANGES.txt	2011-07-28 19:14:29 UTC (rev 122401)
+++ five.pt/trunk/CHANGES.txt	2011-07-28 19:19:05 UTC (rev 122402)
@@ -1,6 +1,10 @@
 Changelog
 =========
 
+In next release...
+
+- Upgrade to newest Zope integration package.
+
 2.1.3 (2011-07-23)
 ~~~~~~~~~~~~~~~~~~
 

Modified: five.pt/trunk/setup.py
===================================================================
--- five.pt/trunk/setup.py	2011-07-28 19:14:29 UTC (rev 122401)
+++ five.pt/trunk/setup.py	2011-07-28 19:19:05 UTC (rev 122402)
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = '2.1.3'
+version = '2.1.4dev'
 
 setup(name='five.pt',
       version=version,
@@ -25,8 +25,7 @@
       zip_safe=False,
       install_requires=[
           'setuptools',
-          'z3c.pt>=2.0',
-          'Chameleon>=2.0',
+          'z3c.pt>=2.1',
           'sourcecodegen',
       ],
       entry_points="""

Modified: five.pt/trunk/src/five/pt/expressions.py
===================================================================
--- five.pt/trunk/src/five/pt/expressions.py	2011-07-28 19:14:29 UTC (rev 122401)
+++ five.pt/trunk/src/five/pt/expressions.py	2011-07-28 19:19:05 UTC (rev 122402)
@@ -26,7 +26,6 @@
 
 from chameleon.astutil import Symbol
 from chameleon.astutil import Static
-from chameleon.astutil import NameLookupRewriteVisitor
 from chameleon.codegen import template
 from chameleon.utils import decode_htmlentities
 from sourcecodegen import generate_code
@@ -207,15 +206,19 @@
     rm = RestrictionMutator()
     rt = RestrictionTransform()
 
-    builtins = dict(
+    # Make copy of parent expression builtins
+    builtins = expressions.PythonExpr.builtins.copy()
+
+    # Update builtins with Restricted Python utility builtins
+    builtins.update(dict(
         (name, static(builtin)) for (name, builtin) in utility_builtins.items()
-        )
+        ))
 
-    def nt(self, node):
+    def rewrite(self, node):
         if node.id == 'repeat':
             node.id = 'wrapped_repeat'
         else:
-            node = self.builtins.get(node.id, node)
+            node = super(UntrustedPythonExpr, self).rewrite(node)
 
         return node
 
@@ -229,8 +232,4 @@
         # Run restricted python transform
         self.rt.visit(value)
 
-        # Rewrite builtins
-        transform = NameLookupRewriteVisitor(self.nt)
-        transform.visit(value)
-
         return value



More information about the checkins mailing list