[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/app/ Removed unneeded removeAllProxies calls.

Jim Fulton jim at zope.com
Fri Aug 20 14:20:15 EDT 2004


Log message for revision 27191:
  Removed unneeded removeAllProxies calls.
  


Changed:
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/ftp/__init__.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/pagetemplate/engine.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/zptpage/zptpage.py


-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/ftp/__init__.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/ftp/__init__.py	2004-08-20 18:20:07 UTC (rev 27190)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/ftp/__init__.py	2004-08-20 18:20:12 UTC (rev 27191)
@@ -18,7 +18,6 @@
 """
 from zope.interface import implements
 from zope.component import queryAdapter
-from zope.proxy import removeAllProxies
 from zope.publisher.interfaces.ftp import IFTPPublisher
 
 from zope.app.filerepresentation.interfaces import IReadFile, IWriteFile
@@ -159,10 +158,10 @@
     def _overwrite(self, name, instream, start=None, end=None, append=False):
         file = self._dir[name]
         if append:
-            reader = removeAllProxies(IReadFile(file, None))
+            reader = IReadFile(file, None)
             data = reader.read() + instream.read()
         elif start is not None or end is not None:
-            reader = removeAllProxies(IReadFile(file, None))
+            reader = IReadFile(file, None)
             data = reader.read()
             if start is not None:
                 prefix = data[:start]

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/pagetemplate/engine.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/pagetemplate/engine.py	2004-08-20 18:20:07 UTC (rev 27190)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/pagetemplate/engine.py	2004-08-20 18:20:12 UTC (rev 27191)
@@ -28,7 +28,6 @@
 
 from zope.component.exceptions import ComponentLookupError
 from zope.exceptions import NotFoundError
-from zope.proxy import removeAllProxies
 from zope.security.untrustedpython import rcompile
 from zope.security.proxy import ProxyFactory
 from zope.security.untrustedpython.builtins import SafeBuiltins
@@ -107,15 +106,11 @@
 
     def evaluateMacro(self, expr):
         macro = Context.evaluateMacro(self, expr)
-        macro = removeAllProxies(macro)
         return macro
 
     def translate(self, msgid, domain=None, mapping=None, default=None):
-        # When running Zope, request is a Proxy, but no mutation is done here,
-        # so it is safe to remove all proxies
-        request = removeAllProxies(self.request)
         return translate(msgid, domain, mapping,
-                         context=request, default=default)
+                         context=self.request, default=default)
 
     evaluateInlineCode = False
 

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/zptpage/zptpage.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/zptpage/zptpage.py	2004-08-20 18:20:07 UTC (rev 27190)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/zptpage/zptpage.py	2004-08-20 18:20:12 UTC (rev 27191)
@@ -17,7 +17,6 @@
 """
 from persistent import Persistent
 
-from zope.proxy import removeAllProxies
 from zope.security.proxy import ProxyFactory
 from zope.interface import implements
 from zope.pagetemplate.pagetemplate import PageTemplate
@@ -62,8 +61,7 @@
 
     def pt_getContext(self, instance, request, **_kw):
         # instance is a View component
-        # we need removeAllProxies() to make super work
-        namespace = super(ZPTPage, removeAllProxies(self)).pt_getContext(**_kw)
+        namespace = super(ZPTPage, self).pt_getContext(**_kw)
         namespace['template'] = self
         namespace['request'] = request
         namespace['container'] = namespace['context'] = instance



More information about the Zope3-Checkins mailing list