[Checkins] SVN: grok/branches/grokcore.xxx/src/grok/components.py __getitem__ moved to grokcore.view.View.

Philipp von Weitershausen philikon at philikon.de
Sat Jul 19 22:34:01 EDT 2008


Log message for revision 88635:
  __getitem__ moved to grokcore.view.View.
  

Changed:
  U   grok/branches/grokcore.xxx/src/grok/components.py

-=-
Modified: grok/branches/grokcore.xxx/src/grok/components.py
===================================================================
--- grok/branches/grokcore.xxx/src/grok/components.py	2008-07-20 02:33:39 UTC (rev 88634)
+++ grok/branches/grokcore.xxx/src/grok/components.py	2008-07-20 02:34:00 UTC (rev 88635)
@@ -54,7 +54,6 @@
 from grok import interfaces, util
 from grokcore.view import formlib
 from grokcore.view import GrokForm
-from grokcore.view import PageTemplate
 from grokcore.view import PageTemplateFile
 
 
@@ -139,20 +138,6 @@
 class View(grokcore.view.View):
     interface.implements(interfaces.IGrokView)
 
-    def __getitem__(self, key):
-        # This is BBB code for Zope page templates only:
-        if not isinstance(self.template, PageTemplate):
-            raise AttributeError("View has no item %s" % key)
-
-        value = self.template._template.macros[key]
-        # When this deprecation is done with, this whole __getitem__ can
-        # be removed.
-        warnings.warn("Calling macros directly on the view is deprecated. "
-                      "Please use context/@@viewname/macros/macroname\n"
-                      "View %r, macro %s" % (self, key),
-                      DeprecationWarning, 1)
-        return value
-
     def flash(self, message, type='message'):
         source = component.getUtility(
             z3c.flashmessage.interfaces.IMessageSource, name='session')



More information about the Checkins mailing list