[Zope3-checkins] SVN: Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/meta deprecate renderer:renderer directive. It's not even used in the Zope 3 source

Philipp von Weitershausen philikon at philikon.de
Wed Mar 15 09:48:11 EST 2006


Log message for revision 66034:
  deprecate renderer:renderer directive. It's not even used in the Zope 3 source
  anymore so there's nothing to convert.
  

Changed:
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/meta.zcml
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/metaconfigure.py

-=-
Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/meta.zcml
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/meta.zcml	2006-03-15 14:36:39 UTC (rev 66033)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/meta.zcml	2006-03-15 14:48:10 UTC (rev 66034)
@@ -2,6 +2,7 @@
     xmlns="http://namespaces.zope.org/zope"
     xmlns:meta="http://namespaces.zope.org/meta">
 
+  <!-- BBB 2006/02/24, to be removed after 12 months -->
   <meta:directive
      namespace="http://namespaces.zope.org/renderer"
      name="renderer"

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/metaconfigure.py
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/metaconfigure.py	2006-03-15 14:36:39 UTC (rev 66033)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/metaconfigure.py	2006-03-15 14:48:10 UTC (rev 66034)
@@ -15,6 +15,9 @@
 
 $Id$
 """
+# BBB 2006/02/24, to be removed after 12 months
+
+import warnings
 from zope.app import zapi
 from zope.app.component.metaconfigure import handler
 from zope.configuration.fields import GlobalInterface, GlobalObject
@@ -43,6 +46,22 @@
 
 # TODO: Does not seem to be tested
 def renderer(_context, sourceType, for_, factory):
+    def dottify(obj):
+        try:
+            return obj.__module__ + '.' + obj.__name__
+        except AttributeError:
+            return '...'
+    warnings.warn_explicit(
+        "The 'renderer' directive has been deprecated and will be "
+        "removed in Zope 3.5.  Use the 'view' directive instead:\n"
+        '  <browser:view\n'
+        '      name=""\n'
+        '      for="%s"\n'
+        '      class="%s"\n'
+        '      permission="zope.Public"\n'
+        '      />' % (dottify(sourceType), dottify(factory)),
+        DeprecationWarning, _context.info.file, _context.info.line)
+
     _context.action(
         discriminator = ('view', sourceType, u'', for_, 'default'),
         callable = handler,



More information about the Zope3-Checkins mailing list