[Zope3-checkins] CVS: Zope3/src/zope/app/pagetemplate - engine.py:1.14.2.1 simpleviewclass.py:1.7.10.1 talesapi.py:1.1.14.1 viewpagetemplatefile.py:1.6.10.1
Grégoire Weber
zope@i-con.ch
Sun, 22 Jun 2003 10:24:18 -0400
Update of /cvs-repository/Zope3/src/zope/app/pagetemplate
In directory cvs.zope.org:/tmp/cvs-serv24874/src/zope/app/pagetemplate
Modified Files:
Tag: cw-mail-branch
engine.py simpleviewclass.py talesapi.py
viewpagetemplatefile.py
Log Message:
Synced up with HEAD
=== Zope3/src/zope/app/pagetemplate/engine.py 1.14 => 1.14.2.1 ===
--- Zope3/src/zope/app/pagetemplate/engine.py:1.14 Tue May 20 16:27:28 2003
+++ Zope3/src/zope/app/pagetemplate/engine.py Sun Jun 22 10:23:17 2003
@@ -30,7 +30,7 @@
from zope.tales.tales import Context
from zope.app.traversing.adapters import Traverser
-from zope.proxy.introspection import removeAllProxies
+from zope.proxy import removeAllProxies
from zope.security.proxy import ProxyFactory
from zope.security.builtins import RestrictedBuiltins
from zope.i18n.translate import Translator
@@ -56,7 +56,7 @@
return eval(self._code, vars)
class ZopeContext(Context):
-
+
def setContext(self, name, value):
# Hook to allow subclasses to do things like adding security proxies
Context.setContext(self, name, ProxyFactory(value))
=== Zope3/src/zope/app/pagetemplate/simpleviewclass.py 1.7 => 1.7.10.1 ===
--- Zope3/src/zope/app/pagetemplate/simpleviewclass.py:1.7 Thu May 1 15:35:25 2003
+++ Zope3/src/zope/app/pagetemplate/simpleviewclass.py Sun Jun 22 10:23:17 2003
@@ -20,12 +20,13 @@
from zope.publisher.browser import BrowserView
from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
-from zope.proxy.context import ContextMethod
+from zope.context import ContextMethod
from zope.publisher.interfaces import NotFound
+from zope.interface import implements
class simple(BrowserView):
- __implements__ = IBrowserPublisher, BrowserView.__implements__
+ implements(IBrowserPublisher)
def browserDefault(self, request):
return self, ()
=== Zope3/src/zope/app/pagetemplate/talesapi.py 1.1 => 1.1.14.1 ===
--- Zope3/src/zope/app/pagetemplate/talesapi.py:1.1 Tue Apr 15 14:52:57 2003
+++ Zope3/src/zope/app/pagetemplate/talesapi.py Sun Jun 22 10:23:17 2003
@@ -19,17 +19,54 @@
from zope.app.interfaces.talesapi import IZopeTalesAPI
from zope.app.interfaces.dublincore import IZopeDublinCore
-from zope.component import queryAdapter
+from zope.app.interfaces.size import ISized
+from zope.app import zapi
+from zope.interface import implements
class ZopeTalesAPI(object):
- __implements__ = IZopeTalesAPI
+ implements(IZopeTalesAPI)
def __init__(self, context):
self.context = context
def title(self):
- a = queryAdapter(self.context, IZopeDublinCore)
+ a = zapi.queryAdapter(self.context, IZopeDublinCore)
if a is None:
raise AttributeError, 'title'
return a.title
+ title = property(title)
+
+ def description(self):
+ a = zapi.queryAdapter(self.context, IZopeDublinCore)
+ if a is None:
+ raise AttributeError, 'description'
+ return a.description
+ description = property(description)
+
+ def created(self):
+ a = zapi.queryAdapter(self.context, IZopeDublinCore)
+ if a is None:
+ raise AttributeError, 'created'
+ return a.created
+ created = property(created)
+
+ def modified(self):
+ a = zapi.queryAdapter(self.context, IZopeDublinCore)
+ if a is None:
+ raise AttributeError, 'modified'
+ return a.modified
+ modified = property(modified)
+
+ def name(self):
+ return zapi.name(self.context)
+
+ def title_or_name(self):
+ return getattr(self, 'title', '') or zapi.name(self.context)
+
+ def size(self):
+ a = zapi.queryAdapter(self.context, ISized)
+ if a is None:
+ raise AttributeError, 'created'
+ return a.sizeForDisplay()
+
=== Zope3/src/zope/app/pagetemplate/viewpagetemplatefile.py 1.6 => 1.6.10.1 ===
--- Zope3/src/zope/app/pagetemplate/viewpagetemplatefile.py:1.6 Thu May 1 15:35:25 2003
+++ Zope3/src/zope/app/pagetemplate/viewpagetemplatefile.py Sun Jun 22 10:23:17 2003
@@ -21,7 +21,7 @@
from zope.pagetemplate.pagetemplatefile import PageTemplateFile
from zope.component import getView
from zope.app.pagetemplate.engine import AppPT
-from zope.proxy.context import ContextDescriptor
+from zope.context import ContextDescriptor
class ViewPageTemplateFile(AppPT, PageTemplateFile, ContextDescriptor):
"""Page Templates used as methods of views defined as Python classes.