[Zope3-checkins] SVN: Zope3/branches/srichter-blow-services/src/ - Resolved all my outstanding XXX comments.

Stephan Richter srichter at cosmos.phy.tufts.edu
Mon Feb 14 10:15:09 EST 2005


Log message for revision 29139:
  - Resolved all my outstanding XXX comments.
  - Wrote all final deprecation warnings.
  - Made sure that all tests pass without deprecation warnings being raised.
  
  The day of days is nearing! :-)
  
  

Changed:
  U   Zope3/branches/srichter-blow-services/src/buddydemo/buddy.py
  U   Zope3/branches/srichter-blow-services/src/buddydemo/ftests.py
  U   Zope3/branches/srichter-blow-services/src/buddydemo/tests.py
  U   Zope3/branches/srichter-blow-services/src/bugtracker/tests/placelesssetup.py
  U   Zope3/branches/srichter-blow-services/src/bugtracker/tests/test_dependencies.py
  U   Zope3/branches/srichter-blow-services/src/bugtracker/tests/test_mail.py
  U   Zope3/branches/srichter-blow-services/src/bugtracker/tests/test_vocabularies.py
  U   Zope3/branches/srichter-blow-services/src/z3checkins/ftests/test_z3checkins.py
  U   Zope3/branches/srichter-blow-services/src/z3checkins/tests/test_browser.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/apidoc/classmodule/__init__.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/apidoc/classmodule/browser.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/authentication/README.txt
  U   Zope3/branches/srichter-blow-services/src/zope/app/authentication/browser/ftests.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/authentication/browser/schemasearch.txt
  U   Zope3/branches/srichter-blow-services/src/zope/app/authentication/browser/tests.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/authentication/browserplugins.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/authentication/groupfolder.txt
  U   Zope3/branches/srichter-blow-services/src/zope/app/authentication/tests.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/component/bbb/localservice.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/component/bbb/registration.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/component/bbb/site.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/component/browser/registration.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/component/configure.zcml
  U   Zope3/branches/srichter-blow-services/src/zope/app/component/interfaces/__init__.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/component/registration.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/component/registration.txt
  U   Zope3/branches/srichter-blow-services/src/zope/app/form/browser/add.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/form/browser/addwizard.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/form/browser/editview.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/form/browser/editwizard.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/form/browser/schemadisplay.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/ftests/doctest.txt
  U   Zope3/branches/srichter-blow-services/src/zope/app/generations/README.txt
  U   Zope3/branches/srichter-blow-services/src/zope/app/i18n/translationdomain.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/introspector/__init__.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/introspector/interfaces.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/introspector/tests/test_introspector.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/locking/tests.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/pagetemplate/simpleviewclass.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/pagetemplate/tests/test_simpleviewclass.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/pluggableauth/tests/test_pluggableauth.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/publisher/xmlrpc/metaconfigure.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/publisher/xmlrpc/tests/test_directives.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/securitypolicy/tests/functional.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/testing/dochttp.txt
  U   Zope3/branches/srichter-blow-services/src/zope/app/testing/ztapi.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/tests/__init__.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/wfmc/tests.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/workflow/stateful/instance.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/zapi/__init__.py
  U   Zope3/branches/srichter-blow-services/src/zope/app/zapi/interfaces.py
  U   Zope3/branches/srichter-blow-services/src/zope/configuration/config.py
  U   Zope3/branches/srichter-blow-services/src/zope/deprecation/README.txt
  U   Zope3/branches/srichter-blow-services/src/zope/deprecation/deprecation.py
  U   Zope3/branches/srichter-blow-services/src/zwiki/tests/test_docstrings.py
  U   Zope3/branches/srichter-blow-services/src/zwiki/tests/test_traverser.py
  U   Zope3/branches/srichter-blow-services/src/zwiki/tests/test_wikimail.py
  U   Zope3/branches/srichter-blow-services/src/zwiki/tests/test_wikipagehierarchy.py

-=-
Modified: Zope3/branches/srichter-blow-services/src/buddydemo/buddy.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/buddydemo/buddy.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/buddydemo/buddy.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -38,7 +38,7 @@
     sake of the example, we'll install one, but first,
     we have to set up the component architecture:
 
-      >>> from zope.app.tests import placelesssetup, ztapi
+      >>> from zope.app.testing import placelesssetup, ztapi
       >>> placelesssetup.setUp()
 
     and then we can provide the utility:

Modified: Zope3/branches/srichter-blow-services/src/buddydemo/ftests.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/buddydemo/ftests.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/buddydemo/ftests.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -1,6 +1,6 @@
 import unittest
 from buddydemo.buddy import Buddy
-from zope.app.tests.functional import BrowserTestCase
+from zope.app.testing.functional import BrowserTestCase
 
 class Test(BrowserTestCase):
 

Modified: Zope3/branches/srichter-blow-services/src/buddydemo/tests.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/buddydemo/tests.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/buddydemo/tests.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -58,7 +58,7 @@
     Our rename view is going to generate an event. Because
     of that, we need to setup an event service:
 
-      >>> from zope.app.tests import placelesssetup
+      >>> from zope.app.testing import placelesssetup
       >>> placelesssetup.setUp()
       
     We should be able to create a BuddyRename on this

Modified: Zope3/branches/srichter-blow-services/src/bugtracker/tests/placelesssetup.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/bugtracker/tests/placelesssetup.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/bugtracker/tests/placelesssetup.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -26,8 +26,8 @@
 from zope.schema.vocabulary import getVocabularyRegistry
 
 from zope.app import zapi
-from zope.app.tests import ztapi
-from zope.app.tests.placelesssetup import PlacelessSetup as SetupBase
+from zope.app.testing import ztapi
+from zope.app.testing.placelesssetup import PlacelessSetup as SetupBase
 from zope.app.annotation.attribute import AttributeAnnotations
 from zope.app.file import File
 from zope.app.container.interfaces import INameChooser

Modified: Zope3/branches/srichter-blow-services/src/bugtracker/tests/test_dependencies.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/bugtracker/tests/test_dependencies.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/bugtracker/tests/test_dependencies.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -20,7 +20,7 @@
 from zope.interface import classImplements
 from zope.component.tests.placelesssetup import PlacelessSetup
 
-from zope.app.tests import ztapi
+from zope.app.testing import ztapi
 from zope.app.annotation.interfaces import IAnnotations, IAttributeAnnotatable
 from zope.app.annotation.attribute import AttributeAnnotations
 from zope.app.location.interfaces import ILocation

Modified: Zope3/branches/srichter-blow-services/src/bugtracker/tests/test_mail.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/bugtracker/tests/test_mail.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/bugtracker/tests/test_mail.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -20,7 +20,7 @@
 from zope.component.tests.placelesssetup import PlacelessSetup
 from zope.interface import classImplements, implements
 
-from zope.app.tests import ztapi
+from zope.app.testing import ztapi
 from zope.app.annotation.interfaces import IAnnotations, IAttributeAnnotatable
 from zope.app.dublincore.interfaces import IWriteZopeDublinCore
 from zope.app.traversing.interfaces import IPhysicallyLocatable

Modified: Zope3/branches/srichter-blow-services/src/bugtracker/tests/test_vocabularies.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/bugtracker/tests/test_vocabularies.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/bugtracker/tests/test_vocabularies.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -22,8 +22,8 @@
 from zope.schema.vocabulary import getVocabularyRegistry
 
 from zope.app import zapi
-from zope.app.tests import ztapi
-from zope.app.tests.placelesssetup import PlacelessSetup
+from zope.app.testing import ztapi
+from zope.app.testing.placelesssetup import PlacelessSetup
 from zope.app.annotation.attribute import AttributeAnnotations
 from zope.app.annotation.interfaces import IAnnotations, IAttributeAnnotatable
 from zope.app.container.contained import contained, Contained

Modified: Zope3/branches/srichter-blow-services/src/z3checkins/ftests/test_z3checkins.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/z3checkins/ftests/test_z3checkins.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/z3checkins/ftests/test_z3checkins.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -7,7 +7,7 @@
 
 import unittest
 import os
-from zope.app.tests.functional import BrowserTestCase
+from zope.app.testing.functional import BrowserTestCase
 
 
 class TestCheckins(BrowserTestCase):

Modified: Zope3/branches/srichter-blow-services/src/z3checkins/tests/test_browser.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/z3checkins/tests/test_browser.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/z3checkins/tests/test_browser.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -12,8 +12,8 @@
 from zope.publisher.browser import TestRequest
 from zope.interface import Interface, implements
 from zope.exceptions import DuplicationError
-from zope.app.tests import ztapi
-from zope.app.tests.placelesssetup import PlacelessSetup
+from zope.app.testing import ztapi
+from zope.app.testing.placelesssetup import PlacelessSetup
 
 from z3checkins.interfaces import ICheckinMessage, IBookmark, IMessageParser
 from z3checkins.tests.test_message import MessageStub, open_test_data

Modified: Zope3/branches/srichter-blow-services/src/zope/app/apidoc/classmodule/__init__.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/apidoc/classmodule/__init__.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/apidoc/classmodule/__init__.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -26,6 +26,7 @@
 from types import ClassType, TypeType, FunctionType
 
 import zope
+import zope.deprecation
 from zope.security.checker import getCheckerForInstancesOf
 from zope.interface import Interface, Attribute, implements, implementedBy
 
@@ -240,6 +241,7 @@
                     self.__children[file] = ZCMLFile(self, file, path)
 
         # Setup classes in module, if any are available.
+        zope.deprecation.__show__.off()
         for name in self.__module.__dict__.keys():
             attr = getattr(self.__module, name)
             # We do not want to register duplicates or non-"classes"
@@ -252,6 +254,7 @@
 
                 elif type(attr) is FunctionType and not name.startswith('_'):
                     self.__children[attr.__name__] = Function(self, name, attr)
+        zope.deprecation.__show__.on()
 
 
     def getDocString(self):

Modified: Zope3/branches/srichter-blow-services/src/zope/app/apidoc/classmodule/browser.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/apidoc/classmodule/browser.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/apidoc/classmodule/browser.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -83,29 +83,27 @@
           >>> menu.request = TestRequest(form={'path': 'Foo'})
           >>> info = menu.findClasses()
 
-          XXX: Commented out for now.
+          >>> pprint(info)
+          [[('path', 'zope.app.apidoc.classmodule.browser.Foo'),
+            ('url',
+             'http://127.0.0.1/zope/app/apidoc/classmodule/browser/Foo')],
+           [('path', 'zope.app.apidoc.classmodule.browser.Foo2'),
+            ('url',
+             'http://127.0.0.1/zope/app/apidoc/classmodule/browser/Foo2')]]
           
-          # >>> pprint(info)
-          # [[('path', 'zope.app.apidoc.classmodule.browser.Foo'),
-          #   ('url',
-          #    'http://127.0.0.1/zope/app/apidoc/classmodule/browser/Foo')],
-          #  [('path', 'zope.app.apidoc.classmodule.browser.Foo2'),
-          #   ('url',
-          #    'http://127.0.0.1/zope/app/apidoc/classmodule/browser/Foo2')]]
-          # 
-          # >>> menu.request = TestRequest(form={'path': 'o2'})
-          # >>> info = menu.findClasses()
-          # >>> pprint(info)
-          # [[('path', 'zope.app.apidoc.classmodule.browser.Foo2'),
-          #   ('url',
-          #    'http://127.0.0.1/zope/app/apidoc/classmodule/browser/Foo2')]]
-          # 
-          # >>> menu.request = TestRequest(form={'path': 'Blah'})
-          # >>> info = menu.findClasses()
-          # >>> pprint(info)
-          # [[('path', 'zope.app.apidoc.classmodule.browser.Blah'),
-          #   ('url',
-          #    'http://127.0.0.1/zope/app/apidoc/classmodule/browser/Blah')]]
+          >>> menu.request = TestRequest(form={'path': 'o2'})
+          >>> info = menu.findClasses()
+          >>> pprint(info)
+          [[('path', 'zope.app.apidoc.classmodule.browser.Foo2'),
+            ('url',
+             'http://127.0.0.1/zope/app/apidoc/classmodule/browser/Foo2')]]
+          
+          >>> menu.request = TestRequest(form={'path': 'Blah'})
+          >>> info = menu.findClasses()
+          >>> pprint(info)
+          [[('path', 'zope.app.apidoc.classmodule.browser.Blah'),
+            ('url',
+             'http://127.0.0.1/zope/app/apidoc/classmodule/browser/Blah')]]
         """
         path = self.request.get('path', None)
         if path is None:

Modified: Zope3/branches/srichter-blow-services/src/zope/app/authentication/README.txt
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/authentication/README.txt	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/authentication/README.txt	2005-02-14 15:15:09 UTC (rev 29139)
@@ -152,7 +152,7 @@
   >>> def add_info(event):
   ...     event.principal.title = `event.info`
 
-  >>> from zope.app.tests.ztapi import subscribe
+  >>> from zope.app.testing.ztapi import subscribe
   >>> subscribe([interfaces.IPrincipalCreated], None, add_info)
 
 Now, if we authenticate a principal, its title will be set:
@@ -319,7 +319,7 @@
 the ID '123'. Therefore it will delegate to the next utility. To make
 sure that it's delegated, we put in place a fake utility.
 
-  >>> from zope.app.utility.utility import testingNextUtility
+  >>> from zope.app.component.testing import testingNextUtility
   >>> from zope.app.security.interfaces import IAuthentication
 
   >>> class FakeAuthUtility:

Modified: Zope3/branches/srichter-blow-services/src/zope/app/authentication/browser/ftests.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/authentication/browser/ftests.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/authentication/browser/ftests.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -18,7 +18,7 @@
 import unittest
 
 def test_suite():
-    from zope.app.tests import functional
+    from zope.app.testing import functional
     return unittest.TestSuite((
         functional.FunctionalDocFileSuite('principalfolder.txt'),
         functional.FunctionalDocFileSuite('groupfolder.txt'),

Modified: Zope3/branches/srichter-blow-services/src/zope/app/authentication/browser/schemasearch.txt
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/authentication/browser/schemasearch.txt	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/authentication/browser/schemasearch.txt	2005-02-14 15:15:09 UTC (rev 29139)
@@ -3,11 +3,11 @@
 
 Placefull setup for making the search plugin IPhysicallyLocatable:
 
-  >>> from zope.app.tests import ztapi
+  >>> from zope.app.testing import ztapi
   >>> from zope.schema.interfaces import ITextLine
   >>> from zope.app.form.browser import TextWidget
   >>> from zope.app.form.interfaces import IInputWidget
-  >>> from zope.app.tests.setup import placefulSetUp, placefulTearDown
+  >>> from zope.app.testing.setup import placefulSetUp, placefulTearDown
   >>> site = placefulSetUp(True)
   >>> ztapi.browserView(ITextLine, '', TextWidget, providing=IInputWidget)
 

Modified: Zope3/branches/srichter-blow-services/src/zope/app/authentication/browser/tests.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/authentication/browser/tests.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/authentication/browser/tests.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -18,7 +18,7 @@
 __docformat__ = "reStructuredText"
 import unittest
 from zope.testing import doctest
-from zope.app.tests.setup import placefulSetUp, placefulTearDown
+from zope.app.testing.setup import placefulSetUp, placefulTearDown
 
 
 def schemaSearchSetUp(self):

Modified: Zope3/branches/srichter-blow-services/src/zope/app/authentication/browserplugins.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/authentication/browserplugins.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/authentication/browserplugins.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -168,7 +168,7 @@
 
         First we need a request and a response.
 
-        >>> from zope.app.tests.setup import placefulSetUp
+        >>> from zope.app.testing.setup import placefulSetUp
         >>> site = placefulSetUp(True)
 
 

Modified: Zope3/branches/srichter-blow-services/src/zope/app/authentication/groupfolder.txt
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/authentication/groupfolder.txt	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/authentication/groupfolder.txt	2005-02-14 15:15:09 UTC (rev 29139)
@@ -65,7 +65,7 @@
 created.  In order for `setGroupsForPrincipal` to find out group
 folder, we have to register it as a utility:
 
-  >>> from zope.app.tests import ztapi
+  >>> from zope.app.testing import ztapi
   >>> ztapi.provideUtility(zope.app.authentication.groupfolder.IGroupFolder,
   ...                      groups)
 

Modified: Zope3/branches/srichter-blow-services/src/zope/app/authentication/tests.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/authentication/tests.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/authentication/tests.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -25,9 +25,9 @@
 from zope.publisher.tests.httprequest import TestRequest
 
 from zope.app import zapi
-from zope.app.tests import placelesssetup, ztapi
+from zope.app.testing import placelesssetup, ztapi
 from zope.app.event.tests.placelesssetup import getEvents
-from zope.app.tests.setup import placefulSetUp, placefulTearDown
+from zope.app.testing.setup import placefulSetUp, placefulTearDown
 from zope.app.session.interfaces import \
         IClientId, IClientIdManager, ISession, ISessionDataContainer, \
         ISessionPkgData, ISessionData

Modified: Zope3/branches/srichter-blow-services/src/zope/app/component/bbb/localservice.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/component/bbb/localservice.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/component/bbb/localservice.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -1,7 +1,7 @@
 # BBB: Goes away in 3.3
+import zope.deprecation
 from zope.component.exceptions import ComponentLookupError
 
-
 def queryNextService(context, name, default=None):
     try:
         return getNextService(context, name)
@@ -14,3 +14,8 @@
     from zope.component.bbb.service import IService
     from zope.app.component import getNextSiteManager
     return getNextSiteManager(context).queryUtility(IService, name)
+
+zope.deprecation.deprecated(
+    ('queryNextService', 'getNextService'),
+    'The concept of services has been removed. Use utilities instead. '
+    'The reference will be gone in X3.3.')

Modified: Zope3/branches/srichter-blow-services/src/zope/app/component/bbb/registration.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/component/bbb/registration.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/component/bbb/registration.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -17,6 +17,7 @@
 """
 __docformat__ = "reStructuredText"
 from persistent import Persistent
+import zope.deprecation
 from zope.cachedescriptors.property import Lazy
 from zope.interface import implements
 from zope.proxy import removeAllProxies
@@ -106,6 +107,9 @@
 
     def getComponent(self):
         return self.__BBB_getComponent()
+    getComponent = zope.deprecation.deprecated(getComponent,
+                              'Use component directly. '
+                              'The reference will be gone in X3.3.')
 
     def __BBB_getComponent(self):
         if self._component is NULL_COMPONENT:
@@ -163,6 +167,10 @@
         self._BBB_componentPath = path
 
     componentPath = property(__BBB_getComponentPath, __BBB_setComponentPath)
+    componentPath = zope.deprecation.deprecated(
+        componentPath,
+        'Use component directly. '
+        'The reference will be gone in X3.3.')
 
     def __setstate__(self, dict):
         super(BBBComponentRegistration, self).__setstate__(dict)
@@ -179,11 +187,23 @@
 class BBBRegistry(object):
 
     def queryRegistrationsFor(self, cfg, default=None):
-        return RegistrationStack(self, name)
+        return RegistrationStack(self, cfg.name)
+    queryRegistrationsFor = zope.deprecation.deprecated(
+        queryRegistrationsFor,
+        'This method is not needed anymore, since registration stacks are '
+        'gone. There is now always only one registration per configuration '
+        'in the registry. '
+        'The reference will be gone in X3.3.')
 
     def createRegistrationsFor(self, cfg):
         # Ignore
         pass
+    createRegistrationsFor = zope.deprecation.deprecated(
+        createRegistrationsFor,
+        'This method used to create a registration stack. These stacks are '
+        'gone, so that this method is not required anymore. You can now '
+        'directly activate and deactivate registrations with a registry. '
+        'The reference will be gone in X3.3.')
     
 
 class BBBRegistrationManager(object):
@@ -206,27 +226,56 @@
 
     def getRegistrationManager(self):
         return self.registrationManager
+    getRegistrationManager = zope.deprecation.deprecated(
+        getRegistrationManager,
+        'This method has been deprecated in favor of the '
+        '`registrationManager` attribute. '
+        'The reference will be gone in X3.3.')
 
     def findModule(self, name):
         from zope.app.module import findModule
         return findModule(name)
+    findModule = zope.deprecation.deprecated(
+        findModule,
+        'This method has been deprecated and its functionality is now '
+        'available via the `zope.app.module.findModule` function. '
+        'The reference will be gone in X3.3.')
 
     def resolve(self, name):
         from zope.app.module import resolve
         return resolve(name)
+    findModule = zope.deprecation.deprecated(
+        findModule,
+        'This method has been deprecated and its functionality is now '
+        'available via the `zope.app.module.resolve` function. '
+        'The reference will be gone in X3.3.')
         
 
-
 class BBBRegistered(object):
 
     def addUsage(self, location):
         # Ignore in the hope that noone uses this
         pass
+    addUsage = zope.deprecation.deprecated(
+        addUsage,
+        'The concept of usages has been deprecated. `Registered` is now a '
+        'read-only adapter. '
+        'The reference will be gone in X3.3.')
 
     def removeUsage(self, location):
         # Ignore in the hope that noone uses this
         pass
+    removeUsage = zope.deprecation.deprecated(
+        removeUsage,
+        'The concept of usages has been deprecated. `Registered` is now a '
+        'read-only adapter. '
+        'The reference will be gone in X3.3.')
 
     def usages(self):
         return [zapi.getPath(reg.component)
                 for reg in self.registrations]
+    usages = zope.deprecation.deprecated(
+        usages,
+        'The concept of usages has been deprecated. You can get the '
+        'registrations for a component now via the `registrations` attribute. '
+        'The reference will be gone in X3.3.')

Modified: Zope3/branches/srichter-blow-services/src/zope/app/component/bbb/site.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/component/bbb/site.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/component/bbb/site.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -16,6 +16,7 @@
 $Id$
 """
 __docformat__ = "reStructuredText"
+import zope.deprecation
 from zope.component.bbb.service import IService
 from zope.cachedescriptors import property
 
@@ -51,21 +52,49 @@
 
     def queryRegistrationsFor(self, cfg, default=None):
         return self.queryRegistrations(cfg.name, default)
+    queryRegistrationsFor = zope.deprecation.deprecated(
+        queryRegistrationsFor,
+        'The site manager does not handle registrations directly anymore. '
+        'The utility and adapter registry are available via the `utilities` '
+        'and `adapters` attributes, respectively. '
+        'The method will be gone in X3.3.')
 
     def queryRegistrations(self, name, default=None):
         """See INameRegistry"""
         return registration.RegistrationStack(self, name)
+    queryRegistrations = zope.deprecation.deprecated(
+        queryRegistrations,
+        'The site manager does not handle registrations directly anymore. '
+        'The utility and adapter registry are available via the `utilities` '
+        'and `adapters` attributes, respectively. '
+        'The method will be gone in X3.3.')
 
     def addSubsite(self, sub):
         return self.addSub(sub)
+    addSubsite = zope.deprecation.deprecated(
+        addSubsite,
+        'Use `addSub()` instead. '
+        'The reference will be gone in X3.3.')
 
     def createRegistrationsFor(self, cfg):
         # Ignore
         pass
+    createRegistrationsFor = zope.deprecation.deprecated(
+        createRegistrationsFor,
+        'The site manager does not handle registrations directly anymore. '
+        'The utility and adapter registry are available via the `utilities` '
+        'and `adapters` attributes, respectively. '
+        'The reference will be gone in X3.3.')
 
     def createRegistrations(self, name):
         # Ignore
         pass
+    createRegistrations = zope.deprecation.deprecated(
+        createRegistrations,
+        'The site manager does not handle registrations directly anymore. '
+        'The utility and adapter registry are available via the `utilities` '
+        'and `adapters` attributes, respectively. '
+        'The reference will be gone in X3.3.')
 
     def listRegistrationNames(self):
         # Only used for services
@@ -73,33 +102,66 @@
         return [reg.name
                 for reg in self.utilities.registrations()
                 if reg.provided is IService] + services
+    listRegistrationNames = zope.deprecation.deprecated(
+        listRegistrationNames,
+        'The site manager does not handle registrations directly anymore. '
+        'The utility and adapter registry are available via the `utilities` '
+        'and `adapters` attributes, respectively. '
+        'The method will be gone in X3.3.')
         
     def queryActiveComponent(self, name, default=None):
         return self.queryLocalService(name, default)
+    queryActiveComponent = zope.deprecation.deprecated(
+        queryActiveComponent,
+        'The site manager does not handle registrations directly anymore. '
+        'The utility and adapter registry are available via the `utilities` '
+        'and `adapters` attributes, respectively. '
+        'The method will be gone in X3.3.')
 
     def getServiceDefinitions(self):
         gsm = zapi.getGlobalSiteManager()
         return gsm.getServiceDefinitions()
+    getServiceDefinitions = zope.deprecation.deprecated(
+        getServiceDefinitions,
+        'The concept of services has been removed. Use utilities instead. '
+        'The method will be gone in X3.3.')
 
     def getService(self, name):
         return zapi.getUtility(IService, name, self)
+    getService = zope.deprecation.deprecated(
+        getService,
+        'The concept of services has been removed. Use utilities instead. '
+        'The method will be gone in X3.3.')
 
     def queryLocalService(self, name, default=None):
         service = zapi.getUtility(IService, name, self)
         if zapi.getSiteManager(service) is not self:
             return default
         return service
+    queryLocalService = zope.deprecation.deprecated(
+        queryLocalService,
+        'The concept of services has been removed. Use utilities instead. '
+        'The method will be gone in X3.3.')
 
     def getInterfaceFor(self, service_type):
         iface = [iface
                 for name, iface in self.getServiceDefinitions()
                 if name == service_type]
         return iface[0]
+    getInterfaceFor = zope.deprecation.deprecated(
+        getInterfaceFor,
+        'The concept of services has been removed. Use utilities instead. '
+        'The method will be gone in X3.3.')
 
     def queryComponent(self, type=None, filter=None, all=0):
         # Ignore, hoping that noone uses this horrible method
         return []
+    getInterfaceFor = zope.deprecation.deprecated(
+        getInterfaceFor,
+        'This method was pretty useless even before services were gone! '
+        'The method will be gone in X3.3.')
 
+
 class BBBUtilityRegistration(object):
 
     def provided(self):

Modified: Zope3/branches/srichter-blow-services/src/zope/app/component/browser/registration.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/component/browser/registration.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/component/browser/registration.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -281,18 +281,12 @@
         registration manager. We don't want to hard code the name of
         this, so we'll simply scan the containing folder and add the
         registration to the first registration manager we find.
-
         """
-
         component = self.context
 
-        # XXX: Fix to use addRegistration()
         # Get the registration manager for this folder
-        folder = component.__parent__
-        rm = folder.registrationManager
-
-        name = INameChooser(rm).chooseName('', registration)
-        rm[name] = registration
+        rm = component.__parent__.registrationManager
+        rm.addRegistration(registration)
         return registration
 
     def nextURL(self):

Modified: Zope3/branches/srichter-blow-services/src/zope/app/component/configure.zcml
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/component/configure.zcml	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/component/configure.zcml	2005-02-14 15:15:09 UTC (rev 29139)
@@ -14,11 +14,10 @@
         />
     <require
         permission="zope.ManageSite"
-        interface="zope.app.container.interfaces.IReadContainer" />
-    <require
-        permission="zope.ManageSite"
         interface="zope.app.container.interfaces.IWriteContainer
+                   zope.app.container.interfaces.IReadContainer
                    zope.app.container.interfaces.INameChooser" 
+        attributes="addRegistration"
         />
   </content>
 

Modified: Zope3/branches/srichter-blow-services/src/zope/app/component/interfaces/__init__.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/component/interfaces/__init__.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/component/interfaces/__init__.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -132,7 +132,7 @@
         required=False,
         )
 
-    # XXX: for now
+    # TODO: for now until we figure out a way to specify the factory directly
     factoryName = zope.schema.TextLine(
         title=_(u"Factory Name"),
         readonly=False,

Modified: Zope3/branches/srichter-blow-services/src/zope/app/component/registration.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/component/registration.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/component/registration.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -152,7 +152,6 @@
 def ComponentRegistrationRemoveSubscriber(componentRegistration, event):
     """Receive notification of remove event."""
     component = componentRegistration.component
-    # XXX: test failure
     try:
         dependents = IDependable(component)
     except TypeError:
@@ -164,7 +163,6 @@
 def ComponentRegistrationAddSubscriber(componentRegistration, event):
     """Receive notification of add event."""
     component = componentRegistration.component
-    # XXX: test failure
     try:
         dependents = IDependable(component)
     except TypeError:
@@ -254,7 +252,7 @@
         zope.event.notify(
             objectevent.ObjectCreatedEvent(self.registrationManager))
 
-# XXX: Needs tests
+
 class RegistrationManagerNamespace(object):
     """Used to traverse to a Registration Manager from a
        Registerable Container."""

Modified: Zope3/branches/srichter-blow-services/src/zope/app/component/registration.txt
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/component/registration.txt	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/component/registration.txt	2005-02-14 15:15:09 UTC (rev 29139)
@@ -245,6 +245,29 @@
                              ---------------
 
 
+The ++registrations++ traversal namespace
+-----------------------------------------
+
+To make the registration manager easier accessible via a traversal path, a
+special traversal namespace has been implemented. But first we have to
+register the traversal namespace:
+
+  >>> from zope.app.traversing.interfaces import ITraversable
+  >>> from zope.app.component.registration import RegistrationManagerNamespace
+  >>> from zope.app.testing import ztapi
+  >>> ztapi.provideAdapter(
+  ...     interfaces.registration.IRegisterableContainer,
+  ...     ITraversable,
+  ...     RegistrationManagerNamespace,
+  ...     'registrations')
+
+Now we can use the namespace during traversal:
+
+  >>> from zope.app.traversing.api import traverse
+  >>> traverse(registerables, '++registrations++') is regManager
+  True
+
+
 The Component Registration
 --------------------------
 
@@ -425,3 +448,12 @@
   >>> dependents.getPaths()
   ()
 
+Note that not all components of a registration must be adaptable to
+`IDependable`. This might be the case for components that are
+autogenerated. If this is the case, the subscribers should simply ignore those
+components:
+
+  >>> reg.component = object()
+  >>> ComponentRegistrationAddSubscriber(reg, event)
+  >>> ComponentRegistrationRemoveSubscriber(reg, event)
+  
\ No newline at end of file

Modified: Zope3/branches/srichter-blow-services/src/zope/app/form/browser/add.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/form/browser/add.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/form/browser/add.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -140,7 +140,6 @@
                    keyword_arguments, set_before_add, set_after_add,
                    menu=u''):
 
-    # XXX: Needs to be tested
     class_  = SimpleViewClass(
         template, used_for=schema, bases=bases, name=name)
 

Modified: Zope3/branches/srichter-blow-services/src/zope/app/form/browser/addwizard.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/form/browser/addwizard.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/form/browser/addwizard.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -114,7 +114,6 @@
     template, default_template, bases, for_, content_factory, arguments,
     keyword_arguments, set_before_add, set_after_add, use_session=True):
 
-    # XXX: name=name Needs to be tested
     class_  = SimpleViewClass(template, used_for=schema, bases=bases,
                               name=name)
 

Modified: Zope3/branches/srichter-blow-services/src/zope/app/form/browser/editview.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/form/browser/editview.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/form/browser/editview.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -129,7 +129,7 @@
 def EditViewFactory(name, schema, label, permission, layer,
                     template, default_template, bases, for_, fields,
                     fulledit_path=None, fulledit_label=None, menu=u''):
-    # XXX: Need to test name=name
+
     class_ = SimpleViewClass(template, used_for=schema, bases=bases, name=name)
     class_.schema = schema
     class_.label = label

Modified: Zope3/branches/srichter-blow-services/src/zope/app/form/browser/editwizard.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/form/browser/editwizard.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/form/browser/editwizard.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -217,15 +217,13 @@
                     panes, fields, template, default_template, bases, for_,
                     menu=u'', use_session=False):
     # XXX What about the __implements__ of the bases?
-    class_ = SimpleViewClass(template, used_for=schema, bases=bases)
+    class_ = SimpleViewClass(template, used_for=schema, bases=bases, name=name)
     class_.schema = schema
     class_.panes = panes
     class_.fieldNames = fields
     class_.use_session = use_session
 
     class_.generated_form = ViewPageTemplateFile(default_template)
-    # XXX: needs to be tested
-    class_.__name__ = name
 
     defineChecker(
         class_,

Modified: Zope3/branches/srichter-blow-services/src/zope/app/form/browser/schemadisplay.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/form/browser/schemadisplay.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/form/browser/schemadisplay.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -73,7 +73,6 @@
                        fulledit_path=None, fulledit_label=None, menu=u'',
                        usage=u''):
     # XXX What about the __implements__ of the bases?
-    # XXX: Needs to test name=name
     class_ = SimpleViewClass(template, used_for=schema, bases=bases,
                              name=name)
     class_.schema = schema

Modified: Zope3/branches/srichter-blow-services/src/zope/app/ftests/doctest.txt
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/ftests/doctest.txt	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/ftests/doctest.txt	2005-02-14 15:15:09 UTC (rev 29139)
@@ -8,7 +8,7 @@
 ---------------------------------
 
 You can create Functional tests as doctests.  Typically, this is done
-by using a script such as src/zope/app/tests/dochttp.py to convert
+by using a script such as src/zope/app/testing/dochttp.py to convert
 tcpwatch recorded output to a doctest, which is then edited to provide
 explanation and to remove uninyeresting details.  That is how this
 file was created.

Modified: Zope3/branches/srichter-blow-services/src/zope/app/generations/README.txt
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/generations/README.txt	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/generations/README.txt	2005-02-14 15:15:09 UTC (rev 29139)
@@ -10,7 +10,7 @@
 you change the semantic meaning of an existing field in a class, you will
 have a problem with databases that were created before your change.  For a
 more thorough discussion and possible solutions, see
-http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/DatabaseGenerations
+http://dev.zope.org/Zope3/DatabaseGenerations
 
 We will be using the component architecture, and we will need a database and a
 connection:
@@ -18,7 +18,7 @@
     >>> import cgi
     >>> from pprint import pprint
     >>> from zope.interface import implements
-    >>> from zope.app.tests import placelesssetup, ztapi
+    >>> from zope.app.testing import placelesssetup, ztapi
     >>> placelesssetup.setUp()
 
     >>> from ZODB.tests.util import DB

Modified: Zope3/branches/srichter-blow-services/src/zope/app/i18n/translationdomain.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/i18n/translationdomain.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/i18n/translationdomain.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -266,7 +266,7 @@
     >>> domain1 = TranslationDomain()
     >>> domain1.domain = 'domain1'
 
-    >>> from zope.app.registration import registration
+    >>> from zope.app.component import registration
     >>> event = registration.RegistrationDeactivatedEvent(
     ...     Registration(domain1, 'domain1'))
 

Modified: Zope3/branches/srichter-blow-services/src/zope/app/introspector/__init__.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/introspector/__init__.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/introspector/__init__.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -27,6 +27,7 @@
 from zope.app import zapi
 from zope.app.component.interface import searchInterface, getInterface
 from zope.app.introspector.interfaces import IIntrospector
+from zope.app.module import resolve
 
 class Introspector(object):
     """Introspects an object"""
@@ -54,9 +55,7 @@
         if path.find('++module++') != -1:
             if (self.context == Interface and
                 name != 'Interface._Interface.Interface'):
-                sm = zapi.getSiteManager()
-                # XXX: Needs fixing and tests
-                self.currentclass = adapter.resolve(name)
+                self.currentclass = resolve(name)
                 self.context = self.currentclass
             else:
                 self.currentclass = self.context
@@ -135,11 +134,6 @@
             removeSecurityProxy(self.currentclass).__bases__)
         return bases
 
-    def getInterfaceRegistration(self):
-        """Returns details for a interface configuration"""
-        # XXX: Used to return a list of service names; empty now
-        return []
-
     def getDirectlyProvided(self):
         """See `IIntrospector`"""
         return directlyProvidedBy(removeSecurityProxy(self.context))

Modified: Zope3/branches/srichter-blow-services/src/zope/app/introspector/interfaces.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/introspector/interfaces.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/introspector/interfaces.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -59,11 +59,9 @@
     def getExtends():
         """Returns all the class extended up to the top most level"""
 
-    def getInterfaceRegistration():
-        """Returns details for a interface configuration"""
-
     def getMarkerInterfaces():
         """Returns a list of marker interfaces available for this object"""
 
     def getMarkerInterfaceNames():
-        """Returns a list of names of marker interfaces available for this object"""
+        """Returns a list of names of marker interfaces available for this
+        object"""

Modified: Zope3/branches/srichter-blow-services/src/zope/app/introspector/tests/test_introspector.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/introspector/tests/test_introspector.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/introspector/tests/test_introspector.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -87,6 +87,12 @@
 
         verifyObject(IIntrospector, ints)
 
+    def test_setRequest(self):
+        ints = Introspector(Interface)
+        request = {'PATH_INFO': '++module++zope.app.introspector.Introspector'}
+        ints.setRequest(request)
+        self.assertEqual(ints.currentclass, Introspector)
+
     def test_getClass(self):
         ints = Introspector(TestClass())
         request = {}

Modified: Zope3/branches/srichter-blow-services/src/zope/app/locking/tests.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/locking/tests.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/locking/tests.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -63,7 +63,7 @@
     dict['__name__'] = name    
     sys.modules[name] = FakeModule(dict)
 
-    from zope.app.tests import ztapi
+    from zope.app.testing import ztapi
     from zope.interface import Interface
     from zope.app.locking.interfaces import ILockable, ILockTracker
     from zope.app.locking.adapter import LockingAdapterFactory

Modified: Zope3/branches/srichter-blow-services/src/zope/app/pagetemplate/simpleviewclass.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/pagetemplate/simpleviewclass.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/pagetemplate/simpleviewclass.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -37,14 +37,13 @@
 
         raise NotFound(self, name, request)
 
-    # XXX: we need some unittests for this !!!
     def __getitem__(self, name):
         return self.index.macros[name]
 
     def __call__(self, *args, **kw):
         return self.index(*args, **kw)
 
-# XXX: Test new name argument
+
 def SimpleViewClass(src, offering=None, used_for=None, bases=(), name=u''):
     if offering is None:
         offering = sys._getframe(1).f_globals

Modified: Zope3/branches/srichter-blow-services/src/zope/app/pagetemplate/tests/test_simpleviewclass.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/pagetemplate/tests/test_simpleviewclass.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/pagetemplate/tests/test_simpleviewclass.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -17,14 +17,15 @@
 """
 import unittest
 
+from zope.app.pagetemplate.simpleviewclass import SimpleViewClass
+from zope.app.pagetemplate.tests.simpletestview import SimpleTestView
+from zope.publisher.browser import TestRequest
+
 class data(object): pass
 
 class SimpleViewTestCase(unittest.TestCase):
 
     def test_simple(self):
-        from zope.app.pagetemplate.tests.simpletestview import SimpleTestView
-        from zope.publisher.browser import TestRequest
-
         ob = data()
         request = TestRequest()
         view = SimpleTestView(ob, request)
@@ -36,10 +37,18 @@
                          '    <p>hello world</p>\n'
                          '  </body>\n</html>\n')
 
+    def test_name(self):
+        View = SimpleViewClass('testsimpleviewclass.pt', name='test.html')
+        view = View(None, None)
+        self.assertEqual(view.__name__, 'test.html')
+
+    def test_getitem(self):
+        View = SimpleViewClass('testsimpleviewclass.pt', name='test.html')
+        view = View(None, None)
+        self.assert_(view['test'] is not None)
+        self.assertRaises(KeyError, view.__getitem__, 'foo')
+
     def test_WBases(self):
-        from zope.app.pagetemplate.simpleviewclass import SimpleViewClass
-        from zope.publisher.browser import TestRequest
-
         class C(object): pass
 
         SimpleTestView = SimpleViewClass('testsimpleviewclass.pt', bases=(C, ))

Modified: Zope3/branches/srichter-blow-services/src/zope/app/pluggableauth/tests/test_pluggableauth.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/pluggableauth/tests/test_pluggableauth.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/pluggableauth/tests/test_pluggableauth.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -20,7 +20,7 @@
 from zope.interface.verify import verifyObject
 
 from zope.app import zapi
-from zope.app.tests import ztapi, setup
+from zope.app.testing import ztapi, setup
 import zope.app.site.tests as placefulsetup
 
 from zope.app.security.interfaces import PrincipalLookupError
@@ -38,7 +38,7 @@
 
 from zope.publisher.browser import TestRequest as Request
 
-from zope.app.tests.placelesssetup import setUp, tearDown
+from zope.app.testing.placelesssetup import setUp, tearDown
 
 import base64
 

Modified: Zope3/branches/srichter-blow-services/src/zope/app/publisher/xmlrpc/metaconfigure.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/publisher/xmlrpc/metaconfigure.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/publisher/xmlrpc/metaconfigure.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -52,7 +52,6 @@
 
     # Make sure that the class inherits MethodPublisher, so that the views
     # have a location
-    # XXX: Needs tests
     if class_ is None:
         class_ = MethodPublisher
     else:

Modified: Zope3/branches/srichter-blow-services/src/zope/app/publisher/xmlrpc/tests/test_directives.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/publisher/xmlrpc/tests/test_directives.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/publisher/xmlrpc/tests/test_directives.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -47,6 +47,7 @@
         xmlconfig.file("xmlrpc.zcml", xmlrpc.tests)
         view = zapi.queryMultiAdapter((ob, request), name='test')
         self.assert_(V1 in view.__class__.__bases__)
+        self.assert_(xmlrpc.MethodPublisher in view.__class__.__bases__)
 
     def testInterfaceProtectedView(self):
         xmlconfig.file("xmlrpc.zcml", xmlrpc.tests)

Modified: Zope3/branches/srichter-blow-services/src/zope/app/securitypolicy/tests/functional.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/securitypolicy/tests/functional.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/securitypolicy/tests/functional.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -17,7 +17,7 @@
 """
 
 from zope import interface
-from zope.app.tests import functional
+from zope.app.testing import functional
 
 class ManagerSetup:
     interface.implements(functional.IManagerSetup)

Modified: Zope3/branches/srichter-blow-services/src/zope/app/testing/dochttp.txt
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/testing/dochttp.txt	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/testing/dochttp.txt	2005-02-14 15:15:09 UTC (rev 29139)
@@ -19,13 +19,13 @@
 
 6. Shut down tcpwatch.
 
-7. Run the script src/zope/app/tests/dochttp.py:
-   python2.3 src/zope/app/tests/dochttp.py tmpdir > somefile.txt
+7. Run the script src/zope/app/testing/dochttp.py:
+   python2.3 src/zope/app/testing/dochttp.py tmpdir > somefile.txt
 
 8. Edit the generated text file to add explanations and elide
    uninteresting portions of the output.
 
 9. In a functional test module (usually ftests.py), import
-   FunctionalDocFileSuite from zope.app.tests.functional and
+   FunctionalDocFileSuite from zope.app.testing.functional and
    instantiate it, passing the name of the text file containing the
    test.

Modified: Zope3/branches/srichter-blow-services/src/zope/app/testing/ztapi.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/testing/ztapi.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/testing/ztapi.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -93,10 +93,16 @@
     provideAdapter(None, ITraversable, handler, name=name)
     provideView(None, None, ITraversable, name, handler)
 
-# XXX: Deprecate
+
+# BBB: Deprecated. Gone in X3.3.
+from zope.deprecation import deprecated
+
 def provideService(name, service, interface=None):
     services = zapi.getGlobalServices()
     if interface is not None:
         services.defineService(name, interface)
     services.provideService(name, service)
     
+deprecated('provideService',
+           'The concept of services has been removed. Use utilities instead. '
+           'The reference will be gone in X3.3.')

Modified: Zope3/branches/srichter-blow-services/src/zope/app/tests/__init__.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/tests/__init__.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/tests/__init__.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -5,14 +5,16 @@
 # BBB: backward-comptibility; 12/18/2004
 
 import sys
-#from zope.deprecation.deprecation import DeprecatedModule 
+from zope.deprecation.deprecation import DeprecationProxy
 import zope.app
 
 def deprecate(module):
-    return module
-#    return DeprecatedModule(module,
-#                            'Test setup code moved from zope.app.tests to '
-#                            'zope.app.testing. This will go away in Zope 3.3.')
+    depmodule = DeprecationProxy(module)
+    depmodule.deprecate(module.__dict__.keys(),
+                        'The testing support code moved from zope.app.tests '
+                        'to zope.app.testing. This reference go away in Zope '
+                        'X3.3.')
+    return depmodule
 
 
 from zope.app.testing import placelesssetup

Modified: Zope3/branches/srichter-blow-services/src/zope/app/wfmc/tests.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/wfmc/tests.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/wfmc/tests.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -25,8 +25,8 @@
 import zope.app.annotation.interfaces
 import zope.app.annotation.attribute
 import zope.app.wfmc
-from zope.app.tests import placelesssetup
-from zope.app.tests import ztapi
+from zope.app.testing import placelesssetup
+from zope.app.testing import ztapi
 
 def zcml(s):
     context = xmlconfig.file('meta.zcml', package=zope.app.wfmc)

Modified: Zope3/branches/srichter-blow-services/src/zope/app/workflow/stateful/instance.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/workflow/stateful/instance.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/workflow/stateful/instance.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -18,8 +18,10 @@
 from persistent import Persistent
 from persistent.dict import PersistentDict
 
+from zope.event import notify
+
 from zope.app import zapi
-from zope.event import notify
+from zope.app.module import resolve
 from zope.app.workflow.interfaces import IProcessDefinition
 from zope.app.workflow.stateful.interfaces import AUTOMATIC
 from zope.app.workflow.stateful.interfaces import IAfterTransitionEvent
@@ -273,9 +275,8 @@
         if not script:
             return True
         if isinstance(script, (str, unicode)):
-            sm = zapi.getSiteManager(self)
-            # XXX: Code broken; not test
-            script = sm.resolve(script)
+            # XXX: not tested!
+            script = resolve(script)
         return script(contexts)
 
     def _outgoingTransitions(self, clean_pd):

Modified: Zope3/branches/srichter-blow-services/src/zope/app/zapi/__init__.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/zapi/__init__.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/zapi/__init__.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -19,7 +19,6 @@
 """
 from interfaces import IZAPI
 from zope.interface import moduleProvides
-from zope.deprecation import deprecated
 
 from zope.security.proxy import isinstance
 
@@ -43,6 +42,7 @@
     return getUtility(IAuthentication)
 
 # BBB: Gone in 3.3.
+from zope.deprecation import deprecated
 from zope.app import servicenames
 
 deprecated('servicenames',

Modified: Zope3/branches/srichter-blow-services/src/zope/app/zapi/interfaces.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/zapi/interfaces.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/app/zapi/interfaces.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -70,9 +70,6 @@
         which would return IImage.
         """
         
-    # XXX: Deprecate
-    servicenames = Attribute("Service Names")
-
     def isinstance(object, cls):
         """Test whether an object is an instance of the given type
 
@@ -88,3 +85,6 @@
         """Return the authentication utility
         """
         
+    # BBB: Deprecated. Gone in X3.3.
+    servicenames = Attribute("Service Names")
+

Modified: Zope3/branches/srichter-blow-services/src/zope/configuration/config.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/configuration/config.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/configuration/config.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -190,7 +190,9 @@
 
         try:
             zope.deprecation.__show__.off()
-            return getattr(mod, oname)
+            obj = getattr(mod, oname)
+            zope.deprecation.__show__.on()
+            return obj
         except AttributeError:
             zope.deprecation.__show__.on()
             # No such name, maybe it's a module that we still need to import
@@ -215,8 +217,6 @@
 
                 raise ConfigurationError("Module %s has no global %s"
                                          % (mname, oname))
-        else:
-            zope.deprecation.__show__.on()
 
     def path(self, filename):
         """

Modified: Zope3/branches/srichter-blow-services/src/zope/deprecation/README.txt
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/deprecation/README.txt	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/deprecation/README.txt	2005-02-14 15:15:09 UTC (rev 29139)
@@ -32,12 +32,12 @@
 
   >>> from zope.deprecation import tests
   >>> tests.demo1
-  <string>:1: DeprecationWarning: demo1 is no more.
+  <string>:1: DeprecationWarning: demo1: demo1 is no more.
   1
 
   >>> import zope.deprecation.tests
   >>> zope.deprecation.tests.demo2
-  <string>:1: DeprecationWarning: demo2 is no more.
+  <string>:1: DeprecationWarning: demo2: demo2 is no more.
   2
 
 You can see that merely importing the affected module or one of its parents
@@ -46,7 +46,7 @@
 name directly, the deprecation warning will be raised immediately.
 
   >>> from zope.deprecation.tests import demo3
-  <string>:1: DeprecationWarning: demo3 is no more.
+  <string>:1: DeprecationWarning: demo3: demo3 is no more.
 
 Also, once a deprecation warning has been displayed, it is not shown again:
 

Modified: Zope3/branches/srichter-blow-services/src/zope/deprecation/deprecation.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/deprecation/deprecation.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zope/deprecation/deprecation.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -66,7 +66,9 @@
     def __getattribute__(self, name):
         if name != '_deprecated' and name in self._deprecated:
             if zope.deprecation.__show__():
-                warnings.warn(self._deprecated[name], DeprecationWarning, 2)
+                warnings.warn(
+                    name + ': ' + self._deprecated[name],
+                    DeprecationWarning, 2)
 
         return super(DeprecationProxy, self).__getattribute__(name)
 

Modified: Zope3/branches/srichter-blow-services/src/zwiki/tests/test_docstrings.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zwiki/tests/test_docstrings.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zwiki/tests/test_docstrings.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -24,7 +24,7 @@
 
 from zope.app import zapi
 from zope.app.dublincore.interfaces import ICMFDublinCore
-from zope.app.tests import placelesssetup, ztapi
+from zope.app.testing import placelesssetup, ztapi
 
 from zwiki.interfaces import IComment
 

Modified: Zope3/branches/srichter-blow-services/src/zwiki/tests/test_traverser.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zwiki/tests/test_traverser.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zwiki/tests/test_traverser.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -27,8 +27,8 @@
 from zope.app.annotation.interfaces import IAnnotations, IAttributeAnnotatable
 from zope.app.location.interfaces import ILocation
 from zope.app.location.traversing import LocationPhysicallyLocatable
-from zope.app.tests import ztapi
-from zope.app.tests.placelesssetup import PlacelessSetup
+from zope.app.testing import ztapi
+from zope.app.testing.placelesssetup import PlacelessSetup
 from zope.app.traversing.interfaces import IPhysicallyLocatable
 
 from zwiki.interfaces import IWikiPage, IWikiPageHierarchy

Modified: Zope3/branches/srichter-blow-services/src/zwiki/tests/test_wikimail.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zwiki/tests/test_wikimail.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zwiki/tests/test_wikimail.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -19,8 +19,8 @@
 
 from zope.event import subscribers
 from zope.interface import classImplements, implements 
-from zope.app.tests import ztapi
-from zope.app.tests.placelesssetup import PlacelessSetup
+from zope.app.testing import ztapi
+from zope.app.testing.placelesssetup import PlacelessSetup
 from zope.app.site.tests.placefulsetup import PlacefulSetup
 from zope.app.annotation.interfaces import IAnnotations, IAttributeAnnotatable
 from zope.app.event.objectevent import ObjectModifiedEvent

Modified: Zope3/branches/srichter-blow-services/src/zwiki/tests/test_wikipagehierarchy.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zwiki/tests/test_wikipagehierarchy.py	2005-02-14 13:55:13 UTC (rev 29138)
+++ Zope3/branches/srichter-blow-services/src/zwiki/tests/test_wikipagehierarchy.py	2005-02-14 15:15:09 UTC (rev 29139)
@@ -18,7 +18,7 @@
 import unittest
 
 from zope.interface import implements, classImplements
-from zope.app.tests import ztapi
+from zope.app.testing import ztapi
 
 from zope.app.annotation.interfaces import IAnnotations, IAttributeAnnotatable
 from zope.app.traversing.interfaces import IPhysicallyLocatable



More information about the Zope3-Checkins mailing list