Log message for revision 67859: Now properly deprecate IBrowserDefault after I've understood how browser:defaultView takes over five:defaultViewable. Way to go, Lennart.
Changed: U Products.Five/trunk/bbb.py U Products.Five/trunk/browser/configure.zcml U Products.Five/trunk/fiveconfigure.py U Products.Five/trunk/interfaces.py U Products.Five/trunk/tests/test_viewable.py U Products.Five/trunk/traversing.zcml -=- Modified: Products.Five/trunk/bbb.py =================================================================== --- Products.Five/trunk/bbb.py 2006-05-02 19:57:15 UTC (rev 67858) +++ Products.Five/trunk/bbb.py 2006-05-02 19:58:24 UTC (rev 67859) @@ -22,8 +22,16 @@ import zExceptions import Products.Five.security from Products.Five import fivemethod -from Products.Five.interfaces import IBrowserDefault +class IBrowserDefault(Interface): + """Provide a hook for deciding about the default view for an object""" + + def defaultView(self, request): + """Return the object to be published + (usually self) and a sequence of names to traverse to + find the method to be published. + """ + class BrowserDefault(object): implements(IBrowserDefault) Modified: Products.Five/trunk/browser/configure.zcml =================================================================== --- Products.Five/trunk/browser/configure.zcml 2006-05-02 19:57:15 UTC (rev 67858) +++ Products.Five/trunk/browser/configure.zcml 2006-05-02 19:58:24 UTC (rev 67859) @@ -1,8 +1,9 @@ <configure xmlns="http://namespaces.zope.org/zope" xmlns:browser="http://namespaces.zope.org/browser"> + <!-- BBB 2006/05/01 - to be removed after 12 months --> <browser:defaultView - for="Products.Five.interfaces.IBrowserDefault" + for="Products.Five.bbb.IBrowserDefault" name="index.html" /> Modified: Products.Five/trunk/fiveconfigure.py =================================================================== --- Products.Five/trunk/fiveconfigure.py 2006-05-02 19:57:15 UTC (rev 67858) +++ Products.Five/trunk/fiveconfigure.py 2006-05-02 19:58:24 UTC (rev 67859) @@ -39,7 +39,6 @@ from Products.Five import isFiveMethod from Products.Five.bridge import fromZ2Interface from Products.Five.browser.metaconfigure import page -from Products.Five.interfaces import IBrowserDefault debug_mode = App.config.getConfiguration().debug_mode LOG = logging.getLogger('Five') @@ -120,6 +119,7 @@ "on it to make 'index.html' the default view, replace it " "with <browser:defaultView name='index.html' />", DeprecationWarning, 2) + from Products.Five.bbb import IBrowserDefault implements(_context, class_, (IBrowserDefault,)) def createZope2Bridge(zope2, package, name): Modified: Products.Five/trunk/interfaces.py =================================================================== --- Products.Five/trunk/interfaces.py 2006-05-02 19:57:15 UTC (rev 67858) +++ Products.Five/trunk/interfaces.py 2006-05-02 19:58:24 UTC (rev 67859) @@ -15,21 +15,21 @@ $Id$ """ -from zope.interface import Interface from zope.interface.interfaces import IInterface -class IBrowserDefault(Interface): - """Provide a hook for deciding about the default view for an object""" - - def defaultView(self, request): - """Return the object to be published - (usually self) and a sequence of names to traverse to - find the method to be published. - """ - class IMenuItemType(IInterface): """Menu item type Menu item types are interfaces that define classes of menu items. """ + +# BBB 2006/05/01 -- to be removed after 12 months +import zope.deferredimport +zope.deferredimport.deprecated( + "To get the default browser view of an object, use " + "zope.app.publisher.browser.queryDefaultViewName. To " + "define the default view of an object, use the " + "browser:defaultView directive", + IBrowserDefault = "Products.Five.bbb:IBrowserDefault", + ) Modified: Products.Five/trunk/tests/test_viewable.py =================================================================== --- Products.Five/trunk/tests/test_viewable.py 2006-05-02 19:57:15 UTC (rev 67858) +++ Products.Five/trunk/tests/test_viewable.py 2006-05-02 19:58:24 UTC (rev 67859) @@ -41,8 +41,7 @@ and default view names for everything and IFoo objects in particular: - >>> from Products.Five.bbb import BrowserDefault - >>> from Products.Five.interfaces import IBrowserDefault + >>> from Products.Five.bbb import BrowserDefault, IBrowserDefault >>> from zope.interface import Interface >>> provideAdapter(BrowserDefault, (Interface,), IBrowserDefault) >>> provideAdapter(u'index.html', (None, IBrowserRequest), IDefaultViewName) Modified: Products.Five/trunk/traversing.zcml =================================================================== --- Products.Five/trunk/traversing.zcml 2006-05-02 19:57:15 UTC (rev 67858) +++ Products.Five/trunk/traversing.zcml 2006-05-02 19:58:24 UTC (rev 67859) @@ -8,7 +8,7 @@ <adapter for="*" factory=".bbb.BrowserDefault" - provides=".interfaces.IBrowserDefault" + provides=".bbb.IBrowserDefault" /> </configure> _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins