[Zope3-checkins] CVS: Zope3/src/zope/app/content - fssync.py:1.12
sql.py:1.9 zpt.py:1.17
Jim Fulton
jim at zope.com
Sun Sep 21 13:32:23 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/content
In directory cvs.zope.org:/tmp/cvs-serv13558/src/zope/app/content
Modified Files:
fssync.py sql.py zpt.py
Log Message:
No-longer use context wrappers.
=== Zope3/src/zope/app/content/fssync.py 1.11 => 1.12 ===
--- Zope3/src/zope/app/content/fssync.py:1.11 Sat Jun 7 02:37:23 2003
+++ Zope3/src/zope/app/content/fssync.py Sun Sep 21 13:31:52 2003
@@ -18,7 +18,6 @@
from zope.app.fssync.classes import ObjectEntryAdapter, AttrMapping
from zope.app.interfaces.fssync import IObjectFile, IContentDirectory
-from zope.app.context import ContextWrapper
from zope.interface import implements
class FileAdapter(ObjectEntryAdapter):
@@ -43,7 +42,6 @@
def contents(self):
result = []
for name, object in self.context.items():
- object = ContextWrapper(object, self.context, name=name)
result.append((name, object))
return result
=== Zope3/src/zope/app/content/sql.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/content/sql.py:1.8 Fri Jun 13 13:41:15 2003
+++ Zope3/src/zope/app/content/sql.py Sun Sep 21 13:31:52 2003
@@ -159,13 +159,13 @@
from zope.interface import implements
from zope.component import getService
-from zope.context import ContextMethod, ContextProperty
from zope.app.cache.caching import getCacheForObj, getLocationForCache
from zope.app.interfaces.content.file import IFileContent
from zope.app.interfaces.content.sql import ISQLScript, MissingInput
from zope.app.rdb import SQLCommand
from zope.app.rdb import queryForResults
+from zope.app.container.contained import Contained
unparmre = re.compile(r'([\000- ]*([^\000- ="]+))')
parmre = re.compile(r'([\000- ]*([^\000- ="]+)=([^\000- ="]+))')
@@ -635,7 +635,7 @@
commands['sqlgroup' ] = SQLGroup
-class SQLScript(SQLCommand, Persistent):
+class SQLScript(SQLCommand, Persistent, Contained):
implements(ISQLScript, IFileContent)
@@ -691,12 +691,8 @@
connection = connection_service.getConnection(self.connectionName)
return connection
- getConnection = ContextMethod(getConnection)
-
# See zope.app.interfaces.content.sql.ISQLScript
- # We need to preserve the context for connectionName, so we make it
- # a ContextProperty instead of a property
- connectionName = ContextProperty(_getConnectionName, _setConnectionName)
+ connectionName = property(_getConnectionName, _setConnectionName)
def __call__(self, **kw):
'See zope.app.interfaces.rdb'
@@ -742,7 +738,5 @@
cache.set(result, location, {'query': query})
return result
- __call__ = ContextMethod(__call__)
-
valid_type = {'int':1, 'float':1, 'string':1, 'nb': 1}.has_key
=== Zope3/src/zope/app/content/zpt.py 1.16 => 1.17 ===
--- Zope3/src/zope/app/content/zpt.py:1.16 Tue Sep 16 18:00:07 2003
+++ Zope3/src/zope/app/content/zpt.py Sun Sep 21 13:31:52 2003
@@ -18,8 +18,6 @@
from persistence import Persistent
-from zope.context import ContextMethod
-from zope.context import getWrapperContainer
from zope.proxy import removeAllProxies
from zope.security.proxy import ProxyFactory
@@ -32,10 +30,11 @@
from zope.app.interfaces.file import IReadFile, IWriteFile, IFileFactory
from zope.interface import implements
+from zope.app.container.contained import Contained
__metaclass__ = type
-class ZPTPage(AppPT, PageTemplate, Persistent):
+class ZPTPage(AppPT, PageTemplate, Persistent, Contained):
implements(IZPTPage, IRenderZPTPage)
@@ -64,19 +63,17 @@
context.evaluateInlineCode = self.evaluateInlineCode
return context
- def pt_getContext(wrapped_self, instance, request, **_kw):
+ def pt_getContext(self, instance, request, **_kw):
# instance is a View component
- self = removeAllProxies(wrapped_self)
+ self = removeAllProxies(self)
namespace = super(ZPTPage, self).pt_getContext(**_kw)
- namespace['template'] = wrapped_self
+ namespace['template'] = self
namespace['request'] = request
namespace['container'] = namespace['context'] = instance
return namespace
- pt_getContext = ContextMethod(pt_getContext)
-
def render(self, request, *args, **keywords):
- instance = getWrapperContainer(self)
+ instance = self.__parent__
request = ProxyFactory(request)
instance = ProxyFactory(instance)
@@ -88,7 +85,8 @@
return self.pt_render(namespace)
- render = ContextMethod(render)
+ source = property(getSource, setSource, None,
+ """Source of the Page Template.""")
class SearchableText:
More information about the Zope3-Checkins
mailing list