[Zope3-checkins] CVS: Zope3/src/zope/app/pagetemplate - simpleviewclass.py:1.11 viewpagetemplatefile.py:1.11

Stephan Richter srichter at cosmos.phy.tufts.edu
Mon Mar 29 00:13:08 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/pagetemplate
In directory cvs.zope.org:/tmp/cvs-serv30349/src/zope/app/pagetemplate

Modified Files:
	simpleviewclass.py viewpagetemplatefile.py 
Log Message:


Ripped out some leftover usage code.


=== Zope3/src/zope/app/pagetemplate/simpleviewclass.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/pagetemplate/simpleviewclass.py:1.10	Sun Sep 21 13:32:33 2003
+++ Zope3/src/zope/app/pagetemplate/simpleviewclass.py	Mon Mar 29 00:12:38 2004
@@ -11,11 +11,10 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""
+"""Simple View Class
 
 $Id$
 """
-
 import sys
 from zope.app.publisher.browser import BrowserView
 from zope.publisher.interfaces.browser import IBrowserPublisher
@@ -40,17 +39,17 @@
     def __getitem__(self, name):
         return self.index.macros[name]
 
-    def __call__(self, template_usage=u'', *args, **kw):
-        return self.index(template_usage, *args, **kw)
+    def __call__(self, *args, **kw):
+        return self.index(*args, **kw)
 
-def SimpleViewClass(src, offering=None, used_for=None, bases=(), usage=u''):
+def SimpleViewClass(src, offering=None, used_for=None, bases=()):
     if offering is None:
         offering = sys._getframe(1).f_globals
 
     bases += (simple, )
 
     class_ = type("SimpleViewClass from %s" % src, bases,
-                  {'index': ViewPageTemplateFile(src, offering, usage)})
+                  {'index': ViewPageTemplateFile(src, offering)})
 
     if used_for is not None:
         class_.__used_for__ = used_for


=== Zope3/src/zope/app/pagetemplate/viewpagetemplatefile.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/pagetemplate/viewpagetemplatefile.py:1.10	Tue Feb 10 20:14:02 2004
+++ Zope3/src/zope/app/pagetemplate/viewpagetemplatefile.py	Mon Mar 29 00:12:38 2004
@@ -26,12 +26,11 @@
     """Page Templates used as methods of views defined as Python classes.
     """
 
-    def __init__(self, filename, _prefix=None, usage=u'', content_type=None):
+    def __init__(self, filename, _prefix=None, content_type=None):
         _prefix = self.get_path_from_prefix(_prefix)
         super(ViewPageTemplateFile, self).__init__(filename, _prefix)
         if content_type is not None:
             self.content_type = content_type
-        self.usage = usage
 
     def pt_getContext(self, instance, request, **_kw):
         # instance is a View component
@@ -42,13 +41,7 @@
         namespace['views'] = ViewMapper(context, request)
         return namespace
 
-    def __call__(self, instance, template_usage=u'', *args, **keywords):
-        # parameter template_usage needed such as the publisher machinery
-        # can find it and extract it from the request
-        
-        if not template_usage:
-            template_usage = self.usage or getattr(instance, 'usage', u'')
-        keywords["template_usage"] = template_usage
+    def __call__(self, instance, *args, **keywords):
         namespace = self.pt_getContext(
             request=instance.request,
             instance=instance, args=args, options=keywords)
@@ -71,8 +64,8 @@
         object.__setattr__(self, 'im_func', pt)
         object.__setattr__(self, 'im_self', ob)
 
-    def __call__(self, template_usage=u'', **kw):
-        return self.im_func(self.im_self, template_usage, **kw)
+    def __call__(self, **kw):
+        return self.im_func(self.im_self, **kw)
 
     def __getattr__(self, name):
         return getattr(self.im_func, name)




More information about the Zope3-Checkins mailing list