[Checkins] SVN: Zope3/branches/jim-adapter/ Update with changes from old jim-adapter branch.

Philipp von Weitershausen philikon at philikon.de
Tue Apr 4 11:57:54 EDT 2006


Log message for revision 66397:
  Update with changes from old jim-adapter branch.
  Command used:
    $ svn merge svn+ssh://philikon@svn.zope.org/repos/main/Zope3/branches/jim-adapter@41413 \
                svn+ssh://philikon@svn.zope.org/repos/main/Zope3/branches/jim-adapter@66386 .
  
  

Changed:
  U   Zope3/branches/jim-adapter/src/bugtracker/__init__.py
  U   Zope3/branches/jim-adapter/src/bugtracker/browser/bug.py
  U   Zope3/branches/jim-adapter/src/bugtracker/tests/placelesssetup.py
  U   Zope3/branches/jim-adapter/src/bugtracker/tests/test_dependencies.py
  U   Zope3/branches/jim-adapter/src/bugtracker/tests/test_mail.py
  U   Zope3/branches/jim-adapter/src/bugtracker/tests/test_xmlexportimport.py
  U   Zope3/branches/jim-adapter/src/bugtracker/vocabulary.py
  U   Zope3/branches/jim-adapter/src/z3checkins/browser.py
  U   Zope3/branches/jim-adapter/src/z3checkins/configure.zcml
  U   Zope3/branches/jim-adapter/src/z3checkins/folder.py
  U   Zope3/branches/jim-adapter/src/z3checkins/message.py
  U   Zope3/branches/jim-adapter/src/z3checkins/tests/test_message.py
  U   Zope3/branches/jim-adapter/src/zope/app/DEPENDENCIES.cfg
  U   Zope3/branches/jim-adapter/src/zope/app/PACKAGE.cfg
  UU  Zope3/branches/jim-adapter/src/zope/app/__init__.py
  U   Zope3/branches/jim-adapter/src/zope/app/apidoc/bookmodule/book.zcml
  U   Zope3/branches/jim-adapter/src/zope/app/apidoc/component.py
  U   Zope3/branches/jim-adapter/src/zope/app/apidoc/component.txt
  U   Zope3/branches/jim-adapter/src/zope/app/apidoc/ifacemodule/browser.txt
  U   Zope3/branches/jim-adapter/src/zope/app/apidoc/presentation.py
  U   Zope3/branches/jim-adapter/src/zope/app/apidoc/presentation.txt
  U   Zope3/branches/jim-adapter/src/zope/app/apidoc/tests.py
  U   Zope3/branches/jim-adapter/src/zope/app/apidoc/utilitymodule/browser.txt
  U   Zope3/branches/jim-adapter/src/zope/app/apidoc/utilitymodule/utilitymodule.py
  U   Zope3/branches/jim-adapter/src/zope/app/applicationcontrol/browser/zodbcontrol.py
  U   Zope3/branches/jim-adapter/src/zope/app/appsetup/bootstrap.py
  U   Zope3/branches/jim-adapter/src/zope/app/authentication/README.txt
  U   Zope3/branches/jim-adapter/src/zope/app/authentication/browser/ftests.py
  U   Zope3/branches/jim-adapter/src/zope/app/authentication/browser/principalfolder.txt
  U   Zope3/branches/jim-adapter/src/zope/app/authentication/idpicker.py
  U   Zope3/branches/jim-adapter/src/zope/app/authentication/vocabulary.txt
  U   Zope3/branches/jim-adapter/src/zope/app/cache/interfaces/ram.py
  U   Zope3/branches/jim-adapter/src/zope/app/catalog/browser/README.txt
  U   Zope3/branches/jim-adapter/src/zope/app/catalog/tests.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/README.txt
  U   Zope3/branches/jim-adapter/src/zope/app/component/__init__.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/adapter.py
  D   Zope3/branches/jim-adapter/src/zope/app/component/adapterregistry.txt
  A   Zope3/branches/jim-adapter/src/zope/app/component/back35.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/bbb/__init__.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/bbb/hooks.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/bbb/localservice.py
  D   Zope3/branches/jim-adapter/src/zope/app/component/bbb/registration.py
  D   Zope3/branches/jim-adapter/src/zope/app/component/bbb/site.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/browser/__init__.py
  D   Zope3/branches/jim-adapter/src/zope/app/component/browser/ftests.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/browser/tools.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/browser/tools.txt
  U   Zope3/branches/jim-adapter/src/zope/app/component/configure.zcml
  U   Zope3/branches/jim-adapter/src/zope/app/component/fields.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/hooks.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/interface.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/interfaces/__init__.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/interfaces/registration.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/registration.py
  D   Zope3/branches/jim-adapter/src/zope/app/component/registration.txt
  U   Zope3/branches/jim-adapter/src/zope/app/component/site.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/site.txt
  D   Zope3/branches/jim-adapter/src/zope/app/component/statusproperty.txt
  U   Zope3/branches/jim-adapter/src/zope/app/component/testing.py
  A   Zope3/branches/jim-adapter/src/zope/app/component/tests/deprecated35_registration.txt
  A   Zope3/branches/jim-adapter/src/zope/app/component/tests/deprecated35_statusproperty.txt
  D   Zope3/branches/jim-adapter/src/zope/app/component/tests/test_adapter.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/tests/test_contentdirective.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/tests/test_directives.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/tests/test_registration.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/tests/test_site.py
  U   Zope3/branches/jim-adapter/src/zope/app/component/tests/views.py
  U   Zope3/branches/jim-adapter/src/zope/app/configure.zcml
  U   Zope3/branches/jim-adapter/src/zope/app/container/browser/adding.py
  U   Zope3/branches/jim-adapter/src/zope/app/container/browser/contents.py
  U   Zope3/branches/jim-adapter/src/zope/app/container/browser/tests/test_adding.py
  U   Zope3/branches/jim-adapter/src/zope/app/container/configure.zcml
  U   Zope3/branches/jim-adapter/src/zope/app/container/contained.py
  U   Zope3/branches/jim-adapter/src/zope/app/container/interfaces.py
  U   Zope3/branches/jim-adapter/src/zope/app/container/size.py
  U   Zope3/branches/jim-adapter/src/zope/app/container/tests/test_size.py
  U   Zope3/branches/jim-adapter/src/zope/app/copypastemove/__init__.py
  D   Zope3/branches/jim-adapter/src/zope/app/datetimeutils.py
  U   Zope3/branches/jim-adapter/src/zope/app/dav/adapter.py
  U   Zope3/branches/jim-adapter/src/zope/app/dav/tests/test_adapter.py
  U   Zope3/branches/jim-adapter/src/zope/app/dav/tests/test_propfind.py
  U   Zope3/branches/jim-adapter/src/zope/app/debug/debug.py
  D   Zope3/branches/jim-adapter/src/zope/app/decorator.py
  U   Zope3/branches/jim-adapter/src/zope/app/dependable/interfaces.py
  U   Zope3/branches/jim-adapter/src/zope/app/dtmlpage/ftests.py
  U   Zope3/branches/jim-adapter/src/zope/app/dublincore/tests/test_zopedublincore.py
  U   Zope3/branches/jim-adapter/src/zope/app/dublincore/zopedublincore.py
  U   Zope3/branches/jim-adapter/src/zope/app/error/__init__.py
  U   Zope3/branches/jim-adapter/src/zope/app/event/interfaces.py
  U   Zope3/branches/jim-adapter/src/zope/app/event/objectevent.py
  U   Zope3/branches/jim-adapter/src/zope/app/event/tests/placelesssetup.py
  U   Zope3/branches/jim-adapter/src/zope/app/event/tests/test_objectevent.py
  U   Zope3/branches/jim-adapter/src/zope/app/exception/browser/configure.zcml
  U   Zope3/branches/jim-adapter/src/zope/app/exception/browser/ftests.py
  U   Zope3/branches/jim-adapter/src/zope/app/exception/browser/systemerror.txt
  U   Zope3/branches/jim-adapter/src/zope/app/exception/interfaces.py
  U   Zope3/branches/jim-adapter/src/zope/app/file/browser/file.py
  U   Zope3/branches/jim-adapter/src/zope/app/file/browser/ftests.py
  U   Zope3/branches/jim-adapter/src/zope/app/file/browser/image.py
  U   Zope3/branches/jim-adapter/src/zope/app/file/configure.zcml
  U   Zope3/branches/jim-adapter/src/zope/app/file/image.py
  U   Zope3/branches/jim-adapter/src/zope/app/file/tests/test_image.py
  U   Zope3/branches/jim-adapter/src/zope/app/folder/folder.py
  U   Zope3/branches/jim-adapter/src/zope/app/form/browser/add.py
  U   Zope3/branches/jim-adapter/src/zope/app/form/browser/editview.py
  U   Zope3/branches/jim-adapter/src/zope/app/form/browser/ftests/test_datetimewidget.py
  U   Zope3/branches/jim-adapter/src/zope/app/form/browser/schemadisplay.py
  U   Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_add.py
  U   Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_datetimewidget.py
  U   Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_datewidget.py
  U   Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_directives.py
  U   Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_editview.py
  U   Zope3/branches/jim-adapter/src/zope/app/form/browser/textwidgets.py
  U   Zope3/branches/jim-adapter/src/zope/app/form/browser/widgets.txt
  U   Zope3/branches/jim-adapter/src/zope/app/form/interfaces.py
  U   Zope3/branches/jim-adapter/src/zope/app/form/tests/test_utility.py
  U   Zope3/branches/jim-adapter/src/zope/app/form/tests/test_widget.py
  U   Zope3/branches/jim-adapter/src/zope/app/fssync/fsregistry.py
  U   Zope3/branches/jim-adapter/src/zope/app/http/exception/configure.zcml
  U   Zope3/branches/jim-adapter/src/zope/app/i18n/__init__.py
  U   Zope3/branches/jim-adapter/src/zope/app/i18n/tests/testi18ndirectives.py
  U   Zope3/branches/jim-adapter/src/zope/app/i18n/translationdomain.py
  U   Zope3/branches/jim-adapter/src/zope/app/i18nfile/browser/i18nimage.py
  U   Zope3/branches/jim-adapter/src/zope/app/introspector/browser.py
  U   Zope3/branches/jim-adapter/src/zope/app/locales/extract.py
  U   Zope3/branches/jim-adapter/src/zope/app/location/location.py
  U   Zope3/branches/jim-adapter/src/zope/app/locking/configure.zcml
  U   Zope3/branches/jim-adapter/src/zope/app/locking/interfaces.py
  U   Zope3/branches/jim-adapter/src/zope/app/locking/storage.py
  U   Zope3/branches/jim-adapter/src/zope/app/locking/tests.py
  U   Zope3/branches/jim-adapter/src/zope/app/mail/tests/test_directives.py
  U   Zope3/branches/jim-adapter/src/zope/app/module/README.txt
  U   Zope3/branches/jim-adapter/src/zope/app/module/configure.zcml
  D   Zope3/branches/jim-adapter/src/zope/app/observable/
  U   Zope3/branches/jim-adapter/src/zope/app/onlinehelp/__init__.py
  U   Zope3/branches/jim-adapter/src/zope/app/onlinehelp/onlinehelp.py
  U   Zope3/branches/jim-adapter/src/zope/app/onlinehelp/tests/test_treeview.py
  U   Zope3/branches/jim-adapter/src/zope/app/pagetemplate/configure.zcml
  U   Zope3/branches/jim-adapter/src/zope/app/pagetemplate/engine.py
  U   Zope3/branches/jim-adapter/src/zope/app/pagetemplate/talesapi.py
  U   Zope3/branches/jim-adapter/src/zope/app/pagetemplate/tests/test_talesapi.py
  D   Zope3/branches/jim-adapter/src/zope/app/presentation/
  U   Zope3/branches/jim-adapter/src/zope/app/publication/browser.py
  U   Zope3/branches/jim-adapter/src/zope/app/publication/httpfactory.py
  U   Zope3/branches/jim-adapter/src/zope/app/publication/interfaces.py
  U   Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_browserpublication.py
  U   Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_httpfactory.py
  U   Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_requestpublicationfactories.py
  U   Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_requestpublicationregistry.py
  U   Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_simplecomponenttraverser.py
  U   Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_zopepublication.py
  U   Zope3/branches/jim-adapter/src/zope/app/publication/traversers.py
  U   Zope3/branches/jim-adapter/src/zope/app/publisher/browser/fields.py
  U   Zope3/branches/jim-adapter/src/zope/app/publisher/browser/fileresource.py
  U   Zope3/branches/jim-adapter/src/zope/app/publisher/browser/viewmeta.py
  U   Zope3/branches/jim-adapter/src/zope/app/publisher/fieldconverters.py
  U   Zope3/branches/jim-adapter/src/zope/app/publisher/fileresource.py
  U   Zope3/branches/jim-adapter/src/zope/app/publisher/xmlrpc/tests/test_directives.py
  U   Zope3/branches/jim-adapter/src/zope/app/publisher/xmlrpc/tests/xmlrpc_error.zcml
  D   Zope3/branches/jim-adapter/src/zope/app/registration/
  U   Zope3/branches/jim-adapter/src/zope/app/schema/tests/test_fieldfactory.py
  U   Zope3/branches/jim-adapter/src/zope/app/schema/tests/test_interfaceutility.py
  U   Zope3/branches/jim-adapter/src/zope/app/schemacontent/browser/__init__.py
  U   Zope3/branches/jim-adapter/src/zope/app/schemacontent/tests/test_content.py
  U   Zope3/branches/jim-adapter/src/zope/app/security/_protections.py
  U   Zope3/branches/jim-adapter/src/zope/app/security/interfaces.py
  U   Zope3/branches/jim-adapter/src/zope/app/security/principal.py
  U   Zope3/branches/jim-adapter/src/zope/app/security/tests/__init__.py
  U   Zope3/branches/jim-adapter/src/zope/app/security/tests/test_securitydirectives.py
  U   Zope3/branches/jim-adapter/src/zope/app/security/vocabulary.py
  U   Zope3/branches/jim-adapter/src/zope/app/securitypolicy/browser/ftests.py
  U   Zope3/branches/jim-adapter/src/zope/app/securitypolicy/browser/rolepermissionview.py
  U   Zope3/branches/jim-adapter/src/zope/app/securitypolicy/browser/tests/test_rolepermissionview.py
  U   Zope3/branches/jim-adapter/src/zope/app/securitypolicy/role.py
  U   Zope3/branches/jim-adapter/src/zope/app/servicenames.py
  U   Zope3/branches/jim-adapter/src/zope/app/session/http.py
  U   Zope3/branches/jim-adapter/src/zope/app/session/session.py
  U   Zope3/branches/jim-adapter/src/zope/app/site/interfaces.py
  D   Zope3/branches/jim-adapter/src/zope/app/size/
  U   Zope3/branches/jim-adapter/src/zope/app/sqlexpr/sqlexpr.py
  U   Zope3/branches/jim-adapter/src/zope/app/sqlexpr/tests.py
  A   Zope3/branches/jim-adapter/src/zope/app/testing/back35.py
  U   Zope3/branches/jim-adapter/src/zope/app/testing/functional.py
  U   Zope3/branches/jim-adapter/src/zope/app/testing/placelesssetup.py
  U   Zope3/branches/jim-adapter/src/zope/app/testing/setup.py
  U   Zope3/branches/jim-adapter/src/zope/app/testing/ztapi.py
  D   Zope3/branches/jim-adapter/src/zope/app/tests/
  D   Zope3/branches/jim-adapter/src/zope/app/timezones.py
  U   Zope3/branches/jim-adapter/src/zope/app/traversing/adapters.py
  U   Zope3/branches/jim-adapter/src/zope/app/traversing/api.py
  U   Zope3/branches/jim-adapter/src/zope/app/traversing/browser/configure.zcml
  U   Zope3/branches/jim-adapter/src/zope/app/traversing/namespace.py
  U   Zope3/branches/jim-adapter/src/zope/app/tree/adapters.py
  U   Zope3/branches/jim-adapter/src/zope/app/tree/browser/cookie.py
  U   Zope3/branches/jim-adapter/src/zope/app/tree/tests/test_adapters.py
  U   Zope3/branches/jim-adapter/src/zope/app/undo/__init__.py
  U   Zope3/branches/jim-adapter/src/zope/app/versioncontrol/README.txt
  U   Zope3/branches/jim-adapter/src/zope/app/versioncontrol/interfaces.py
  U   Zope3/branches/jim-adapter/src/zope/app/versioncontrol/repository.py
  U   Zope3/branches/jim-adapter/src/zope/app/versioncontrol/tests.py
  U   Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/contentworkflow.py
  U   Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/definition.py
  U   Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/instance.py
  U   Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/tests/test_instance.py
  U   Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/tests/test_xmlimportexport.py
  U   Zope3/branches/jim-adapter/src/zope/app/workflow/tests/workflowsetup.py
  U   Zope3/branches/jim-adapter/src/zope/app/xmlrpcintrospection/xmlrpcintrospection.py
  U   Zope3/branches/jim-adapter/src/zope/app/zapi/__init__.py
  U   Zope3/branches/jim-adapter/src/zope/app/zapi/interfaces.py
  U   Zope3/branches/jim-adapter/src/zope/app/zptpage/configure.zcml
  U   Zope3/branches/jim-adapter/src/zope/app/zptpage/tests/test_zptpage.py
  U   Zope3/branches/jim-adapter/src/zope/app/zptpage/zptpage.py
  U   Zope3/branches/jim-adapter/src/zope/component/DEPENDENCIES.cfg
  U   Zope3/branches/jim-adapter/src/zope/component/__init__.py
  A   Zope3/branches/jim-adapter/src/zope/component/adapter.py
  U   Zope3/branches/jim-adapter/src/zope/component/bbb/__init__.py
  D   Zope3/branches/jim-adapter/src/zope/component/bbb/adapter.py
  D   Zope3/branches/jim-adapter/src/zope/component/bbb/contextdependent.py
  D   Zope3/branches/jim-adapter/src/zope/component/bbb/exceptions.py
  D   Zope3/branches/jim-adapter/src/zope/component/bbb/service.py
  D   Zope3/branches/jim-adapter/src/zope/component/bbb/servicenames.py
  D   Zope3/branches/jim-adapter/src/zope/component/bbb/tests/
  D   Zope3/branches/jim-adapter/src/zope/component/bbb/utility.py
  A   Zope3/branches/jim-adapter/src/zope/component/contextdependent.py
  A   Zope3/branches/jim-adapter/src/zope/component/exceptions.py
  U   Zope3/branches/jim-adapter/src/zope/component/factory.txt
  A   Zope3/branches/jim-adapter/src/zope/component/globalregistry.py
  U   Zope3/branches/jim-adapter/src/zope/component/interfaces.py
  A   Zope3/branches/jim-adapter/src/zope/component/persistentregistry.py
  A   Zope3/branches/jim-adapter/src/zope/component/persistentregistry.txt
  A   Zope3/branches/jim-adapter/src/zope/component/registry.py
  A   Zope3/branches/jim-adapter/src/zope/component/registry.txt
  A   Zope3/branches/jim-adapter/src/zope/component/service.py
  A   Zope3/branches/jim-adapter/src/zope/component/servicenames.py
  UU  Zope3/branches/jim-adapter/src/zope/component/site.py
  U   Zope3/branches/jim-adapter/src/zope/component/socketexample.txt
  U   Zope3/branches/jim-adapter/src/zope/component/tests.py
  A   Zope3/branches/jim-adapter/src/zope/component/utility.py
  U   Zope3/branches/jim-adapter/src/zope/contentprovider/README.txt
  A   Zope3/branches/jim-adapter/src/zope/datetime/
  A   Zope3/branches/jim-adapter/src/zope/decorator/
  A   Zope3/branches/jim-adapter/src/zope/deferredimport/
  U   Zope3/branches/jim-adapter/src/zope/deprecation/README.txt
  U   Zope3/branches/jim-adapter/src/zope/deprecation/__init__.py
  U   Zope3/branches/jim-adapter/src/zope/deprecation/deprecation.py
  U   Zope3/branches/jim-adapter/src/zope/exceptions/DEPENDENCIES.cfg
  U   Zope3/branches/jim-adapter/src/zope/exceptions/__init__.py
  D   Zope3/branches/jim-adapter/src/zope/exceptions/_duplicate.py
  D   Zope3/branches/jim-adapter/src/zope/exceptions/_notfounderror.py
  U   Zope3/branches/jim-adapter/src/zope/exceptions/interfaces.py
  U   Zope3/branches/jim-adapter/src/zope/formlib/form.py
  U   Zope3/branches/jim-adapter/src/zope/i18n/__init__.py
  D   Zope3/branches/jim-adapter/src/zope/i18n/messageid.py
  U   Zope3/branches/jim-adapter/src/zope/i18n/tests/test_itranslationdomain.py
  U   Zope3/branches/jim-adapter/src/zope/i18n/tests/test_negotiator.py
  U   Zope3/branches/jim-adapter/src/zope/i18n/tests/test_translationdomain.py
  U   Zope3/branches/jim-adapter/src/zope/i18n/translationdomain.py
  U   Zope3/branches/jim-adapter/src/zope/i18nmessageid/DEPENDENCIES.cfg
  U   Zope3/branches/jim-adapter/src/zope/i18nmessageid/__init__.py
  D   Zope3/branches/jim-adapter/src/zope/i18nmessageid/messageid.py
  U   Zope3/branches/jim-adapter/src/zope/i18nmessageid/tests.py
  U   Zope3/branches/jim-adapter/src/zope/interface/__init__.py
  U   Zope3/branches/jim-adapter/src/zope/interface/adapter.py
  U   Zope3/branches/jim-adapter/src/zope/interface/adapter.txt
  U   Zope3/branches/jim-adapter/src/zope/interface/declarations.py
  U   Zope3/branches/jim-adapter/src/zope/interface/interface.py
  U   Zope3/branches/jim-adapter/src/zope/interface/interfaces.py
  U   Zope3/branches/jim-adapter/src/zope/interface/tests/test_declarations.py
  U   Zope3/branches/jim-adapter/src/zope/proxy/__init__.py
  U   Zope3/branches/jim-adapter/src/zope/proxy/_zope_proxy_proxy.c
  U   Zope3/branches/jim-adapter/src/zope/proxy/tests/test_proxy.py
  U   Zope3/branches/jim-adapter/src/zope/publisher/browser.py
  U   Zope3/branches/jim-adapter/src/zope/publisher/interfaces/__init__.py
  A   Zope3/branches/jim-adapter/src/zope/publisher/tests/test_browser.py
  U   Zope3/branches/jim-adapter/src/zope/security/checker.py
  A   Zope3/branches/jim-adapter/src/zope/size/
  U   Zope3/branches/jim-adapter/src/zope/tal/dummyengine.py
  U   Zope3/branches/jim-adapter/src/zope/tal/talinterpreter.py
  U   Zope3/branches/jim-adapter/src/zope/tal/tests/test_talinterpreter.py
  U   Zope3/branches/jim-adapter/src/zope/tales/expressions.py
  U   Zope3/branches/jim-adapter/src/zope/tales/tests/test_expressions.py
  U   Zope3/branches/jim-adapter/src/zope/viewlet/README.txt
  U   Zope3/branches/jim-adapter/src/zope/wfmc/README.txt
  U   Zope3/branches/jim-adapter/src/zope/wfmc/xpdl.txt
  U   Zope3/branches/jim-adapter/src/zwiki/tests/test_traverser.py
  U   Zope3/branches/jim-adapter/src/zwiki/wikipage.py
  A   Zope3/branches/jim-adapter/to-do.txt
  U   Zope3/branches/jim-adapter/utilities/runurl.py

-=-
Modified: Zope3/branches/jim-adapter/src/bugtracker/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/bugtracker/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/bugtracker/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,5 +15,5 @@
 
 $Id$
 """
-from zope.i18n import MessageIDFactory
-TrackerMessageID = MessageIDFactory('bugtracker')
+from zope.i18nmessageid import MessageFactory
+TrackerMessageID = MessageFactory('bugtracker')

Modified: Zope3/branches/jim-adapter/src/bugtracker/browser/bug.py
===================================================================
--- Zope3/branches/jim-adapter/src/bugtracker/browser/bug.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/bugtracker/browser/bug.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -25,12 +25,12 @@
 from zope.schema.vocabulary import getVocabularyRegistry
 from zope.security.checker import getChecker
 from zope.structuredtext.html import HTML
+from zope.size.interfaces import ISized
 
 from zope.app import zapi
 from zope.app.dublincore.interfaces import IZopeDublinCore
 from zope.app.form import CustomWidgetFactory
 from zope.app.form.browser import TextWidget, TextAreaWidget, DropdownWidget
-from zope.app.size.interfaces import ISized
 from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
 
 from bugtracker.interfaces import IComment

Modified: Zope3/branches/jim-adapter/src/bugtracker/tests/placelesssetup.py
===================================================================
--- Zope3/branches/jim-adapter/src/bugtracker/tests/placelesssetup.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/bugtracker/tests/placelesssetup.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -24,6 +24,8 @@
 from zope.component.interfaces import IFactory
 from zope.interface import classImplements, implements
 from zope.schema.vocabulary import getVocabularyRegistry
+from zope.size.interfaces import ISized
+from zope.size import DefaultSized
 
 from zope.app import zapi
 from zope.app.testing import ztapi
@@ -41,11 +43,9 @@
 from zope.app.renderer.plaintext import PlainTextToHTMLRenderer
 from zope.app.renderer.plaintext import PlainTextSourceFactory
 from zope.app.security.interfaces import IAuthentication
-from zope.app.size.interfaces import ISized
 from zope.app.traversing.interfaces import IContainmentRoot, ITraverser
 from zope.app.traversing.interfaces import ITraversable, IPhysicallyLocatable
 from zope.app.security.principalregistry import principalRegistry
-from zope.app.size import DefaultSized
 from zope.app.traversing.adapters import DefaultTraversable, Traverser
 from zope.app.traversing.interfaces import IPhysicallyLocatable
 

Modified: Zope3/branches/jim-adapter/src/bugtracker/tests/test_dependencies.py
===================================================================
--- Zope3/branches/jim-adapter/src/bugtracker/tests/test_dependencies.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/bugtracker/tests/test_dependencies.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -18,7 +18,7 @@
 import unittest
 
 from zope.interface import classImplements
-from zope.component.tests.placelesssetup import PlacelessSetup
+from zope.component.testing import PlacelessSetup
 
 from zope.app.testing import ztapi
 from zope.app.annotation.interfaces import IAnnotations, IAttributeAnnotatable

Modified: Zope3/branches/jim-adapter/src/bugtracker/tests/test_mail.py
===================================================================
--- Zope3/branches/jim-adapter/src/bugtracker/tests/test_mail.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/bugtracker/tests/test_mail.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,7 +17,7 @@
 """
 import unittest
 
-from zope.component.tests.placelesssetup import PlacelessSetup
+from zope.component.testing import PlacelessSetup
 from zope.interface import classImplements, implements
 
 from zope.app.testing import ztapi

Modified: Zope3/branches/jim-adapter/src/bugtracker/tests/test_xmlexportimport.py
===================================================================
--- Zope3/branches/jim-adapter/src/bugtracker/tests/test_xmlexportimport.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/bugtracker/tests/test_xmlexportimport.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -18,8 +18,8 @@
 import unittest, os
 from datetime import datetime
 
+from zope.datetime import parseDatetimetz
 from zope.app.file import File
-from zope.app.datetimeutils import parseDatetimetz
 from zope.app.dublincore.interfaces import IZopeDublinCore
 
 from bugtracker import tests

Modified: Zope3/branches/jim-adapter/src/bugtracker/vocabulary.py
===================================================================
--- Zope3/branches/jim-adapter/src/bugtracker/vocabulary.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/bugtracker/vocabulary.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -99,8 +99,8 @@
 
     def delete(self, value):
         if value == self.default.value:
-            error_msg = _("Cannot delete default value '${value}'.")
-            error_msg.mapping = {'value': value}
+            error_msg = _("Cannot delete default value '${value}'.",
+                          mapping = {'value': value})
             raise ValueError(error_msg)
         del self.annotations[self.key][value]
 
@@ -123,8 +123,7 @@
             value = value.value
         if value not in self:
             error_msg = _("The value '${value}' was not found in the "
-                          "vocabulary")
-            error_msg.mapping = {'value': value}
+                          "vocabulary", mapping={'value': value})
             raise ValueError(error_msg)
         self.annotations[self.key+'/default'] = value
 

Modified: Zope3/branches/jim-adapter/src/z3checkins/browser.py
===================================================================
--- Zope3/branches/jim-adapter/src/z3checkins/browser.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/z3checkins/browser.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -10,9 +10,9 @@
 from zope.interface import implements
 from zope.exceptions import DuplicationError
 from zope.proxy import removeAllProxies
+from zope.datetime import parseDatetimetz, DateTimeError
 
 from zope.app import zapi
-from zope.app.datetimeutils import parseDatetimetz, DateTimeError
 from zope.app.publisher.browser import BrowserView
 from zope.app.form import CustomWidgetFactory
 from zope.app.form.browser import FileWidget

Modified: Zope3/branches/jim-adapter/src/z3checkins/configure.zcml
===================================================================
--- Zope3/branches/jim-adapter/src/z3checkins/configure.zcml	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/z3checkins/configure.zcml	2006-04-04 15:56:58 UTC (rev 66397)
@@ -61,7 +61,7 @@
   <adapter for=".interfaces.IMessage"
            factory=".folder.MessageSized"
            permission="zope.View"
-           provides="zope.app.size.interfaces.ISized" />
+           provides="zope.size.interfaces.ISized" />
 
 
   <utility factory=".message.CheckinMessageParser"

Modified: Zope3/branches/jim-adapter/src/z3checkins/folder.py
===================================================================
--- Zope3/branches/jim-adapter/src/z3checkins/folder.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/z3checkins/folder.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -8,10 +8,10 @@
 
 from persistent.list import PersistentList
 from zope.interface import implements
+from zope.size.interfaces import ISized
 from zope.app.container.btree import BTreeContainer
 from zope.app.container.interfaces import INameChooser
 from zope.app.container.interfaces import IContainerNamesContainer
-from zope.app.size.interfaces import ISized
 from z3checkins.interfaces import ICheckinFolder, IMessage
 
 

Modified: Zope3/branches/jim-adapter/src/z3checkins/message.py
===================================================================
--- Zope3/branches/jim-adapter/src/z3checkins/message.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/z3checkins/message.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -27,11 +27,11 @@
 from zope.exceptions import DuplicationError
 from zope.interface import implements
 from zope.proxy import removeAllProxies
+from zope.datetime import parseDatetimetz, DateTimeError
 
 from zope.app import zapi
 from zope.app.container.contained import Contained
 from zope.app.container.interfaces import IReadContainer
-from zope.app.datetimeutils import parseDatetimetz, DateTimeError
 from zope.app.dublincore.interfaces import IZopeDublinCore
 from zope.app.form import CustomWidgetFactory
 from zope.app.form.browser import FileWidget

Modified: Zope3/branches/jim-adapter/src/z3checkins/tests/test_message.py
===================================================================
--- Zope3/branches/jim-adapter/src/z3checkins/tests/test_message.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/z3checkins/tests/test_message.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -268,7 +268,7 @@
 
     def test_interface(self):
         from z3checkins.folder import MessageSized
-        from zope.app.size.interfaces import ISized
+        from zope.size.interfaces import ISized
         self.assert_(ISized.providedBy(MessageSized(MessageStub())))
 
     def test_sizeForSorting(self):

Modified: Zope3/branches/jim-adapter/src/zope/app/DEPENDENCIES.cfg
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/DEPENDENCIES.cfg	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/DEPENDENCIES.cfg	2006-04-04 15:56:58 UTC (rev 66397)
@@ -7,6 +7,9 @@
 zope.cachedescriptors
 zope.component
 zope.configuration
+zope.datetime
+zope.decorator
+zope.deferredimport
 zope.deprecation
 zope.dottedname
 zope.event
@@ -25,6 +28,7 @@
 zope.schema
 zope.security
 zope.server
+zope.size
 zope.tal
 zope.tales
 zope.testbrowser

Modified: Zope3/branches/jim-adapter/src/zope/app/PACKAGE.cfg
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/PACKAGE.cfg	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/PACKAGE.cfg	2006-04-04 15:56:58 UTC (rev 66397)
@@ -42,11 +42,7 @@
 contenttypes
 content_types.py
 copypastemove
-# Maybe convert to a package as well.
-datetimeutils.py
 debug
-# move to zope.app.location
-decorator.py
 dependable
 dublincore
 error
@@ -70,18 +66,14 @@
 principalannotation
 publication
 publisher
-registration
 rotterdam
 schema
 security
 servicenames.py
 site
-size
 skins.py
 tests
 testing
-# This should go into the (new) datetimeutils package
-timezones.py
 locales
 traversing
 utility

Modified: Zope3/branches/jim-adapter/src/zope/app/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,3 +15,36 @@
 
 $Id$
 """
+##############################################################################
+# BBB 2006/04/03 -- to be removed after 12 months
+
+import sys
+from zope.deprecation import deprecated
+
+import zope.decorator
+import zope.datetime
+import zope.datetime.timezones
+import zope.size
+import zope.size.interfaces
+
+sys.modules['zope.app.decorator'] = deprecated(
+    zope.decorator, "zope.app.decorator has been renamed to zope.decorator. "
+    "This alias will be removed in Zope 3.5.")
+
+sys.modules['zope.app.datetimeutils'] = deprecated(
+    zope.datetime, "zope.app.datetimeutils has been renamed to zope.datetime. "
+    "This alias will be removed in Zope 3.5.")
+
+sys.modules['zope.app.timezones'] = deprecated(
+    zope.datetime.timezones, "zope.app.timezones has been renamed to "
+    "zope.datetime.timezones.  This alias will be removed in Zope 3.5.")
+
+sys.modules['zope.app.size'] = deprecated(
+    zope.size, "zope.app.size has been renamed to zope.size. This alias will "
+    "be removed in Zope 3.5.")
+
+sys.modules['zope.app.size.interfaces'] = deprecated(
+    zope.size, "zope.app.size has been renamed to zope.size. This alias will "
+    "be removed in Zope 3.5.")
+
+##############################################################################


Property changes on: Zope3/branches/jim-adapter/src/zope/app/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: Zope3/branches/jim-adapter/src/zope/app/apidoc/bookmodule/book.zcml
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/apidoc/bookmodule/book.zcml	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/apidoc/bookmodule/book.zcml	2006-04-04 15:56:58 UTC (rev 66397)
@@ -83,18 +83,6 @@
         doc_path="README.txt"
         />
     <bookchapter
-        id="registration"
-        title="Registration Framework"
-        parent="ca/local"
-        doc_path="registration.txt"
-        />
-    <bookchapter
-        id="adapterregistry"
-        title="Local Adapter Registry"
-        parent="ca/local"
-        doc_path="adapterregistry.txt"
-        />
-    <bookchapter
         id="site"
         title="Local Sites &amp; Site Managers"
         parent="ca/local"

Modified: Zope3/branches/jim-adapter/src/zope/app/apidoc/component.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/apidoc/component.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/apidoc/component.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -19,8 +19,13 @@
 import types
 
 from zope.component.interfaces import IFactory
-from zope.component.site import AdapterRegistration, SubscriptionRegistration
-from zope.component.site import UtilityRegistration
+from zope.component.registry import (
+    AdapterRegistration,
+    SubscriptionRegistration,
+    HandlerRegistration,
+    )
+    
+from zope.component.registry import UtilityRegistration
 from zope.interface import Interface
 from zope.interface.interface import InterfaceClass
 import zope.interface.declarations
@@ -40,23 +45,23 @@
 def getRequiredAdapters(iface, withViews=False):
     """Get adapter registrations where the specified interface is required."""
     gsm = zapi.getGlobalSiteManager()
-    for reg in gsm.registrations():
-        # Only get adapters
-        if not isinstance(reg, (AdapterRegistration, SubscriptionRegistration)):
-            continue
-        # Ignore adapters that have no required interfaces
-        if len(reg.required) == 0:
-            continue
-        # Ignore views
-        if not withViews and reg.required[-1] and \
-               reg.required[-1].isOrExtends(IRequest):
-            continue
-        # Only get the adapters for which this interface is required
-        for required_iface in reg.required:
-            if iface.isOrExtends(required_iface):
-                yield reg
+    for meth in ('registeredAdapters',
+                 'registeredSubscriptionAdapters',
+                 'registeredHandlers'):
 
+        for reg in getattr(gsm, meth)():
+            # Ignore adapters that have no required interfaces
+            if len(reg.required) == 0:
+                continue
+            # Ignore views
+            if not withViews and reg.required[-1].isOrExtends(IRequest):
+                continue
+            # Only get the adapters for which this interface is required
+            for required_iface in reg.required:
+                if iface.isOrExtends(required_iface):
+                    yield reg
 
+
 def getProvidedAdapters(iface, withViews=False):
     """Get adapter registrations where this interface is provided."""
     gsm = zapi.getGlobalSiteManager()
@@ -109,9 +114,7 @@
     """Return the factory registrations, who will return objects providing this
     interface."""
     gsm = zapi.getGlobalSiteManager()
-    for reg in gsm.registrations():
-        if not isinstance(reg, UtilityRegistration):
-            continue
+    for reg in gsm.registeredUtilities():
         if reg.provided is not IFactory:
             continue
         interfaces = reg.component.getInterfaces()
@@ -128,9 +131,7 @@
 def getUtilities(iface):
     """Return all utility registrations that provide the interface."""
     gsm = zapi.getGlobalSiteManager()
-    for reg in gsm.registrations():
-        if not isinstance(reg, UtilityRegistration):
-            continue
+    for reg in gsm.registeredUtilities():
         if reg.provided.isOrExtends(iface):
             yield reg
 
@@ -174,26 +175,26 @@
 
 def getAdapterInfoDictionary(reg):
     """Return a PT-friendly info dictionary for an adapter registration."""
-    factory = getRealFactory(reg.value)
+    factory = getRealFactory(reg.factory)
     path = getPythonPath(factory)
 
     url = None
     if isReferencable(path):
         url = path.replace('.', '/')
 
-    if isinstance(reg.doc, (str, unicode)):
-        doc = reg.doc
+    if isinstance(reg.info, (str, unicode)):
+        doc = reg.info
         zcml = None
     else:
         doc = None
-        zcml = getParserInfoInfoDictionary(reg.doc)
+        zcml = getParserInfoInfoDictionary(reg.info)
 
     return {
         'provided': getInterfaceInfoDictionary(reg.provided),
         'required': [getInterfaceInfoDictionary(iface)
                      for iface in reg.required
                      if iface is not None],
-        'name': getattr(reg, 'name', _('<subscription>')),
+        'name': getattr(reg, 'name', ''),
         'factory': path,
         'factory_url': url,
         'doc': doc,

Modified: Zope3/branches/jim-adapter/src/zope/app/apidoc/component.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/apidoc/component.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/apidoc/component.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -44,10 +44,16 @@
   >>> regs = list(component.getRequiredAdapters(IFoo))
   >>> regs.sort()
   >>> regs
-  [AdapterRegistration(('IFoo', 'IBar'), 'ISpecialResult', '', None, ''),
-   AdapterRegistration(('IFoo',), 'IResult', '', None, ''),
-   SubscriptionRegistration(('IFoo',), None, 'stubFactory', '')]
+  [AdapterRegistration(<BaseGlobalComponents base>, 
+                       [IFoo, IBar], ISpecialResult, '', None, u''), 
+   AdapterRegistration(<BaseGlobalComponents base>, 
+                       [IFoo], IResult, '', None, u''), 
+   HandlerRegistration(<BaseGlobalComponents base>, 
+                       [IFoo], u'', 'stubFactory', u'')]
 
+
+
+
 Note how the adapter requiring an `IRequest` at the end of the required
 interfaces is neglected. This is because it is recognized as a view and views
 are not returned by default. But you can simply turn this flag on:
@@ -55,27 +61,37 @@
   >>> regs = list(component.getRequiredAdapters(IFoo, withViews=True))
   >>> regs.sort()
   >>> regs
-  [AdapterRegistration(('IFoo', 'IBar'), 'ISpecialResult', '', None, ''),
-   AdapterRegistration(('IFoo', 'IRequest'), 'ISpecialResult', '', None, ''),
-   AdapterRegistration(('IFoo',), 'IResult', '', None, ''),
-   SubscriptionRegistration(('IFoo',), None, 'stubFactory', '')]
+  [AdapterRegistration(<BaseGlobalComponents base>, 
+                       [IFoo, IBar], ISpecialResult, '', None, u''), 
+   AdapterRegistration(<BaseGlobalComponents base>, 
+                       [IFoo, IRequest], ISpecialResult, '', None, u''), 
+   AdapterRegistration(<BaseGlobalComponents base>, 
+                       [IFoo], IResult, '', None, u''), 
+   HandlerRegistration(<BaseGlobalComponents base>, 
+                       [IFoo], u'', 'stubFactory', u'')]
 
+
+
 The function will also pick up registrations that have required interfaces the
 specified interface extends:
 
   >>> regs = list(component.getRequiredAdapters(IFoo))
   >>> regs.sort()
   >>> regs
-  [AdapterRegistration(('IFoo', 'IBar'), 'ISpecialResult', '', None, ''),
-   AdapterRegistration(('IFoo',), 'IResult', '', None, ''),
-   SubscriptionRegistration(('IFoo',), None, 'stubFactory', '')]
+  [AdapterRegistration(<BaseGlobalComponents base>, 
+                       [IFoo, IBar], ISpecialResult, '', None, u''),
+   AdapterRegistration(<BaseGlobalComponents base>,
+                       [IFoo], IResult, '', None, u''), 
+   HandlerRegistration(<BaseGlobalComponents base>,
+                       [IFoo], u'', 'stubFactory', u'')]
 
 And all of the required interfaces are considered, of course:
 
   >>> regs = list(component.getRequiredAdapters(IBar))
   >>> regs.sort()
   >>> regs
-  [AdapterRegistration(('IFoo', 'IBar'), 'ISpecialResult', '', None, '')]
+  [AdapterRegistration(<BaseGlobalComponents base>, 
+                       [IFoo, IBar], ISpecialResult, '', None, u'')]
 
 
 `getProvidedAdapters(iface, withViews=False)`
@@ -88,24 +104,30 @@
   >>> regs = list(component.getProvidedAdapters(ISpecialResult))
   >>> regs.sort()
   >>> regs
-  [AdapterRegistration(('IFoo', 'IBar'), 'ISpecialResult', '', None, '')]
+  [AdapterRegistration(<BaseGlobalComponents base>, 
+                       [IFoo, IBar], ISpecialResult, '', None, u'')]
 
 And by specifying the `withView` flag, we get views as well:
 
   >>> regs = list(component.getProvidedAdapters(ISpecialResult, withViews=True))
   >>> regs.sort()
   >>> regs
-  [AdapterRegistration(('IFoo', 'IBar'), 'ISpecialResult', '', None, ''),
-   AdapterRegistration(('IFoo', 'IRequest'), 'ISpecialResult', '', None, '')]
+  [AdapterRegistration(<BaseGlobalComponents base>, 
+                       [IFoo, IBar], ISpecialResult, '', None, u''), 
+   AdapterRegistration(<BaseGlobalComponents base>, 
+                       [IFoo, IRequest], ISpecialResult, '', None, u'')]
 
 We can of course also ask for adapters specifying `IResult`:
 
   >>> regs = list(component.getProvidedAdapters(IResult, withViews=True))
   >>> regs.sort()
   >>> regs
-  [AdapterRegistration(('IFoo', 'IBar'), 'ISpecialResult', '', None, ''),
-   AdapterRegistration(('IFoo', 'IRequest'), 'ISpecialResult', '', None, ''),
-   AdapterRegistration(('IFoo',), 'IResult', '', None, '')]
+  [AdapterRegistration(<BaseGlobalComponents base>, 
+                       [IFoo, IBar], ISpecialResult, '', None, u''),
+   AdapterRegistration(<BaseGlobalComponents base>,
+                       [IFoo, IRequest], ISpecialResult, '', None, u''),
+   AdapterRegistration(<BaseGlobalComponents base>,
+                       [IFoo], IResult, '', None, u'')]
 
 
 `getClasses(iface)`
@@ -167,16 +189,17 @@
   >>> regs = list(component.getFactories(IFooBar))
   >>> regs.sort()
   >>> regs
-  [UtilityRegistration('IFactory', 'MyFooBar',
-      <Factory for <class 'zope.app.apidoc.doctest.MyFooBar'>>, '')]
+  [UtilityRegistration(<BaseGlobalComponents base>, 
+      IFactory, 'MyFooBar',
+      <Factory for <class 'zope.app.apidoc.doctest.MyFooBar'>>, u'')]
 
   >>> regs = list(component.getFactories(IFoo))
   >>> regs.sort()
   >>> regs
-  [UtilityRegistration('IFactory', 'MyFoo',
-      <Factory for <class 'zope.app.apidoc.doctest.MyFoo'>>, ''),
-   UtilityRegistration('IFactory', 'MyFooBar',
-      <Factory for <class 'zope.app.apidoc.doctest.MyFooBar'>>, '')]
+  [UtilityRegistration(<BaseGlobalComponents base>, IFactory, 'MyFoo', 
+               <Factory for <class 'zope.app.apidoc.doctest.MyFoo'>>, u''),
+   UtilityRegistration(<BaseGlobalComponents base>, IFactory, 'MyFooBar',
+            <Factory for <class 'zope.app.apidoc.doctest.MyFooBar'>>, u'')]
 
 
 `getUtilities(iface)`
@@ -196,16 +219,16 @@
   >>> regs = list(component.getUtilities(IFooBar))
   >>> regs.sort()
   >>> regs #doctest:+ELLIPSIS
-  [UtilityRegistration('IFooBar', '',
-                       <zope.app.apidoc.doctest.MyFooBar object at ...>, '')]
+  [UtilityRegistration(<BaseGlobalComponents base>, IFooBar, '', 
+                       <zope.app.apidoc.doctest.MyFooBar object at ...>, u'')]
 
   >>> regs = list(component.getUtilities(IFoo))
   >>> regs.sort()
   >>> regs #doctest:+ELLIPSIS
-  [UtilityRegistration('IFoo', '',
-                       <zope.app.apidoc.doctest.MyFoo object at ...>, ''),
-   UtilityRegistration('IFooBar', '',
-                       <zope.app.apidoc.doctest.MyFooBar object at ...>, '')]
+  [UtilityRegistration(<BaseGlobalComponents base>, IFoo, '', 
+                       <zope.app.apidoc.doctest.MyFoo object at ...>, u''),
+   UtilityRegistration(<BaseGlobalComponents base>, IFooBar, '', 
+                       <zope.app.apidoc.doctest.MyFooBar object at ...>, u'')]
 
 
 `getRealFactory(factory)`
@@ -304,8 +327,8 @@
   >>> class MyResult(object):
   ...     implements(IResult)
 
-  >>> from zope.component.site import AdapterRegistration
-  >>> reg = AdapterRegistration((IFoo, IBar), IResult, 'FooToResult',
+  >>> from zope.component.registry import AdapterRegistration
+  >>> reg = AdapterRegistration(None, (IFoo, IBar), IResult, 'FooToResult',
   ...                            MyResult, 'doc info')
 
 And now get the info dictionary:
@@ -328,7 +351,7 @@
   >>> from zope.interface import classImplements
   >>> classImplements(MyResultType, IResult)
 
-  >>> reg = AdapterRegistration((IFoo, IBar), IResult, 'FooToResult',
+  >>> reg = AdapterRegistration(None, (IFoo, IBar), IResult, 'FooToResult',
   ...                            MyResultType, 'doc info')
   >>> pprint(component.getAdapterInfoDictionary(reg))
   {'doc': 'doc info',
@@ -344,14 +367,14 @@
 much like adapter registrations, except that they do not have a name. So let's
 see how the function handles subscriptions:
 
-  >>> from zope.component.site import SubscriptionRegistration
-  >>> reg = SubscriptionRegistration((IFoo, IBar), None, MyResult, 'doc info')
+  >>> from zope.component.registry import HandlerRegistration
+  >>> reg = HandlerRegistration(None, (IFoo, IBar), '', MyResult, 'doc info')
 
   >>> pprint(component.getAdapterInfoDictionary(reg))
   {'doc': 'doc info',
    'factory': 'zope.app.apidoc.doctest.MyResult',
    'factory_url': 'zope/app/apidoc/doctest/MyResult',
-   'name': u'<subscription>',
+   'name': '',
    'provided': None,
    'required': [{'module': 'zope.app.apidoc.doctest', 'name': 'IFoo'},
                 {'module': 'zope.app.apidoc.doctest', 'name': 'IBar'}],

Modified: Zope3/branches/jim-adapter/src/zope/app/apidoc/ifacemodule/browser.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/apidoc/ifacemodule/browser.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/apidoc/ifacemodule/browser.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -284,7 +284,6 @@
   >>> pprint(details.getSpecificRequiredAdapters())
   []
 
-
 `getExtendedRequiredAdapters()`
 -------------------------------
 
@@ -293,14 +292,104 @@
   >>> pprint(details.getExtendedRequiredAdapters())
   []
 
+Note that this includes all interfaces registered for
+interface.Interface.
 
+
 `getGenericRequiredAdapters()`
 ------------------------------
 
 Get adapters where this interface is required.
 
-  >>> pprint(details.getGenericRequiredAdapters())
-  []
+  >>> pprint(sorted(details.getGenericRequiredAdapters()))
+  [{'doc': u'',
+    'factory': 'None.append',
+    'factory_url': None,
+    'name': u'',
+    'provided': None,
+    'required': [{'module': 'zope.interface',
+                  'name': 'Interface'}],
+    'zcml': None},
+   {'doc': u'',
+    'factory': 'zope.app.location.traversing.LocationPhysicallyLocatable',
+    'factory_url': 'zope/app/location/traversing/LocationPhysicallyLocatable',
+    'name': '',
+    'provided': {'module': 'zope.app.traversing.interfaces',
+                 'name': 'IPhysicallyLocatable'},
+    'required': [{'module': 'zope.interface',
+                  'name': 'Interface'}],
+    'zcml': None},
+   {'doc': u'',
+    'factory': 'zope.app.traversing.adapters.DefaultTraversable',
+    'factory_url': 'zope/app/traversing/adapters/DefaultTraversable',
+    'name': '',
+    'provided': {'module': 'zope.app.traversing.interfaces',
+                 'name': 'ITraversable'},
+    'required': [{'module': 'zope.interface',
+                  'name': 'Interface'}],
+    'zcml': None},
+   {'doc': u'',
+    'factory': 'zope.app.traversing.adapters.Traverser',
+    'factory_url': 'zope/app/traversing/adapters/Traverser',
+    'name': '',
+    'provided': {'module': 'zope.app.traversing.interfaces',
+                 'name': 'ITraverser'},
+    'required': [{'module': 'zope.interface',
+                  'name': 'Interface'}],
+    'zcml': None},
+   {'doc': u'',
+    'factory': 'zope.app.traversing.namespace.etc',
+    'factory_url': 'zope/app/traversing/namespace/etc',
+    'name': 'etc',
+    'provided': {'module': 'zope.app.traversing.interfaces',
+                 'name': 'ITraversable'},
+    'required': [{'module': 'zope.interface',
+                  'name': 'Interface'}],
+    'zcml': None},
+   {'doc': u'',
+    'factory': 'zope.app.traversing.namespace.etc',
+    'factory_url': 'zope/app/traversing/namespace/etc',
+    'name': 'etc',
+    'provided': {'module': 'zope.app.traversing.interfaces',
+                 'name': 'ITraversable'},
+    'required': [{'module': 'zope.interface',
+                  'name': 'Interface'},
+                 {'module': 'zope.interface',
+                  'name': 'Interface'}],
+    'zcml': None},
+   {'doc': u'',
+    'factory': 'zope.app.traversing.namespace.etc',
+    'factory_url': 'zope/app/traversing/namespace/etc',
+    'name': 'etc',
+    'provided': {'module': 'zope.app.traversing.interfaces',
+                 'name': 'ITraversable'},
+    'required': [{'module': 'zope.interface',
+                  'name': 'Interface'},
+                 {'module': 'zope.interface',
+                  'name': 'Interface'}],
+    'zcml': None},
+   {'doc': u'',
+    'factory': 'zope.app.traversing.namespace.etc',
+    'factory_url': 'zope/app/traversing/namespace/etc',
+    'name': 'etc',
+    'provided': {'module': 'zope.app.traversing.interfaces',
+                 'name': 'ITraversable'},
+    'required': [{'module': 'zope.interface',
+                  'name': 'Interface'},
+                 {'module': 'zope.interface',
+                  'name': 'Interface'}],
+    'zcml': None},
+   {'doc': u'',
+    'factory': 'zope.app.traversing.namespace.etc',
+    'factory_url': 'zope/app/traversing/namespace/etc',
+    'name': 'etc',
+    'provided': {'module': 'zope.app.traversing.interfaces',
+                 'name': 'ITraversable'},
+    'required': [{'module': 'zope.interface',
+                  'name': 'Interface'},
+                 {'module': 'zope.interface',
+                  'name': 'Interface'}],
+    'zcml': None}]
 
 
 `getProvidedAdapters()`
@@ -309,7 +398,7 @@
 Get adapters where this interface is provided.
 
   >>> pprint(details.getProvidedAdapters())
-  [{'doc': '',
+  [{'doc': u'',
     'factory': '__builtin__.Foo',
     'factory_url': None,
     'name': '',
@@ -349,4 +438,4 @@
     'name': 'The Foo',
     'path': '__builtin__.Foo',
     'url': None,
-    'url_name': 'VGhlIEZvbw=='}]
\ No newline at end of file
+    'url_name': 'VGhlIEZvbw=='}]

Modified: Zope3/branches/jim-adapter/src/zope/app/apidoc/presentation.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/apidoc/presentation.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/apidoc/presentation.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -16,7 +16,7 @@
 $Id$
 """
 from types import ClassType, FunctionType
-from zope.component.site import AdapterRegistration
+from zope.component.registry import AdapterRegistration
 from zope.interface import Interface
 
 from zope.app import zapi
@@ -59,6 +59,7 @@
         base = factory.__bases__[0]
         info['path'] = base.__module__ + '.' + base.__name__
         info['template'] = relativizePath(factory.index.filename)
+        info['template_obj'] = factory.index
 
     # Basic Type is a factory
     elif isinstance(factory, (str, unicode, float, int, list, tuple)):
@@ -157,16 +158,16 @@
 def getViewInfoDictionary(reg):
     """Build up an information dictionary for a view registration."""
     # get configuration info
-    if isinstance(reg.doc, (str, unicode)):
-        doc = reg.doc
+    if isinstance(reg.info, (str, unicode)):
+        doc = reg.info
         zcml = None
     else:
         doc = None
-        zcml = getParserInfoInfoDictionary(reg.doc)
+        zcml = getParserInfoInfoDictionary(reg.info)
 
     info = {'name' : reg.name or '<i>no name</i>',
             'type' : getPythonPath(getPresentationType(reg.required[-1])),
-            'factory' : getViewFactoryData(reg.value),
+            'factory' : getViewFactoryData(reg.factory),
             'required': [getInterfaceInfoDictionary(iface)
                          for iface in reg.required],
             'provided' : getInterfaceInfoDictionary(reg.provided),
@@ -175,6 +176,6 @@
             }
 
     # Educated guess of the attribute name
-    info.update(getPermissionIds('publishTraverse', klass=reg.value))
+    info.update(getPermissionIds('publishTraverse', klass=reg.factory))
 
     return info

Modified: Zope3/branches/jim-adapter/src/zope/app/apidoc/presentation.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/apidoc/presentation.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/apidoc/presentation.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -32,6 +32,7 @@
    'referencable': True,
    'resource': None,
    'template': 'zope/app/apidoc/browser/index.pt',
+   'template_obj': <BoundPageTemplateFile of None>,
    'url': 'zope/app/pagetemplate/simpleviewclass/simple'}
 
 So in the result above we see what the function returns. It is a dictionary
@@ -265,26 +266,18 @@
   >>> regs = list(presentation.getViews(IFoo))
   >>> regs.sort()
   >>> regs #doctest:+ELLIPSIS
-  [AdapterRegistration(('IFoo', 'IBrowserRequest'), 'Interface',
-                       'blah', None, ''),
-   AdapterRegistration(('IFoo', 'IHTTPRequest'), 'Interface',
-                       'foo', None, ''),
-   AdapterRegistration(('Interface', 'IHTTPRequest'), 'Interface',
-                       'bar', None, ''),
-   AdapterRegistration((None, 'IDefaultBrowserLayer'), 'IAbsoluteURL',
-                       '', <class '...browser.absoluteurl.AbsoluteURL'>, ''),
-   AdapterRegistration((None, 'IDefaultBrowserLayer'), 'Interface',
-                       'absolute_url', <class ...absoluteurl.AbsoluteURL'>, '')]
+  [AdapterRegistration(<BaseGlobalComponents base>, 
+                       [IFoo, IBrowserRequest], Interface, 'blah', None, u''),
+   AdapterRegistration(<BaseGlobalComponents base>,
+                       [IFoo, IHTTPRequest], Interface, 'foo', None, u''),
+   AdapterRegistration(<BaseGlobalComponents base>,
+                       [Interface, IHTTPRequest], Interface, 'bar', None, u'')]
 
   >>> regs = list(presentation.getViews(Interface, IHTTPRequest))
   >>> regs.sort()
   >>> regs #doctest:+ELLIPSIS
-  [AdapterRegistration(('Interface', 'IHTTPRequest'), 'Interface',
-                       'bar', None, ''),
-   AdapterRegistration((None, 'IDefaultBrowserLayer'), 'IAbsoluteURL',
-                       '', <class '...browser.absoluteurl.AbsoluteURL'>, ''),
-   AdapterRegistration((None, 'IDefaultBrowserLayer'), 'Interface',
-                       'absolute_url', <class ...absoluteurl.AbsoluteURL'>, '')]
+  [AdapterRegistration(<BaseGlobalComponents base>, 
+                       [Interface, IHTTPRequest], Interface, 'bar', None, u'')]
 
 
 `filterViewRegistrations(regs, iface, level=SPECIFC_INTERFACE_LEVEL)`
@@ -336,24 +329,24 @@
   ...     regs, IFile, level=presentation.SPECIFIC_INTERFACE_LEVEL))
   >>> result.sort()
   >>> result
-  [AdapterRegistration(('IFile', 'IHTTPRequest'), 'Interface',
-                       'view.html', None, '')]
+  [AdapterRegistration(<BaseGlobalComponents base>, 
+                     [IFile, IHTTPRequest], Interface, 'view.html', None, u'')]
 
   >>> result = list(presentation.filterViewRegistrations(
   ...     regs, IFile, level=presentation.EXTENDED_INTERFACE_LEVEL))
   >>> result.sort()
   >>> result
-  [AdapterRegistration(('IContent', 'IHTTPRequest'), 'Interface', 'edit.html',
-                       None, ''),
-   AdapterRegistration(('IContent', 'IHTTPRequest'), 'Interface', 'view.html',
-                       None, '')]
+  [AdapterRegistration(<BaseGlobalComponents base>,
+                  [IContent, IHTTPRequest], Interface, 'edit.html', None, u''),
+   AdapterRegistration(<BaseGlobalComponents base>,
+                  [IContent, IHTTPRequest], Interface, 'view.html', None, u'')]
 
   >>> result = list(presentation.filterViewRegistrations(
   ...     regs, IFile, level=presentation.GENERIC_INTERFACE_LEVEL))
   >>> result.sort()
   >>> result
-  [AdapterRegistration(('Interface', 'IHTTPRequest'), 'Interface', 'view.html',
-                       None, '')]
+  [AdapterRegistration(<BaseGlobalComponents base>,
+                 [Interface, IHTTPRequest], Interface, 'view.html', None, u'')]
 
 You can also specify multiple levels at once using the Boolean OR operator,
 since all three levels are mutually exclusive.
@@ -363,22 +356,22 @@
   ...                        presentation.EXTENDED_INTERFACE_LEVEL))
   >>> result.sort()
   >>> result
-  [AdapterRegistration(('IContent', 'IHTTPRequest'), 'Interface',
-                       'edit.html', None, ''),
-   AdapterRegistration(('IContent', 'IHTTPRequest'), 'Interface',
-                       'view.html', None, ''),
-   AdapterRegistration(('IFile', 'IHTTPRequest'), 'Interface',
-                       'view.html', None, '')]
+  [AdapterRegistration(<BaseGlobalComponents base>, 
+                  [IContent, IHTTPRequest], Interface, 'edit.html', None, u''),
+   AdapterRegistration(<BaseGlobalComponents base>,
+                  [IContent, IHTTPRequest], Interface, 'view.html', None, u''),
+   AdapterRegistration(<BaseGlobalComponents base>,
+                  [IFile, IHTTPRequest], Interface, 'view.html', None, u'')]
 
   >>> result = list(presentation.filterViewRegistrations(
   ...     regs, IFile, level=presentation.SPECIFIC_INTERFACE_LEVEL |
   ...                        presentation.GENERIC_INTERFACE_LEVEL))
   >>> result.sort()
   >>> result
-  [AdapterRegistration(('IFile', 'IHTTPRequest'), 'Interface',
-                       'view.html', None, ''),
-   AdapterRegistration(('Interface', 'IHTTPRequest'), 'Interface',
-                       'view.html', None, '')]
+  [AdapterRegistration(<BaseGlobalComponents base>,
+                [IFile, IHTTPRequest], Interface, 'view.html', None, u''),
+   AdapterRegistration(<BaseGlobalComponents base>,
+                [Interface, IHTTPRequest], Interface, 'view.html', None, u'')]
 
 
 `getViewInfoDictionary(reg)`
@@ -391,8 +384,8 @@
 
 Let's first create a registration:
 
-  >>> from zope.component.site import AdapterRegistration
-  >>> reg = AdapterRegistration((IFile, Interface, IHTTPRequest),
+  >>> from zope.component.registry import AdapterRegistration
+  >>> reg = AdapterRegistration(None, (IFile, Interface, IHTTPRequest),
   ...                           Interface, 'view.html', Factory, 'reg info')
 
   >>> pprint(presentation.getViewInfoDictionary(reg))

Modified: Zope3/branches/jim-adapter/src/zope/app/apidoc/tests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/apidoc/tests.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/apidoc/tests.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -18,6 +18,8 @@
 from pprint import PrettyPrinter
 import unittest
 
+import zope.component.testing
+
 from zope.component.interfaces import IFactory
 from zope.interface import implements
 from zope.testing import doctest, doctestunit
@@ -32,7 +34,7 @@
 
 
 def setUp(test):
-    placelesssetup.setUp()
+    zope.component.testing.setUp()
     # Register Renderer Components
     ztapi.provideUtility(IFactory, ReStructuredTextSourceFactory,
                          'zope.source.rest')
@@ -85,8 +87,8 @@
                              globs={'pprint': doctestunit.pprint},
                              optionflags=doctest.NORMALIZE_WHITESPACE),
         doctest.DocFileSuite('presentation.txt',
-                             setUp=placelesssetup.setUp,
-                             tearDown=placelesssetup.tearDown,
+                             setUp=zope.component.testing.setUp,
+                             tearDown=zope.component.testing.tearDown,
                              globs={'pprint': doctestunit.pprint},
                              optionflags=doctest.NORMALIZE_WHITESPACE),
         doctest.DocFileSuite('utilities.txt',

Modified: Zope3/branches/jim-adapter/src/zope/app/apidoc/utilitymodule/browser.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/apidoc/utilitymodule/browser.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/apidoc/utilitymodule/browser.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -40,7 +40,7 @@
   >>> foobar_reg = type(
   ...     'RegistrationStub', (),
   ...     {'name': 'FooBar', 'provided': None,
-  ...      'component': None, 'doc': ''})()
+  ...      'component': None, 'info': ''})()
 
 which is then wrapped in a `Utility` documentation class and then in a node:
 
@@ -61,7 +61,7 @@
   >>> noname_reg = type(
   ...     'RegistrationStub', (),
   ...     {'name': NONAME, 'provided': None,
-  ...      'component': None, 'doc': ''})()
+  ...      'component': None, 'info': ''})()
 
   >>> util = Utility(uiface, noname_reg)
   >>> node = Node(util)
@@ -109,7 +109,7 @@
   >>> blah_reg = type(
   ...     'RegistrationStub', (),
   ...     {'name': 'Blah', 'provided': IBlah,
-  ...      'component': None, 'doc': ''})()
+  ...      'component': None, 'info': ''})()
 
 Then we wrap the registration in the utility documentation class and create
 the details view:
@@ -140,7 +140,7 @@
 
   >>> foo_reg = type(
   ...     'RegistrationStub', (),
-  ...     {'name': '', 'provided': Interface, 'component': Foo(), 'doc': ''})()
+  ...     {'name': '', 'provided': Interface, 'component': Foo(), 'info': ''})()
 
 Then we create a utility documentation class and its details view:
 

Modified: Zope3/branches/jim-adapter/src/zope/app/apidoc/utilitymodule/utilitymodule.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/apidoc/utilitymodule/utilitymodule.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/apidoc/utilitymodule/utilitymodule.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -19,7 +19,7 @@
 
 import base64, binascii
 
-from zope.component.site import UtilityRegistration
+from zope.component.registry import UtilityRegistration
 from zope.interface import implements
 
 from zope.app import zapi
@@ -54,7 +54,7 @@
         self.registration = reg
         self.interface = reg.provided
         self.component = reg.component
-        self.doc = reg.doc
+        self.doc = reg.info
 
 
 class UtilityInterface(ReadContainerBase):
@@ -73,18 +73,16 @@
         if key == NONAME:
             key = ''
         utils = [Utility(self, reg)
-                 for reg in sm.registrations()
-                 if zapi.isinstance(reg, UtilityRegistration) and \
-                     reg.name == key and reg.provided == self.interface]
+                 for reg in sm.registeredUtilities()
+                 if reg.name == key and reg.provided == self.interface]
         return utils and utils[0] or default
 
     def items(self):
         """See zope.app.container.interfaces.IReadContainer"""
         sm = zapi.getGlobalSiteManager()
         items = [(encodeName(reg.name or NONAME), Utility(self, reg))
-                 for reg in sm.registrations()
-                 if zapi.isinstance(reg, UtilityRegistration) and \
-                     self.interface == reg.provided]
+                 for reg in sm.registeredUtilities()
+                 if self.interface == reg.provided]
         items.sort()
         return items
 

Modified: Zope3/branches/jim-adapter/src/zope/app/applicationcontrol/browser/zodbcontrol.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/applicationcontrol/browser/zodbcontrol.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/applicationcontrol/browser/zodbcontrol.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -19,7 +19,7 @@
 
 from ZODB.FileStorage.FileStorage import FileStorageError
 from zope.app.i18n import ZopeMessageFactory as _
-from zope.app.size import byteDisplay
+from zope.size import byteDisplay
 
 
 class ZODBControlView(object):

Modified: Zope3/branches/jim-adapter/src/zope/app/appsetup/bootstrap.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/appsetup/bootstrap.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/appsetup/bootstrap.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -70,7 +70,7 @@
         warnings.warn("asObject=False is deprecated", DeprecationWarning, 2)
         
     sm = root_folder.getSiteManager()
-    utils = [reg for reg in sm.utilities.registrations()
+    utils = [reg for reg in sm.registeredUtilities()
              if reg.provided.isOrExtends(interface)]
     if len(utils) == 0:
         return addConfigureUtility(

Modified: Zope3/branches/jim-adapter/src/zope/app/authentication/README.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/authentication/README.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/authentication/README.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -360,15 +360,15 @@
 
   >>> print pau.getPrincipal('xyz_bob')
   Traceback (most recent call last):
-  PrincipalLookupError: 'bob'
+  PrincipalLookupError: bob
 
   >>> print pau.getPrincipal('white')
   Traceback (most recent call last):
-  PrincipalLookupError: 'white'
+  PrincipalLookupError: white
 
   >>> print pau.getPrincipal('black')
   Traceback (most recent call last):
-  PrincipalLookupError: 'black'
+  PrincipalLookupError: black
 
 For a PAU to support search, it needs to be configured with one or more
 authenticator plugins that support search. To illustrate, we'll create a new
@@ -422,7 +422,7 @@
 
   >>> print pau.getPrincipal('black')
   Traceback (most recent call last):
-  PrincipalLookupError: 'black'
+  PrincipalLookupError: black
 
 Found Principal Creates Events
 ------------------------------

Modified: Zope3/branches/jim-adapter/src/zope/app/authentication/browser/ftests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/authentication/browser/ftests.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/authentication/browser/ftests.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -16,22 +16,18 @@
 $Id$
 """
 import unittest
-
-from zope.app.testing import ztapi
-from zope.app.testing import functional
-
 import transaction
 
 from zope.interface import implements, Interface, directlyProvides
-from zope.app import copypastemove
+from zope.exceptions.interfaces import UserError
 
+from zope.app import copypastemove
+from zope.app.testing import ztapi
+from zope.app.testing import functional
 from zope.app.authentication.principalfolder import PrincipalFolder
 from zope.app.authentication.principalfolder import Principal
 from zope.app.authentication.principalfolder import IInternalPrincipal
 
-from zope.app.exception.interfaces import UserError
-
-
 class FunkTest(functional.BrowserTestCase):
 
     def test_copypaste_duplicated_id_object(self):

Modified: Zope3/branches/jim-adapter/src/zope/app/authentication/browser/principalfolder.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/authentication/browser/principalfolder.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/authentication/browser/principalfolder.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -28,7 +28,8 @@
   ... Cookie: zope3_cs_6a553b3=-j7C3CdeW9sUK8BP5x97u2d9o242xMJDzJd8HCQ5AAi9xeFcGTFkAs
   ... Referer: http://localhost:8081/++etc++site/default/@@contents.html?type_name=BrowserAdd__zope.app.authentication.authentication.PluggableAuthentication
   ... 
-  ... type_name=BrowserAdd__zope.app.authentication.authentication.PluggableAuthentication&new_value=PAU""")
+  ... type_name=BrowserAdd__zope.app.authentication.authentication.PluggableAuthentication&new_value=PAU""",
+  ... handle_errors=False)
   HTTP/1.1 303 See Other
   ...
 
@@ -250,7 +251,7 @@
   ... 
   ... dXNlcnM=
   ... -----------------------------6519411471194050603270010787--
-  ... """)
+  ... """, handle_errors=False)
   HTTP/1.1 200 Ok
   ... 
 

Modified: Zope3/branches/jim-adapter/src/zope/app/authentication/idpicker.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/authentication/idpicker.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/authentication/idpicker.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,11 +15,10 @@
 
 $Id$
 """
-
+import re
+from zope.exceptions.interfaces import UserError
 from zope.app.container.contained import NameChooser
-from zope.app.exception.interfaces import UserError
 from zope.app.i18n import ZopeMessageFactory as _
-import re
 
 ok = re.compile('[!-~]+$').match
 class IdPicker(NameChooser):

Modified: Zope3/branches/jim-adapter/src/zope/app/authentication/vocabulary.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/authentication/vocabulary.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/authentication/vocabulary.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -52,7 +52,7 @@
     >>> auth = DemoAuth((p.name, p) for p in contained_plugins.values())
     
     >>> @component.adapter(interface.Interface)
-    ... @interface.implementer(component.ISiteManager)
+    ... @interface.implementer(component.IComponentLookup)
     ... def getSiteManager(context):
     ...     return component.getGlobalSiteManager()
     ...

Modified: Zope3/branches/jim-adapter/src/zope/app/cache/interfaces/ram.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/cache/interfaces/ram.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/cache/interfaces/ram.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -20,9 +20,8 @@
 from zope.interface import Attribute
 
 from zope.app.cache.interfaces import ICache
-from zope.app.component.interfaces.registration import IRegisterable
 
-class IRAMCache(ICache, IRegisterable):
+class IRAMCache(ICache):
     """Interface for the RAM Cache."""
 
     maxEntries = Attribute("""A maximum number of cached values.""")

Modified: Zope3/branches/jim-adapter/src/zope/app/catalog/browser/README.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/catalog/browser/README.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/catalog/browser/README.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -23,7 +23,8 @@
   ... Content-Type: application/x-www-form-urlencoded
   ... Referer: http://localhost:8081/++etc++site/default/@@+
   ... 
-  ... type_name=BrowserAdd__zope.app.intid.IntIds&id=&add=+Add+""")
+  ... type_name=BrowserAdd__zope.app.intid.IntIds&id=&add=+Add+""",
+  ... handle_errors=False)
   HTTP/1.1 303 ...
 
 And register it:

Modified: Zope3/branches/jim-adapter/src/zope/app/catalog/tests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/catalog/tests.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/catalog/tests.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -28,6 +28,7 @@
 from zope.app.testing import ztapi, setup, placelesssetup
 from BTrees.IFBTree import IFSet
 from zope.app.intid.interfaces import IIntIds
+from zope.app.component.hooks import setSite
 
 from zope.index.interfaces import IInjection, IIndexSearch
 from zope.app.catalog.interfaces import ICatalog
@@ -227,6 +228,7 @@
         sm = self.root.getSiteManager()
         self.utility = setup.addUtility(sm, '', IIntIds, IntIdsStub())
         self.cat = setup.addUtility(sm, '', ICatalog, CatalogStub())
+        setSite(self.root)
 
     def tearDown(self):
         setup.placefulTearDown()

Modified: Zope3/branches/jim-adapter/src/zope/app/component/README.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/README.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/README.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -69,7 +69,7 @@
   >>> component.getNextSiteManager(object())
   Traceback (most recent call last):
   ...
-  ComponentLookupError: 'No more site managers have been found.'
+  ComponentLookupError: No more site managers have been found.
 
 If you use the `queryNextSiteManager()` function, you can specify a `default`
 return value:
@@ -94,7 +94,7 @@
   ...         return "%s('%s')" %(self.__class__.__name__, self.id)  
 
   >>> gutil = MyUtility('global') 
-  >>> gsm.provideUtility(IMyUtility, gutil, 'myutil')
+  >>> gsm.registerUtility(gutil, IMyUtility, 'myutil')
 
   >>> util1 = setup.addUtility(folder1_sm, 'myutil', IMyUtility, 
   ...                          MyUtility('one'))
@@ -120,8 +120,8 @@
   Traceback (most recent call last):
   ...  
   ComponentLookupError: 
-  "No more utilities for <InterfaceClass __builtin__.IMyUtility>, 
-  'myutil' have been found."
+  No more utilities for <InterfaceClass __builtin__.IMyUtility>, 
+  'myutil' have been found.
 
 or you can simply use the `queryNextUtility` and specify a default:
 

Modified: Zope3/branches/jim-adapter/src/zope/app/component/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,6 +17,7 @@
 """
 __docformat__ = "reStructuredText"
 import zope.component
+import zope.app.component.interfaces
 from zope.app import zapi
 
 # BBB: Will go away in 3.3.
@@ -42,11 +43,13 @@
     `default` is returned.
     """
     sm = zapi.getSiteManager(context)
-    if zope.component.site.IGlobalSiteManager.providedBy(sm):
+    if not zope.app.component.interfaces.ILocalSiteManager.providedBy(sm):
         return default
-    if sm.next is None:
+
+    bases = sm.__bases__
+    if not bases:
         return zapi.getGlobalSiteManager()
-    return sm.next
+    return bases[0]
 
 
 def getNextUtility(context, interface, name=''):

Modified: Zope3/branches/jim-adapter/src/zope/app/component/adapter.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/adapter.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/adapter.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -11,200 +11,24 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""Local/Persistent Adapter Registry
+"""DEPRECATED"""
 
-$Id$
-"""
-__docformat__ = 'restructuredtext' 
-import persistent
+import zope.deferredimport
 
-import zope.interface
-from zope.security.proxy import removeSecurityProxy
+zope.deferredimport.deprecatedFrom(
+    "Local registration is now much simpler.  The old baroque APIs "
+    "will go away in Zope 3.5.  See the new component-registration APIs "
+    "defined in zope.component, especially IComponentRegistry.",
+    'zope.app.component.back35',
+    'LocalAdapterRegistry',
+    'LocalUtilityRegistry',
+    'UtilityRegistration',
+    )
 
-from zope.app.component import registration
-from zope.app.component import interfaces
+zope.deferredimport.deprecated(
+    "Local registration is now much simpler.  The old baroque APIs "
+    "will go away in Zope 3.5.  See the new component-registration APIs "
+    "defined in zope.component, especially IComponentRegistry.",
+    AdapterRegistration = 'zope.app.component.back35.AdapterRegistration2'
+    )
 
-
-class LocalSurrogate(zope.interface.adapter.Surrogate):
-    """Local Surrogate
-
-    Local surrogates are transient, rather than persistent. Their adapter
-    data are stored in their registry objects.
-    """
-    def __init__(self, spec, registry):
-        super(LocalSurrogate, self).__init__(spec, registry)
-        self.registry = registry
-        registry.baseFor(spec).subscribe(self)
-
-    def clean(self):
-        spec = self.spec()
-        base = self.registry.baseFor(spec)
-        ladapters = self.registry.adapters.get(spec)
-        if ladapters:
-            adapters = base.adapters.copy()
-            adapters.update(ladapters)
-        else:
-            adapters = base.adapters
-        self.adapters = adapters
-        super(LocalSurrogate, self).clean()
-
-
-class LocalAdapterRegistry(zope.interface.adapter.AdapterRegistry,
-                           persistent.Persistent):
-    """Local/persistent surrogate registry"""
-    zope.interface.implements(interfaces.ILocalAdapterRegistry)
-    
-    _surrogateClass = LocalSurrogate
-
-    # See interfaces.registration.ILocatedRegistry
-    next = None
-    subs = ()
-
-    def __init__(self, base, next=None):
-        # Base registry. This is always a global registry
-        self.base = base
-        # `adapters` is simple dict, since it is populated during every load
-        self.adapters = {}
-        self._registrations = ()
-        super(LocalAdapterRegistry, self).__init__()
-        self.setNext(next)
-
-    def addSub(self, sub):
-        """See interfaces.registration.ILocatedRegistry"""
-        self.subs += (sub, )
-
-    def removeSub(self, sub):
-        """See interfaces.registration.ILocatedRegistry"""
-        self.subs = tuple(
-            [s for s in self.subs if s is not sub] )
-
-    def setNext(self, next, base=None):
-        """See interfaces.registration.ILocatedRegistry"""
-        if base is not None:
-            self.base = base
-        if self.next is not None:
-            self.next.removeSub(self)
-        if next is not None:
-            next.addSub(self)
-        self.next = next
-        self.adaptersChanged()
-
-    def register(self, registration):
-        """See zope.app.component.interfaces.registration.IRegistry"""
-        self._registrations += (registration,)
-        self.adaptersChanged()
-
-    def unregister(self, registration):
-        """See zope.app.component.interfaces.registration.IRegistry"""
-        self._registrations = tuple([reg for reg in self._registrations
-                                     if reg is not registration])
-        self.adaptersChanged()
-
-    def registered(self, registration):
-        """See zope.app.component.interfaces.registration.IRegistry"""
-        return registration in self._registrations
-
-    def registrations(self):
-        """See zope.app.component.interfaces.registration.IRegistry"""
-        return self._registrations
-
-    def __getstate__(self):
-        state = persistent.Persistent.__getstate__(self).copy()
-        
-        for name in ('_default', '_null', 'adapter_hook',
-                     'lookup', 'lookup1', 'queryAdapter', 'get',
-                     'subscriptions', 'queryMultiAdapter', 'subscribers'
-                     ):
-            del state[name]
-        return state
-
-    def __setstate__(self, state):
-        persistent.Persistent.__setstate__(self, state)
-        zope.interface.adapter.AdapterRegistry.__init__(self)
-    
-    def baseFor(self, spec):
-        """Used by LocalSurrogate"""
-        return self.base.get(spec)
-
-    def _updateAdaptersFromRegistration(self, radapters, registration):
-        """Only to be used by _updateAdaptersFromLocalData, but can be
-        overridden to implement custom behavior."""
-        key = (False, registration.with, registration.name,
-               registration.provided)
-        radapters[key] = removeSecurityProxy(registration.component)
-
-    def _updateAdaptersFromLocalData(self, adapters):
-        """Update all adapter surrogates locally."""
-        for registration in self._registrations:
-            required = registration.required
-            if required is None:
-                required = zope.interface.adapter.Default
-            radapters = adapters.get(required)
-            if not radapters:
-                radapters = {}
-                adapters[required] = radapters
-
-            # Needs more thought:
-            # We have to remove the proxy because we're
-            # storing the value amd we can't store proxies.
-            # (Why can't we?)  we need to think more about
-            # why/if this is truly safe
-            self._updateAdaptersFromRegistration(radapters, registration)
-
-
-    def adaptersChanged(self):
-        """See interfaces.registration.ILocalAdapterRegistry"""
-        adapters = {}
-        if self.next is not None:
-            for required, radapters in self.next.adapters.iteritems():
-                adapters[required] = radapters.copy()
-        
-        self._updateAdaptersFromLocalData(adapters)
-
-        if adapters != self.adapters:
-            self.adapters = adapters
-
-            # Throw away all of our surrogates, rather than dirtrying
-            # them individually
-            super(LocalAdapterRegistry, self).__init__()
-            
-            for sub in self.subs:
-                sub.adaptersChanged()
-
-    def baseChanged(self):
-        """See interfaces.registration.ILocalAdapterRegistry"""
-        super(LocalAdapterRegistry, self).__init__()
-        for sub in self.subs:
-            sub.baseChanged()
-
-
-class AdapterRegistration(registration.ComponentRegistration):
-    """A simple implementation of the adapter registration interface."""
-    zope.interface.implements(interfaces.IAdapterRegistration)
-
-    def __init__(self, required, provided, factory,
-                 name='', permission=None, registry=None):
-        if not isinstance(required, (tuple, list)):
-            self.required = required
-            self.with = ()
-        else:
-            self.required = required[0]
-            self.with = tuple(required[1:])
-        self.provided = provided
-        self.name = name
-        self.component = factory
-        self.permission = permission
-        self.registry = registry
-
-    def getRegistry(self):
-        return self.registry
-
-    def __repr__(self):
-        return ('<%s: ' %self.__class__.__name__ +
-                'required=%r, ' %self.required +
-                'with=' + `self.with` + ', ' +
-                'provided=%r, ' %self.provided +
-                'name=%r, ' %self.name +
-                'component=%r, ' %self.component +
-                'permission=%r' %self.permission +
-                '>')

Deleted: Zope3/branches/jim-adapter/src/zope/app/component/adapterregistry.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/adapterregistry.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/adapterregistry.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,213 +0,0 @@
-==========================
-The Local Adapter Registry
-==========================
-
-The local adapter registry, like its global parent at
-`zope.interface.adapter`, is responsible for managing registered
-adapters. However, local adapter registries must always be instantiated by
-providing their base (or global registry), which will always be a global
-adapter registry isntance:
-
-  >>> import zope.interface
-  >>> gar = zope.interface.adapter.AdapterRegistry()
-
-  >>> from zope.app.component import adapter
-  >>> lar = adapter.LocalAdapterRegistry(gar)
-  >>> lar.base is gar
-  True
-
-The local adapter registry uses the registration framework (introduced in
-`registration.txt`) to manage the adapter registrations. To demonstrate we
-need to create an adapter first. Let's say we have a file
-
-  >>> class IFile(zope.interface.Interface):
-  ...     content = zope.interface.Attribute('File Content')
-
-and we want to know the size of the file, which can be gotten by having a
-component providing the `ISized` interface:
-
-  >>> class ISized(zope.interface.Interface):
-  ...     def getSize():
-  ...         """Return the size of the component."""
-
-  >>> FileSize = '<FileSize>'
-
-As you can see, the adapter itself has no meaning in the adapter registry,
-which is merely responsible for looking up the component, but asserts no
-interpretation. Thus the adapter component can be any Python object.
-
-Instead of registering the adapter with the registry directly, we use an
-adapter registration to register the adapter with the local adapter registry:
-
-  >>> reg = adapter.AdapterRegistration(
-  ...         required = (IFile,), 
-  ...         provided = ISized,
-  ...         factory = FileSize,
-  ...         registry = lar)
-  >>> reg.status
-  u'Inactive'
-
-The adapter registration is an extended `ComponentRegistration`. Here the
-factory is the component. We can register the registration with the adapter
-registry using
- 
-  >>> lar.register(reg)
-
-Note that the registration's status is automatically set to active, when you
-register a registration:
-
-  >>> reg.status
-  u'Active'
-
-What really happens behind the scene is that the registry keeps track of a
-list of registrations and the registration's status property calls the
-registry's `registered()` method to determine whether the registration is
-activated. 
-
-  >>> lar.registered(reg)
-  True
-
-You can also ask the registry for all of its registrations:
-
-  >>> lar.registrations() #doctest: +NORMALIZE_WHITESPACE
-  (<AdapterRegistration: 
-        required=<InterfaceClass __builtin__.IFile>, 
-        with=(), 
-        provided=<InterfaceClass __builtin__.ISized>, 
-        name='', 
-        component='<FileSize>', 
-        permission=None>,)
-
-Later you can unregister the adapter registration:
-
-  >>> lar.unregister(reg)
-  >>> lar.registered(reg)
-  False
-  >>> lar.registrations()
-  ()
-  >>> reg.status
-  u'Inactive'
-
-Of course, the same can be achieved by setting the registration's status:
-
-  >>> from zope.app.component import interfaces
-  >>> reg.status = interfaces.registration.ActiveStatus
-  >>> lar.registered(reg)
-  True
-
-  >>> reg.status = interfaces.registration.InactiveStatus
-  >>> lar.registered(reg)
-  False
-
-But the true flexibility of the local adapter registry is that it can be
-located in an adapter registry tree. Each node of the tree is a location and
-can override existing and register new adapters. The parent of a node can be
-accessed using
-
-  >>> lar.next is None
-  True
-
-In our case there is no nect registry, since the `lar` instance is the root
-node. The base registry, which is always a global one, can be accessed using
-
-  >>> lar.base is gar
-  True
-
-The node also knows about its children via
-
-  >>> lar.subs
-  ()
-
-Thus this is a double-linked tree. If I now create a second local adapter
-registry in which `lar` is the parent
-
-  >>> lar2 = adapter.LocalAdapterRegistry(gar, lar)
-
-then we have
-
-  >>> lar2.next is lar
-  True
-  >>> lar.subs == (lar2,)
-  True
-  >>> lar2.base is lar.base is gar
-  True
-
-Let's now register our adapter with `lar` again:
-
-  >>> reg.status = interfaces.registration.ActiveStatus
-
-On the second level, however, the size should be a word count instead of a
-character count:
-
-  >>> FileWordCount = '<FileWordCount>'
-
-
-  >>> reg2 = adapter.AdapterRegistration(
-  ...          required = (IFile,), 
-  ...          provided = ISized,
-  ...          factory = FileWordCount,
-  ...          registry = lar2)
-  >>> reg2.status = interfaces.registration.ActiveStatus
-
-If we now lookup the adapter in `lar`, we get the original `ISized` adapter:
-
-  >>> lar.lookup((IFile,), ISized)
-  '<FileSize>'
-
-but from the second registry we get
-
-  >>> lar2.lookup((IFile,), ISized)
-  '<FileWordCount>'
-
-If we now unregister the word counting size adapter
-
-  >>> reg2.status = interfaces.registration.InactiveStatus
-
-then `lar2` will get the adapter from its parent:
-
-  >>> lar2.lookup((IFile,), ISized)
-  '<FileSize>'
-
-We can also change the location of a local adapter registry using
-
-  >>> lar2.setNext(None)
-  >>> lar2.next
-  >>> lar.subs
-  ()
-
-In this case we made `lar2` a root node itself. Clearly, now the `FileSize`
-adapter should not be available anymore:
-
-  >>> lar2.lookup((IFile,), ISized)
-
-Now we make `lar` a sub registry of `lar2`:
-
-  >>> lar.setNext(lar2)
-  >>> lar.next is lar2
-  True
-  >>> lar2.subs == (lar,)
-  True
-
-Note that you should never set the next attribute directly, but always use the
-`setNext()` method, since it ensures the integrety of all the links in the
-tree and updates the adapter lookup caches. 
-
-The global adapter registry is taken into account during the lookup too, of
-course. Let's say we want to have an adapter that determines the type of the
-file and register it globally:
-
-  >>> class IFileType(zope.interface.Interface):
-  ...     def getType():
-  ...         """Return the type of the file."""
-
-  >>> FileType = '<FileType>'
-
-  >>> gar.register((IFile,), IFileType, '', FileType)
-
-Then this adapter will be available in any local adapter registry:
-
-  >>> lar.lookup((IFile,), IFileType, '')
-  '<FileType>'
-  >>> lar2.lookup((IFile,), IFileType, '')
-  '<FileType>'
-

Copied: Zope3/branches/jim-adapter/src/zope/app/component/back35.py (from rev 66386, Zope3/branches/jim-adapter/src/zope/app/component/back35.py)

Modified: Zope3/branches/jim-adapter/src/zope/app/component/bbb/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/bbb/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/bbb/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -3,6 +3,5 @@
 import sys
 import localservice
 import interfaces
-import registration
 
 sys.modules['zope.app.component.localservice'] = localservice

Modified: Zope3/branches/jim-adapter/src/zope/app/component/bbb/hooks.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/bbb/hooks.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/bbb/hooks.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -16,7 +16,7 @@
 $Id: hooks.py 29143 2005-02-14 22:43:16Z srichter $
 """
 from zope.component import getSiteManager
-from zope.component.bbb import service
+from zope.component import service
 
 def getServices_hook(context=None):
     sm = getSiteManager(context)

Modified: Zope3/branches/jim-adapter/src/zope/app/component/bbb/localservice.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/bbb/localservice.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/bbb/localservice.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,6 +1,6 @@
 # BBB: Goes away in 3.3
 import zope.deprecation
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 
 def queryNextService(context, name, default=None):
     try:

Deleted: Zope3/branches/jim-adapter/src/zope/app/component/bbb/registration.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/bbb/registration.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/bbb/registration.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,281 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2005 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Registration BBB components
-
-$Id$
-"""
-__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
-from zope.security.checker import InterfaceChecker, CheckerPublic
-from zope.security.proxy import Proxy, removeSecurityProxy
-
-from zope.app import zapi
-from zope.app.container.contained import Contained
-
-import interfaces
-
-
-class RegistrationStack(Contained, Persistent):
-    """Registration registry implemention
-
-       A registration stack provides support for a collection of
-       registrations such that, at any time, at most one is active.  The
-       "stack" aspect of the api is designed to support "uninstallation",
-       as will be described below.
-       """
-    implements(interfaces.IRegistrationStack)
-
-    def __init__(self, container):
-        self.__parent__ = container
-        self.sitemanager = zapi.getSiteManager(container)
-
-    def register(self, registration):
-        self.sitemanager.register(registration)
-        self._activate(registration)
-
-    def unregister(self, registration):
-        self.sitemanager.register(registration)
-        self._deactivate(registration)
-
-    def registered(self, registration):
-        self.sitemanager.registered(registration)
-
-    def _activate(self, registration):
-        zope.event.notify(RegistrationActivatedEvent(registration))
-        registration.activated()
-
-    def _deactivate(self, registration):
-        zope.event.notify(RegistrationDeactivatedEvent(registration))
-        registration.deactivated()
-
-    def activate(self, registration):
-        self.sitemanager.register(registration)
-        self._activate(registration)
-
-
-    def deactivate(self, registration):
-        self.sitemanager.register(registration)
-        self._deactivate(registration)
-
-    def active(self):
-        return True
-
-    def __nonzero__(self):
-        return True
-
-    def info(self):
-        # This registration stack stub does not really know about the
-        # registration it manages. Thus the registration component is None
-        # here. It might be that someone has a problem with this code, but I
-        # am sceptical that someone used this method manually.
-        return [{'active': True,
-                 'registration': None}]
-
-
-NULL_COMPONENT = object()
-
-class BBBComponentRegistration(object):
-
-    _BBB_componentPath = None
-
-    def __init__(self, component, permission=None):
-        # BBB: 12/05/2004
-        if isinstance(component, (str, unicode)):
-            self.componentPath = component
-        else:
-            # We always want to set the plain component. Untrusted code will
-            # get back a proxied component anyways.
-            self.component = removeSecurityProxy(component)
-        if permission == 'zope.Public':
-            permission = CheckerPublic
-        self.permission = permission
-
-    def getComponent(self):
-        return self.__BBB_getComponent()
-    getComponent = zope.deprecation.deprecated(getComponent,
-                              'Use component directly. '
-                              'The reference will be gone in Zope 3.3.')
-
-    def __BBB_getComponent(self):
-        if self._component is NULL_COMPONENT:
-            return self.__BBB_old_getComponent(self._BBB_componentPath)
-
-        # This condition should somehow make it in the final code, since it
-        # honors the permission.
-        if self.permission:
-            checker = InterfaceChecker(self.getInterface(), self.permission)
-            return Proxy(self._component, checker)
-
-        return self._component
-
-    def __BBB_old_getComponent(self, path):
-        service_manager = zapi.getSiteManager(self)
-
-        # Get the root and unproxy it
-        if path.startswith("/"):
-            # Absolute path
-            root = removeAllProxies(zapi.getRoot(service_manager))
-            component = zapi.traverse(root, path)
-        else:
-            # Relative path.
-            ancestor = self.__parent__.__parent__
-            component = zapi.traverse(ancestor, path)
-
-        if self.permission:
-            if type(component) is Proxy:
-                # There should be at most one security Proxy around an object.
-                # So, if we're going to add a new security proxy, we need to
-                # remove any existing one.
-                component = removeSecurityProxy(component)
-
-            interface = self.getInterface()
-
-            checker = InterfaceChecker(interface, self.permission)
-
-            component = Proxy(component, checker)
-
-        return component
-
-    def __BBB_setComponent(self, component):
-        self._BBB_componentPath = None
-        self._component = component
-
-    component = property(__BBB_getComponent, __BBB_setComponent)
-
-    def __BBB_getComponentPath(self):
-        if self._BBB_componentPath is not None:
-            return self._BBB_componentPath
-        return '/' + '/'.join(zapi.getPath(self.component))
-
-    def __BBB_setComponentPath(self, path):
-        self._component = NULL_COMPONENT
-        self._BBB_componentPath = path
-
-    componentPath = property(__BBB_getComponentPath, __BBB_setComponentPath)
-    componentPath = zope.deprecation.deprecated(
-        componentPath,
-        'Use component directly. '
-        'The reference will be gone in Zope 3.3.')
-
-    def __setstate__(self, dict):
-        super(BBBComponentRegistration, self).__setstate__(dict)
-        # For some reason the component path is not set correctly by the
-        # default __setstate__ mechanism.
-        if 'componentPath' in dict:
-            self._component = NULL_COMPONENT
-            self._BBB_componentPath = dict['componentPath']
-
-        if isinstance(self._BBB_componentPath, (str, unicode)):
-            self._component = NULL_COMPONENT
-
-
-class BBBRegistry(object):
-
-    def queryRegistrationsFor(self, cfg, default=None):
-        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 Zope 3.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 Zope 3.3.')
-    
-
-class BBBRegistrationManager(object):
-
-    def _SampleContainer__data(self):
-        from BTrees.OOBTree import OOBTree
-        if '_data' in self.__dict__:
-            return OOBTree(self._data)
-    _SampleContainer__data = Lazy(_SampleContainer__data)
-
-
-class BBBRegisterableContainer(object):
-
-    def registrationManager(self):
-        from zope.app.component.registration import RegistrationManager
-        for obj in self.values():
-            if isinstance(obj, RegistrationManager):
-                return obj
-    registrationManager = Lazy(registrationManager)
-
-    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 Zope 3.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 Zope 3.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 Zope 3.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 Zope 3.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 Zope 3.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 Zope 3.3.')

Deleted: Zope3/branches/jim-adapter/src/zope/app/component/bbb/site.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/bbb/site.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/bbb/site.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,176 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2005 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Site-related BBB components
-
-$Id$
-"""
-__docformat__ = "reStructuredText"
-import zope.deprecation
-from zope.component.bbb.service import IService
-from zope.cachedescriptors import property
-
-from zope.app import zapi
-import registration
-
-
-class BBBSiteManagerContainer(object):
-
-    def _sm(self):
-        if '_ServiceManagerContainer__sm' in self.__dict__:
-            return self._ServiceManagerContainer__sm
-        elif '_SiteManagerContainer__sm' in self.__dict__:
-            return self._SiteManagerContainer__sm
-        else:
-            return None
-    _sm = property.Lazy(_sm)
-    
-
-class BBBSiteManager(object):
-
-    def utilities(self):
-        gsm = zapi.getGlobalSiteManager()
-        from zope.app.component.site import LocalUtilityRegistry
-        return LocalUtilityRegistry(gsm.utilities)
-    utilities = property.Lazy(utilities)
-
-    def adapters(self):
-        gsm = zapi.getGlobalSiteManager()
-        from zope.app.component import adapter
-        return adapter.LocalAdapterRegistry(gsm.adapters)        
-    adapters = property.Lazy(adapters)
-
-    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 Zope 3.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 Zope 3.3.')
-
-    def addSubsite(self, sub):
-        return self.addSub(sub)
-    addSubsite = zope.deprecation.deprecated(
-        addSubsite,
-        'Use `addSub()` instead. '
-        'The reference will be gone in Zope 3.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 Zope 3.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 Zope 3.3.')
-
-    def listRegistrationNames(self):
-        # Only used for services
-        services = ['Utilities', 'Adapters']
-        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 Zope 3.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 Zope 3.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 Zope 3.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 Zope 3.3.')
-
-    def queryLocalService(self, name, default=None):
-        if name in _builtinServices:
-            return self
-        service = zapi.queryUtility(IService, name, self)
-        if service is None:
-            return default
-        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 Zope 3.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 Zope 3.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 Zope 3.3.')
-
-_builtinServices = ('Utilities', 'Adapters')
-
-
-class BBBUtilityRegistration(object):
-
-    def provided(self):
-        if 'interface' in self.__dict__:
-            return self.interface
-    provided = property.Lazy(provided)

Modified: Zope3/branches/jim-adapter/src/zope/app/component/browser/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/browser/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/browser/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,19 +15,16 @@
 
 $Id$
 """
-from zope.component.interfaces import ISiteManager
+from zope.exceptions.interfaces import UserError
 from zope.security.proxy import removeSecurityProxy
 from zope.app import zapi
 from zope.app.container.browser.adding import Adding
 from zope.app.i18n import ZopeMessageFactory as _
 from zope.app.container.interfaces import INameChooser
-from zope.app.component.interfaces.registration import ActiveStatus
-from zope.app.component.interfaces.registration import InactiveStatus
-from zope.app.component.interfaces import ILocalUtility
 from zope.app.publisher.browser import BrowserView
 from zope.app.component.interfaces import ISite
 from zope.app.component.site import LocalSiteManager
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 from zope.component.interfaces import IFactory
 from zope.interface.interfaces import IMethod
 from zope.schema.interfaces import IField
@@ -103,14 +100,6 @@
     menu_id = None
     title = _("Add Utility")
 
-    _addFilterInterface = ILocalUtility
-
-    def add(self, content):
-        # Override so as to check the type of the new object.
-        if not ILocalUtility.providedBy(content):
-            raise TypeError("%s is not a local utility" % content)
-        return super(UtilityAdding, self).add(content)
-
     def nextURL(self):
         v = zapi.queryMultiAdapter(
             (self.added_object, self.request), name="addRegistration.html")
@@ -168,7 +157,7 @@
 
         """
         if ISite.providedBy(self.context):
-            raise zapi.UserError('This is already a site')
+            raise UserError('This is already a site')
 
         # We don't want to store security proxies (we can't,
         # actually), so we have to remove proxies here before passing

Deleted: Zope3/branches/jim-adapter/src/zope/app/component/browser/ftests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/browser/ftests.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/browser/ftests.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,39 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2004 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Functional tests
-
-$Id$
-"""
-import unittest
-from zope.app.testing import functional
-
-
-class RegistrationViewTests(functional.BrowserTestCase):
-
-    def testRegistrationView(self):
-        response = self.publish(
-            '/++etc++site/default/++registrations++/@@index.html',
-            basic='mgr:mgrpw',
-            handle_errors=True)
-        self.assertEqual(response.getStatus(), 200)
-        body = response.getBody()
-        self.assert_('Registration Manager' in body)
-
-
-def test_suite():
-    return unittest.makeSuite(RegistrationViewTests)
-
-
-if __name__ == '__main__':
-    unittest.main(defaultTest='test_suite')

Modified: Zope3/branches/jim-adapter/src/zope/app/component/browser/tools.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/browser/tools.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/browser/tools.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,12 +17,11 @@
 """
 import zope.interface
 import zope.event
+from zope.exceptions.interfaces import UserError
 
 from zope.app import zapi
 from zope.app.component import site, interfaces, browser
 from zope.app.event import objectevent
-from zope.app.exception.interfaces import UserError
-
 from zope.app.i18n import ZopeMessageFactory as _
 
 
@@ -139,10 +138,9 @@
     def toolExists(self, interface, name=''):
         """Check whether a tool already exists in this site"""
         sm = zapi.getSiteManager()
-        for reg in sm.registrations():
-            if isinstance(reg, site.UtilityRegistration):
-                if reg.name == name and reg.provided == interface:
-                    return True
+        for reg in sm.registeredUtilities():
+            if reg.name == name and reg.provided == interface:
+                return True
         return False
 
     def getUniqueTools(self):
@@ -159,20 +157,23 @@
 
     def getToolInstances(self, tool):
         """Find every registered utility for a given tool configuration."""
-        regManager = self.getSiteManagementFolder(tool).registrationManager
+        sm = zapi.getSiteManager(self.context)
         return [
             {'name': reg.name,
              'url': zapi.absoluteURL(reg.component, self.request),
              'rename': tool is self.activeTool and reg.name in self.renameList,
-             'renameNew': tool is self.activeTool and \
-                          reg.name in self.renameList and \
-                          self.newNames and \
-                          self.newNames[self.renameList.index(reg.name)],
-             'active': reg.status == u'Active',
+             'renameNew': (tool is self.activeTool
+                           and 
+                           reg.name in self.renameList
+                           and 
+                           self.newNames
+                           and 
+                           self.newNames[self.renameList.index(reg.name)]
+                           ),
             }
-            for reg in regManager.values()
-            if (zapi.isinstance(reg, site.UtilityRegistration) and
-                reg.provided.isOrExtends(tool.interface))]
+            for reg in sm.registeredUtilities()
+            if reg.provided.isOrExtends(tool.interface)
+            ]
 
     def getTools(self):
         """Return a list of all tools"""
@@ -181,7 +182,12 @@
                     'description': tool.description,
                     'instances': self.getToolInstances(tool),
                     'add': tool is self.activeTool and self.addTool,
-                    'addname': tool is self.activeTool and self.addTool and self.addName,
+                    'addname': (tool is self.activeTool
+                                and
+                                self.addTool
+                                and
+                                self.addName
+                                ),
                     'rename': tool is self.activeTool and self.renameList,
                     'message': tool is self.activeTool and self.msg,
                     }
@@ -217,35 +223,46 @@
 
     def delete(self):
         tool = self.activeTool
-        regManager = self.context[tool.folder].registrationManager
+        sm = self.context
         names = self.request.form['selected']
-        for reg in list(regManager.values()):
+        for reg in list(sm.registeredUtilities()):
             if reg.provided.isOrExtends(tool.interface) and reg.name in names:
+                sm.unregisterUtility(
+                    reg.component,
+                    reg.provided,
+                    reg.name,
+                    )
                 component = reg.component
-                reg.status = interfaces.registration.InactiveStatus
-                del regManager[zapi.name(reg)]
                 del zapi.getParent(component)[zapi.name(component)]
 
     def rename(self):
+        sm = self.context
         tool = self.activeTool
-        regManager = self.context[tool.folder].registrationManager
         new_names = self.request['new_names']
         old_names = self.request['old_names']
         msg=''
-        for reg in regManager.values():
-            if reg.provided.isOrExtends(tool.interface) and \
-                   reg.name in old_names:
+        for reg in list(sm.registeredUtilities()):
+            if (reg.provided.isOrExtends(tool.interface) and 
+                reg.name in old_names
+                ):
                 old_name=reg.name
                 new_name = new_names[old_names.index(old_name)]
-                if new_name!=reg.name:
+                if new_name != reg.name:
                     if self.toolExists(self.activeTool.interface,new_name):
                         if not msg:
-                            msg=_(u'The given tool name is already being used.')
+                            msg=_(
+                                u'The given tool name is already being used.')
                     else:
-                        orig_status = reg.status
-                        reg.status = interfaces.registration.InactiveStatus
-                        reg.name = new_names[old_names.index(old_name)]
-                        reg.status = orig_status
+                        sm.unregisterUtility(
+                            reg.component,
+                            reg.provided,
+                            reg.name,
+                            )
+                        sm.registerUtility(
+                            reg.component,
+                            reg.provided,
+                            new_name,
+                            )
                         self.renameList.remove(old_name)
                         self.newNames.remove(new_name)
                 else:
@@ -258,7 +275,7 @@
         """See zope.app.container.interfaces.IAdding"""
 
         name = self.contentName
-        if self.toolExists(self.activeTool.interface,name):
+        if self.toolExists(self.activeTool.interface, name):
             raise UserError(_(u'The given tool name is already being used.'))
         
         sm = self.context
@@ -271,11 +288,9 @@
 
         # Add registration
         name = not self.activeTool.unique and self.contentName or u''
-        registration = site.UtilityRegistration(
-            name, self.activeTool.interface, util)
-        self.context.registrationManager.addRegistration(registration)
-        registration.status = interfaces.registration.ActiveStatus
 
+        sm.registerUtility(util, self.activeTool.interface, name)
+
         self.context = sm
         return util
 

Modified: Zope3/branches/jim-adapter/src/zope/app/component/browser/tools.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/browser/tools.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/browser/tools.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -4,22 +4,26 @@
 
   >>> from zope import interface
 
+XXX There is no documentation in this doctest. :(
+
 First we define a utility to work with :
 
   >>> from zope.app.content.interfaces import IContentType
-  >>> from zope.app.component.interfaces.registration import IRegisterable
   >>> class IFooUtil(interface.Interface):
   ...     pass
   >>> class FooUtil(object):
   ...     __parent__ = None
   ...     __name__ = u''
-  ...     interface.implements(IFooUtil, IRegisterable, IContentType)
+  ...     interface.implements(IFooUtil, IContentType)
 
   >>> from zope.app.component.browser import tools
   >>> from zope import component
 
+We create a tool-configuration utility that provides information for
+the the UI.
+
   >>> toolConfig = tools.ToolConfiguration(IFooUtil, 'FooUtil')
-  >>> component.provideUtility(toolConfig, tools.IToolConfiguration, 'IFooUtil')
+  >>> component.provideUtility(toolConfig, name='IFooUtil')
 
 We need a factory to create our new utility :
 
@@ -104,12 +108,8 @@
   >>> view.update()
   u'Tools successfully renamed.'
   >>> current_tools = view.getTools()
-  >>> current_tools[0]['instances'][0]['name']
-  'JohnDoe'
-  >>> current_tools[0]['instances'][1]['name']
-  'foo2'
-  >>> current_tools[0]['instances'][2]['name']
-  u''
+  >>> sorted([i['name'] for i in current_tools[0]['instances']])
+  [u'', 'JohnDoe', 'foo2']
 
   >>> request.form['old_names']=['JohnDoe', 'foo2']
   >>> request.form['new_names']=['foo1', 'Tres']
@@ -117,12 +117,8 @@
   >>> view.update()
   u'Tools successfully renamed.'
   >>> current_tools = view.getTools()
-  >>> current_tools[0]['instances'][0]['name']
-  'foo1'
-  >>> current_tools[0]['instances'][1]['name']
-  'Tres'
-  >>> current_tools[0]['instances'][2]['name']
-  u''
+  >>> sorted([i['name'] for i in current_tools[0]['instances']])
+  [u'', 'Tres', 'foo1']
 
 Deleting utilities
 ------------------

Modified: Zope3/branches/jim-adapter/src/zope/app/component/configure.zcml
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/configure.zcml	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/configure.zcml	2006-04-04 15:56:58 UTC (rev 66397)
@@ -46,31 +46,7 @@
       trusted="true"
       />
 
-  <subscriber
-      for=".interfaces.registration.IComponentRegistration
-           zope.app.container.interfaces.IObjectRemovedEvent"
-      handler=".registration.ComponentRegistrationRemoveSubscriber"
-      />
 
-  <subscriber
-      for=".interfaces.registration.IComponentRegistration
-           zope.app.container.interfaces.IObjectAddedEvent"
-      handler=".registration.ComponentRegistrationAddSubscriber"
-      />
-
-  <subscriber
-      for=".interfaces.registration.IComponentRegistration
-           .interfaces.registration.IRegistrationEvent"
-      handler=".registration.componentRegistrationEventNotify"
-      />
-
-  <subscriber
-      for=".interfaces.registration.IRegisterable
-           zope.app.container.interfaces.IObjectMovedEvent"
-      handler=".registration.RegisterableMoveSubscriber"
-      />
-
-
   <!-- Site and Site Manager Framework -->
 
   <module module=".interfaces">
@@ -85,20 +61,10 @@
         interface="zope.app.container.interfaces.IReadContainer" />
     <require
         permission="zope.ManageSite"
-        interface="zope.component.interfaces.ISiteManager
+        interface="zope.component.interfaces.IComponentLookup
                    zope.app.container.interfaces.IWriteContainer" />
   </class>
 
-  <!-- TODO: We allow these attributes to be changed. We need some subscriber
-       that updated the registries once attributes change. -->
-  <class class=".site.AdapterRegistration">
-    <require
-        permission="zope.ManageSite"
-        interface=".interfaces.IAdapterRegistration"
-        set_schema=".interfaces.IAdapterRegistration"
-        />
-  </class>
-
   <class class=".site.UtilityRegistration">    
     <require
         permission="zope.ManageSite"
@@ -123,7 +89,7 @@
   </class>
   
   <adapter 
-      for="zope.component.interfaces.ISiteManager"
+      for="zope.component.interfaces.IComponentLookup"
       provides="zope.app.filerepresentation.interfaces.IDirectoryFactory"
       factory=".site.SMFolderFactory"
       permission="zope.ManageContent"
@@ -131,7 +97,7 @@
 
   <adapter
       for="zope.interface.Interface" 
-      provides="zope.component.interfaces.ISiteManager"
+      provides="zope.component.interfaces.IComponentLookup"
       factory=".site.SiteManagerAdapter"
       />
 

Modified: Zope3/branches/jim-adapter/src/zope/app/component/fields.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/fields.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/fields.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -18,7 +18,7 @@
 __docformat__ = 'restructuredtext'
 
 import zope.schema
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 from zope.configuration.exceptions import ConfigurationError
 from zope.configuration.fields import GlobalObject
 

Modified: Zope3/branches/jim-adapter/src/zope/app/component/hooks.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/hooks.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/hooks.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -86,7 +86,7 @@
     # We should really look look at this again though, especially
     # once site managers do less.  There's probably no good reason why
     # they can't be proxied.  Well, except maybe for performance.
-    sm = zope.component.interfaces.ISiteManager(
+    sm = zope.component.interfaces.IComponentLookup(
         context, zope.component.getGlobalSiteManager())
     return zope.security.proxy.removeSecurityProxy(sm)
 
@@ -94,25 +94,18 @@
 def adapter_hook(interface, object, name='', default=None):
     try:
         return siteinfo.adapter_hook(interface, object, name, default)
-    except zope.component.exceptions.ComponentLookupError:
+    except zope.component.interfaces.ComponentLookupError:
         return default
 
 
 def setHooks():
     zope.component.adapter_hook.sethook(adapter_hook)
     zope.component.getSiteManager.sethook(getSiteManager)
-    # BBB: Goes away in 3.3.
-    zope.deprecation.__show__.off()
-    from bbb import hooks
-    zope.component.getServices.sethook(hooks.getServices_hook)
-    zope.deprecation.__show__.on()
 
 def resetHooks():
     # Reset hookable functions to original implementation.
     zope.component.adapter_hook.reset()
     zope.component.getSiteManager.reset()
-    # BBB: Goes away in 3.3.
-    zope.component.getServices.reset()
 
 # Clear the site thread global
 clearSite = setSite

Modified: Zope3/branches/jim-adapter/src/zope/app/component/interface.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/interface.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/interface.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,7 +17,7 @@
 """
 __docformat__ = 'restructuredtext'
 from types import ClassType
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 from zope.interface import directlyProvides, directlyProvidedBy
 from zope.interface.interfaces import IInterface
 from zope.app import zapi
@@ -99,7 +99,7 @@
         iface_type = IInterface
         
     gsm = zapi.getGlobalSiteManager()
-    gsm.provideUtility(iface_type, interface, id, info)
+    gsm.registerUtility(interface, iface_type, id, info)
 
 
 def getInterface(context, id):
@@ -120,7 +120,7 @@
     >>> getInterface(None, 'zope.app.component.interface.I4')
     Traceback (most recent call last):
     ...
-    ComponentLookupError: 'zope.app.component.interface.I4'
+    ComponentLookupError: zope.app.component.interface.I4
     >>> provideInterface('', I4, IContentType)
     >>> IContentType.providedBy(I4)
     True

Modified: Zope3/branches/jim-adapter/src/zope/app/component/interfaces/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/interfaces/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/interfaces/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,27 +15,26 @@
 
 $Id$
 """
+
+
 import zope.interface
-import zope.schema
-import zope.component
-from zope.app.container.interfaces import IContainer
-from zope.app.container.constraints import ContainerTypesConstraint
-from zope.app.container.constraints import ItemTypePrecondition
+import zope.component.interfaces
+import zope.app.container.interfaces
+import zope.app.container.constraints
 from zope.app.i18n import ZopeMessageFactory as _
 import registration
 
-class ILocalAdapterRegistry(registration.IRegistry,
-                            registration.ILocatedRegistry):
+import zope.deferredimport
 
-    def adaptersChanged():
-        """Update the adapter surrogates, since the registrations changed."""
+zope.deferredimport.deprecatedFrom(
+    "Local registration is now much simpler.  The old baroque APIs "
+    "will go away in Zope 3.5.  See the new component-registration APIs "
+    "defined in zope.component, especially IComponentRegistry.",
+    'zope.app.component.back35',
+    'ILocalAdapterRegistry', 'ILocalUtility', 'IAdapterRegistration',
+    'IUtilityRegistration',
+    )
 
-    def baseChanged():
-        """Someone changed the base registry
-
-        This should only happen during testing
-        """
-
 class IPossibleSite(zope.interface.Interface):
     """An object that could be a site
     """
@@ -53,125 +52,58 @@
 class ISite(IPossibleSite):
     """Marker interface to indicate that we have a site"""
 
-class ILocalSiteManager(zope.component.interfaces.ISiteManager,
-                        registration.ILocatedRegistry,
-                        registration.IRegistry):
-    """Site Managers act as containers for registerable components.
-
-    If a Site Manager is asked for an adapter or utility, it checks for those
-    it contains before using a context-based lookup to find another site
-    manager to delegate to.  If no other site manager is found they defer to
-    the global site manager which contains file based utilities and adapters.
+class INewLocalSite(zope.interface.Interface):
+    """Event: a local site was created
     """
 
-class INewLocalSite(zope.interface.Interface):
-
     manager = zope.interface.Attribute("The new site manager")
 
 class NewLocalSite:
+    """Event: a local site was created
+    """
     zope.interface.implements(INewLocalSite)
     
     def __init__(self, manager):
         self.manager = manager
 
 
-class ISiteManagementFolder(registration.IRegisterableContainer,
-                            IContainer):
-    """Component and component registration containers."""
+class ILocalSiteManager(zope.component.interfaces.IComponents):
+    """Site Managers act as containers for registerable components.
 
-    __parent__ = zope.schema.Field(
-        constraint = ContainerTypesConstraint(
-            ILocalSiteManager,
-            registration.IRegisterableContainer,
-            ),
-        )
-
-class ILocalUtility(registration.IRegisterable):
-    """Local utility marker.
-
-    A marker interface that indicates that a component can be used as
-    a local utility.
-
-    Utilities should usually also declare they implement
-    IAttributeAnnotatable, so that the standard adapter to
-    IRegistered can be used; otherwise, they must provide
-    another way to be adaptable to IRegistered.
+    If a Site Manager is asked for an adapter or utility, it checks for those
+    it contains before using a context-based lookup to find another site
+    manager to delegate to.  If no other site manager is found they defer to
+    the global site manager which contains file based utilities and adapters.
     """
 
+    subs = zope.interface.Attribute(
+        "A collection of registries that describe the next level "
+        "of the registry tree. They are the children of this "
+        "registry node. This attribute should never be "
+        "manipulated manually. Use `addSub()` and `removeSub()` "
+        "instead.")
 
-class IAdapterRegistration(registration.IComponentRegistration):
-    """Local Adapter Registration for Local Adapter Registry
+    def addSub(sub):
+        """Add a new sub-registry to the node.
 
-    The adapter registration is used to provide local adapters via the
-    adapter registry. It is an extended component registration, whereby the
-    component is the adapter factory in this case.
-    """
-    required = zope.schema.Choice(
-        title = _("For interface"),
-        description = _("The interface of the objects being adapted"),
-        vocabulary="Interfaces",
-        readonly = True,
-        required=False,
-        default=None)
+        Important: This method should *not* be used manually. It is
+        automatically called by `setNext()`. To add a new registry to the
+        tree, use `sub.setNext(self, self.base)` instead!
+        """
 
-    with = zope.schema.Tuple(
-        title = _("With interfaces"),
-        description = _("Additionally required interfaces"),
-        readonly=True,
-        value_type = zope.schema.Choice(vocabulary='Interfaces'),
-        required=False,
-        default=())
+    def removeSub(sub):
+        """Remove a sub-registry to the node.
 
-    provided = zope.schema.Choice(
-        title = _("Provided interface"),
-        description = _("The interface provided"),
-        vocabulary="Interfaces",
-        readonly = True,
-        required = True)
+        Important: This method should *not* be used manually. It is
+        automatically called by `setNext()`. To remove a registry from the
+        tree, use `sub.setNext(None)` instead!
+        """
+    
 
-    name = zope.schema.TextLine(
-        title=_(u"Name"),
-        readonly=False,
-        required=True,
-        default=u''
-        )
+class ISiteManagementFolder(zope.app.container.interfaces.IContainer):
+    """Component and component registration containers."""
 
-    permission = zope.schema.Choice(
-        title=_("The permission required for use"),
-        vocabulary="Permission Ids",
-        readonly=False,
-        required=False,
-        )
+    # XXX we need to figure out how to constrain this or, alternatively,
+    # just use regular folders, which is probably the beter choice.
+    # zope.app.container.constraints.containers(ILocalSiteManager)
 
-    # TODO: for now until we figure out a way to specify the factory directly
-    factoryName = zope.schema.TextLine(
-        title=_(u"Factory Name"),
-        readonly=False,
-        required=False,
-        )
-
-
-class IUtilityRegistration(IAdapterRegistration):
-    """Utility registration object.
-
-    Adapter registries are also used to to manage utilities, since utilities
-    are adapters that are instantiated and have no required interfaces. Thus,
-    utility registrations must fulfill all requirements of an adapter
-    registration as well.
-    """
-
-    name = zope.schema.TextLine(
-        title=_("Register As"),
-        description=_("The name under which the utility will be known."),
-        readonly=False,
-        required=True,
-        default=u''
-        )
-
-    provided = zope.schema.Choice(
-        title=_("Provided interface"),
-        description=_("The interface provided by the utility"),
-        vocabulary="Utility Component Interfaces",
-        readonly=True,
-        required=True,
-        )

Modified: Zope3/branches/jim-adapter/src/zope/app/component/interfaces/registration.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/interfaces/registration.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/interfaces/registration.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,231 +15,53 @@
 
 $Id$
 """
-import zope.component.interfaces
-from zope.interface import Interface, Attribute, implements
-from zope.schema import Field, Choice, vocabulary
-from zope.schema.interfaces import IField
 
-from zope.app.annotation.interfaces import IAttributeAnnotatable
-from zope.app.container.interfaces import IContainerNamesContainer
-from zope.app.container.interfaces import IContained, IContainer
-from zope.app.container.constraints import contains, containers
-from zope.app.event.interfaces import IObjectEvent
-from zope.app.i18n import ZopeMessageFactory as _
+from zope import interface, schema
+import zope.schema.interfaces
+import zope.app.event.interfaces
 
-from zope.app.component import bbb
+import zope.deferredimport
 
-InactiveStatus = _('Inactive')
-ActiveStatus = _('Active')
+zope.deferredimport.deprecatedFrom(
+    "Local registration is now much simpler.  The old baroque APIs "
+    "will go away in Zope 3.5.  See the new component-registration APIs "
+    "defined in zope.component, especially IComponentRegistry.",
+    'zope.app.component.back35',
+    'IRegistration',
+    'InactiveStatus',
+    'ActiveStatus',
+    'IComponentRegistration',
+    'IRegistry',
+    'ILocatedRegistry',
+    'IRegistrationManager',
+    'IRegistrationManagerContained',
+    'IRegisterableContainer',
+    'IRegisterable',
+    'IRegisterableContainerContaining',
+    'IRegistered',
+    )
 
+zope.deferredimport.deprecated(
+    "Registration events are not defined in zope.component.interfaces. "
+    "Importing them from zope.app.component.registration will be disallowed "
+    "in Zope 3.5",
+    IRegistrationEvent = 'zope.component.interfaces:IRegistrationEvent',
+    IRegistrationActivatedEvent = 'zope.component.interfaces:IRegistered',
+    IRegistrationDeactivatedEvent = 'zope.component.interfaces:IUnregistered',
+    )
 
-class IRegistrationEvent(IObjectEvent):
-    """An event that involves a registration"""
+class IComponent(zope.schema.interfaces.IField):
+    """A component 
 
-class IRegistrationActivatedEvent(IRegistrationEvent):
-    """This event is fired, when a component's registration is activated."""
-
-class IRegistrationDeactivatedEvent(IRegistrationEvent):
-    """This event is fired, when a component's registration is deactivated."""
-
-
-class IRegistration(Interface):
-    """Registration object
-
-    A registration object represents a specific registration
-    decision, such as registering an adapter or defining a permission.
-
-    In addition to the attributes or methods defined here,
-    registration objects will include additional attributes
-    identifying how they should be used. For example, a service
-    registration will provide a service type. An adapter
-    registration will specify a used-for interface and a provided
-    interface.
-    """
-
-    status = Choice(
-        title=_("Registration status"),
-        vocabulary=vocabulary.SimpleVocabulary(
-            (vocabulary.SimpleTerm(InactiveStatus, title=InactiveStatus),
-             vocabulary.SimpleTerm(ActiveStatus, title=ActiveStatus))),
-        default=ActiveStatus
-        )
-
-class IComponent(IField):
-    """A component path
-
     This is just the interface for the ComponentPath field below.  We'll use
     this as the basis for looking up an appropriate widget.
     """
 
-class Component(Field):
-    """A component path
+class Component(schema.Field):
+    """A component 
 
     Values of the field are absolute unicode path strings that can be
     traversed to get an object.
     """
-    implements(IComponent)
+    interface.implements(IComponent)
 
-
-class IComponentRegistration(IRegistration):
-    """Registration object that uses a component.
-
-    An interface can optionally be specified that describes the interface the
-    component provides for the registry.
-    
-    The interface will be used to produce a proxy for the component, if
-    the permission is also specified.
-    """
-    component = Component(
-        title=_("Registration Component"),
-        description=_("The component the registration is for."),
-        required=True)
-
-    interface = Field(
-        title=_("Component Interface"),
-        description=_("The interface the component provides through this "
-                      "registration."),
-        required=False,
-        default=None)
-
-    permission = Choice(
-        title=_("The permission needed to use the component"),
-        vocabulary="Permissions",
-        required=False
-        )
-
-
-class IRegistry(zope.component.interfaces.IRegistry):
-    """A component that can be configured using a registration manager."""
-
-    def register(registration):
-        """Register a component with the registry using a registration.
-
-        Once the registration is added to the registry, it will be active. If
-        the registration is already registered with the registry, this method
-        will quietly return.
-        """
-
-    def unregister(registration):
-        """Unregister a component from the registry.
-
-        Unregistering a registration automatically makes the component
-        inactive. If the registration is not registered, this method will
-        quietly return.
-        """
-
-    def registered(registration):
-        """Determine whether a registration is registered with the registry.
-
-        The method will return a Boolean value.
-        """
-
-
-class ILocatedRegistry(zope.component.interfaces.IRegistry):
-    """A registry that is located in a tree of registries.
-
-    
-    """
-    next = Attribute("Set the next local registry in the tree. This attribute "
-                     "represents the parent of this registry node. If the "
-                     "value is `None`, then this registry represents the "
-                     "root of the tree")
-
-    subs = Attribute("A collection of registries that describe the next level "
-                     "of the registry tree. They are the children of this "
-                     "registry node. This attribute should never be "
-                     "manipulated manually. Use `addSub()` and `removeSub()` "
-                     "instead.")
-
-    base = Attribute("Outside of the local registry tree lies the global "
-                     "registry, which is known as the base to every local "
-                     "registry in the tree.")
-
-    def addSub(sub):
-        """Add a new sub-registry to the node.
-
-        Important: This method should *not* be used manually. It is
-        automatically called by `setNext()`. To add a new registry to the
-        tree, use `sub.setNext(self, self.base)` instead!
-        """
-
-    def removeSub(sub):
-        """Remove a sub-registry to the node.
-
-        Important: This method should *not* be used manually. It is
-        automatically called by `setNext()`. To remove a registry from the
-        tree, use `sub.setNext(None)` instead!
-        """
-
-    def setNext(next, base=None):
-        """Set the next/parent registry in the tree.
-
-        This method should ensure that all relevant registies are updated
-        correctly as well.
-        """
-
-
-class IRegistrationManager(IContainerNamesContainer):
-    """Manage Registrations"""
-    contains(IRegistration)
-
-    def addRegistration(registration):
-        """Add a registration to the manager.
-
-        The function will automatically choose a name as which the
-        registration will be known. The name of the registration inside this
-        manager is returned.
-        """
-
-
-class IRegistrationManagerContained(IContained):
-    """Objects that can be contained by the registration manager should
-    implement this interface."""
-    containers(IRegistrationManager)
-
-
-class IRegisterableContainer(IContainer):
-    """Containers with registration managers
-
-    These are site-management folders of one sort or another.
-
-    The container allows clients to access the registration manager
-    without knowing it's name.
-
-    The registration manager container *also* supports local-module
-    lookup.
-    """
-
-    registrationManager = Field(
-        title=_("Registration Manager"),
-        description=_("The registration manager keeps track of all component "
-                    "registrations."))
-
-
-class IRegisterable(IContained):
-    """Mark a component as registerable.
-
-    All registerable components need to implement this interface. 
-    """
-    containers(IRegisterableContainer)
-
-
-class IRegisterableContainerContaining(IContainer):
-    """A container that can only contain `IRegisterable`s and
-    `IRegisterableContainer`s.
-
-    This interface was designed to be always used together with the
-    `IRegisterableContainer`.
-    """
-    contains(IRegisterable, IRegisterableContainer)
-    
-
-class IRegistered(Interface, bbb.interfaces.IBBBRegistered):
-    """An object that can track down its registrations.
-
-    The object need not implement this functionality itself, but must at
-    least support doing so via an adapter.
-    """
-
-    def registrations():
-        """Return a sequence of registration objects for this object."""

Modified: Zope3/branches/jim-adapter/src/zope/app/component/registration.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/registration.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/registration.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,257 +15,35 @@
 
 $Id$
 """
-from persistent import Persistent
 
-import zope.event
-from zope.component import subscribers
+from zope.app.event import objectevent
 from zope.interface import implements
-from zope.security.checker import InterfaceChecker, CheckerPublic
-from zope.security.proxy import Proxy, removeSecurityProxy
+import zope.app.component.interfaces.registration
+import zope.deferredimport
 
-from zope.app import zapi
-from zope.app.component.interfaces import registration as interfaces
-from zope.app.container.btree import BTreeContainer
-from zope.app.container.contained import Contained
-from zope.app.dependable.interfaces import IDependable, DependencyError
-from zope.app.event import objectevent
-from zope.app.location import inside
-from zope.app.traversing.interfaces import TraversalError
-from zope.app.i18n import ZopeMessageFactory as _
+zope.deferredimport.deprecatedFrom(
+    """The old registration APIs, are deprecated and will go away in Zope 3.5
 
-# BBB: First introduced in 3.1; should go away in 3.3 
-import bbb
+    See the newer component-registration APIs in
+    zope.component.interfaces.IComponentRegistry.
+    """,
+    "zope.app.component.back35",
+    'RegistrationStatusProperty',
+    'SimpleRegistration',
+    'ComponentRegistration',
+    'Registered',
+    'RegistrationManager',
+    'RegisterableContainer',
+    'RegistrationManagerNamespace',
+    )
 
+zope.deferredimport.deprecated(
+    "Registration events are now defined in zope.component.interfaces. "
+    "Importing them from zope.app.component.registration will be disallowed "
+    "in Zope 3.5",
+    RegistrationEvent = 'zope.component.interfaces:RegistrationEvent',
+    RegistrationActivatedEvent = 'zope.component.interfaces:Registered',
+    RegistrationDeactivatedEvent = 'zope.component.interfaces:Unregistered',
+    )
 
-class RegistrationEvent(objectevent.ObjectEvent):
-    """An event that is created when a registration-related activity occurred.
-    """
-    implements(interfaces.IRegistrationEvent)
 
-class RegistrationActivatedEvent(RegistrationEvent):
-    """An event that is created when a registration is activated."""
-    implements(interfaces.IRegistrationActivatedEvent)
-
-class RegistrationDeactivatedEvent(RegistrationEvent):
-    """An event that is created when a registration is deactivated."""
-    implements(interfaces.IRegistrationDeactivatedEvent)
-
-
-class RegistrationStatusProperty(object):
-    """A descriptor used to implement `IRegistration`'s `status` property."""
-    def __get__(self, inst, klass):
-        registration = inst
-        if registration is None:
-            return self
-
-        registry = registration.getRegistry()
-        if registry and registry.registered(registration):
-            return interfaces.ActiveStatus
-
-        return interfaces.InactiveStatus
-
-    def __set__(self, inst, value):
-        registration = inst
-        registry = registration.getRegistry()
-        if registry is None:
-            raise ValueError('No registry found.')
-
-        if value == interfaces.ActiveStatus:
-            if not registry.registered(registration):
-                registry.register(registration)
-                zope.event.notify(RegistrationActivatedEvent(registration))
-
-        elif value == interfaces.InactiveStatus:
-            if registry.registered(registration):
-                registry.unregister(registration)
-                zope.event.notify(RegistrationDeactivatedEvent(registration))
-        else:
-            raise ValueError(value)
-
-
-class SimpleRegistration(Persistent, Contained):
-    """Registration objects that just contain registration data"""
-    implements(interfaces.IRegistration,
-               interfaces.IRegistrationManagerContained)
-
-    # See interfaces.IRegistration
-    status = RegistrationStatusProperty()
-
-    def getRegistry(self):
-        """See interfaces.IRegistration"""
-        raise NotImplementedError(
-              'This method must be implemented by each specific regstration.')
-
-
-class ComponentRegistration(bbb.registration.BBBComponentRegistration,
-                            SimpleRegistration):
-    """Component registration.
-
-    Subclasses should define a getInterface() method returning the interface
-    of the component.
-    """
-    implements(interfaces.IComponentRegistration)
-
-    def __init__(self, component, permission=None):
-        # BBB: Will go away in 3.3.
-        super(ComponentRegistration, self).__init__(component, permission)
-        # self.component = component
-        if permission == 'zope.Public':
-            permission = CheckerPublic
-        self.permission = permission
-
-    def _getComponent(self):
-        if self.permission and self.interface:
-            checker = InterfaceChecker(self.interface, self.permission)
-            return Proxy(self._component, checker)
-        return self._component
-
-    def _setComponent(self, component):
-        # We always want to set the plain component. Untrusted code will
-        # get back a proxied component anyways.
-        self._component = removeSecurityProxy(component)
-
-    # See zope.app.component.interfaces.registration.IComponentRegistration
-    component = property(_getComponent, _setComponent)
-
-    # See zope.app.component.interfaces.registration.IComponentRegistration
-    interface = None
-
-
-def SimpleRegistrationRemoveSubscriber(registration, event):
-    """Receive notification of remove event."""
-    sm = zapi.getSiteManager(registration)
-    removed = event.object
-    if (sm == removed) or inside(sm, removed):
-        # we don't really care if the registration is active, since the site
-        # is going away.
-        return
-
-    objectstatus = registration.status
-
-    if objectstatus == interfaces.ActiveStatus:
-        try:
-            objectpath = zapi.getPath(registration)
-        except: # TODO decide if this is really the best fall-back plan
-            objectpath = str(registration)
-        msg = _("Can't delete active registration (${path})",
-                mapping={u'path': objectpath})
-        raise DependencyError(msg)
-
-
-def ComponentRegistrationRemoveSubscriber(componentRegistration, event):
-    """Receive notification of remove event."""
-    component = componentRegistration.component
-    try:
-        dependents = IDependable(component)
-    except TypeError:
-        return
-    objectpath = zapi.getPath(componentRegistration)
-    dependents.removeDependent(objectpath)
-
-
-def ComponentRegistrationAddSubscriber(componentRegistration, event):
-    """Receive notification of add event."""
-    component = componentRegistration.component
-    try:
-        dependents = IDependable(component)
-    except TypeError:
-        return
-    objectpath = zapi.getPath(componentRegistration)
-    dependents.addDependent(objectpath)
-
-
-def componentRegistrationEventNotify(componentReg, event):
-    """Subscriber to dispatch registration events for components."""
-    adapters = subscribers((componentReg.component, event), None)
-    for adapter in adapters:
-        pass # getting them does the work
-
-
-def RegisterableMoveSubscriber(registerable, event):
-    """A registerable cannot be moved as long as it has registrations in the
-    registration manager."""
-    if event.oldParent is not None and event.newParent is not None:
-        if event.oldParent is not event.newParent:
-            raise DependencyError(
-                _("Can't move a registered component from its container."))
-
-
-class Registered(bbb.registration.BBBRegistered, object):
-    """An adapter from IRegisterable to IRegistered.
-
-    This class is the only place that knows how 'Registered'
-    data is represented.
-    """
-    implements(interfaces.IRegistered)
-    __used_for__ = interfaces.IRegisterable
-
-    def __init__(self, registerable):
-        self.registerable = registerable
-
-    def registrations(self):
-        rm = zapi.getParent(self.registerable).registrationManager
-        return [reg for reg in rm.values()
-                if (interfaces.IComponentRegistration.providedBy(reg) and
-                    reg.component is self.registerable)]
-
-
-class RegistrationManager(bbb.registration.BBBRegistrationManager,
-                          BTreeContainer):
-    """Registration manager
-
-    Manages registrations within a package.
-    """
-    implements(interfaces.IRegistrationManager)
-
-    def addRegistration(self, reg):
-        "See IWriteContainer"
-        key = self._chooseName('', reg)
-        self[key] = reg
-        return key
-
-    def _chooseName(self, name, reg):
-        """Choose a name for the registration."""
-        if not name:
-            name = reg.__class__.__name__
-
-        i = 1
-        chosenName = name
-        while chosenName in self:
-            i += 1
-            chosenName = name + str(i)
-
-        return chosenName
-
-
-class RegisterableContainer(bbb.registration.BBBRegisterableContainer):
-    """Mix-in to implement `IRegisterableContainer`"""
-    implements(interfaces.IRegisterableContainer,
-               interfaces.IRegisterableContainerContaining)
-
-    def __init__(self):
-        super(RegisterableContainer, self).__init__()
-        self.__createRegistrationManager()
-
-    def __createRegistrationManager(self):
-        "Create a registration manager and store it as `registrationManager`"
-        # See interfaces.IRegisterableContainer
-        self.registrationManager = RegistrationManager()
-        self.registrationManager.__parent__ = self
-        self.registrationManager.__name__ = '++registrations++'
-        zope.event.notify(
-            objectevent.ObjectCreatedEvent(self.registrationManager))
-
-
-class RegistrationManagerNamespace(object):
-    """Used to traverse to a Registration Manager from a
-       Registerable Container."""
-    __used_for__ = interfaces.IRegisterableContainer
-
-    def __init__(self, ob, request=None):
-        self.context = ob.registrationManager
-
-    def traverse(self, name, ignore):
-        if name == '':
-            return self.context
-        raise TraversalError(self.context, name)

Deleted: Zope3/branches/jim-adapter/src/zope/app/component/registration.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/registration.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/registration.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,461 +0,0 @@
-==========================
-The Registration Framework
-==========================
-
-The registration framework's task is to manage registrations and ensure that
-the correct registrations are inserted into the correct registries. Each
-registration knows to which registry it belongs. If a registration is set
-active, then the registration is added to the regstry; when inactive, it is
-removed from the registry. Please see `statusproperty.txt` for a demonstration
-on how the setting of the registration's status affects the registry.
-
-The true power of the registration framework, however, comes from the ability
-to provide registrations for registerable components. In the context of Zope
-3's component architecture, registerable components are adapters and
-utilities. Since the registration framework can be used for any kind of
-component registration, I am going to refer to registerable components
-(including adapters and interface) as components. 
-
-The first task is to create a simple component registry. It will implement all
-required `IRegistry` methods and a `getComponents()` method, which will return
-a list of all registered (active) components.
-
-  >>> import zope.interface
-  >>> from zope.app.component import interfaces
-  >>> class ComponentRegistry(object):
-  ...     zope.interface.implements(interfaces.registration.IRegistry)
-  ...
-  ...     def __init__(self):
-  ...         self._registrations = []
-  ...
-  ...     def registrations(self):
-  ...         """See zope.component.interfaces.IRegistry"""
-  ...         return self._registrations
-  ...
-  ...     def register(self, registration):
-  ...         """See interfaces.registration.IRegistry"""
-  ...         self._registrations.append(registration)
-  ...
-  ...     def unregister(self, registration):
-  ...         """See interfaces.registration.IRegistry"""
-  ...         del self._registrations[self._registrations.index(registration)]
-  ...
-  ...     def registered(self, registration):
-  ...         """See interfaces.registration.IRegistry"""
-  ...         return registration in self._registrations
-  ...
-  ...     def getComponents(self):
-  ...         return [reg.component for reg in self.registrations()]  
-
-  >>> registry = ComponentRegistry()
-
-Effectively, a registry manages a set of active registrations. A simple
-UML diagram would be::
-
-                          ---------------------------    
-    --------------- *   1 |  IRegistration          |
-    |  IRegistry  |-------| - - - - - - - - - - - - |
-    ---------------       |  status = ActiveStatus  |
-                          ---------------------------
-
-Next we need to create a registration object that can register components with
-our new registry. The framework already provides a base-class for
-component-based registrations, so that we only need to implement the
-`getRegistry()` method:
-
-  >>> from zope.app.component.registration import ComponentRegistration
-  >>> class Registration(ComponentRegistration):
-  ...
-  ...     def getRegistry(self):
-  ...         global registry
-  ...         return registry
-  ... 
-  ...     def __repr__(self):
-  ...         return "<Registration for '%s'>" %self.component
-
-In the implementation above, all `Registration` instances are simply going to
-use the global `registry` object. Now that we have a registry and a suitable
-registration class, let's test what we have so far. To do that we have to
-create a component that we would like to register:
-
-  >>> from zope.app.container.contained import Contained
-  >>> class Component(Contained):
-  ...     zope.interface.implements(interfaces.registration.IRegisterable)
-  ...     def __init__(self, title=u''):
-  ...         self.title = title
-  ...     def __repr__(self):
-  ...        return "<Component: '%s'>" %self.title
-
-Note that `Contained` is used as a base class, since `IRegisterable` requires
-it to be. We will later see why this is the case. 
-
-Before we are registering any component, the registry is empty:
-
-  >>> registry.getComponents()
-  []
-
-Now we create a component and a registration:
-
-  >>> foo = Component('Foo')
-  >>> regFoo = Registration(foo)
-  >>> regFoo.component
-  <Component: 'Foo'>
-  >>> regFoo.status
-  u'Inactive'
-
-Finally, we activate the registration:
-
- 
-  >>> regFoo.status = interfaces.registration.ActiveStatus
-  >>> regFoo.status
-  u'Active'
-  >>> registry.getComponents()
-  [<Component: 'Foo'>]
-
-Of course, we can add a second registered component:
-
-  >>> bar = Component('Bar')
-  >>> regBar = Registration(bar)
-  >>> regBar.component
-  <Component: 'Bar'>
-  >>> regBar.status
-  u'Inactive'
-  >>> regBar.status = interfaces.registration.ActiveStatus
-  >>> regBar.status
-  u'Active'
-  >>> registry.getComponents()
-  [<Component: 'Foo'>, <Component: 'Bar'>]
-
-Of course, when deactivating a registration, it will be gone from the registry
-as well:
-
-  >>> regFoo.status = interfaces.registration.InactiveStatus
-  >>> regFoo.status
-  u'Inactive'
-  >>> registry.getComponents()
-  [<Component: 'Bar'>]
-
-This is everything that there is about registrations and their interaction
-with a registry. However, the point of registrations and registerable
-components is that they should be persistent (otherwise we could use
-ZCML). Thus we need a way of managing local components and their
-registrations.
-
-
-Management of Local Components and Registrations
-------------------------------------------------
-
-The starting point here is the `IRegisterableContainer`, which can contain
-`IRegiserable` and other `IRegisterableContainer` components.
-
-  >>> from zope.app.container.btree import BTreeContainer
-  >>> from zope.app.component.registration import RegisterableContainer
-
-  >>> class RegisterableManager(RegisterableContainer, BTreeContainer):
-  ...     pass
-  >>> registerables = RegisterableManager()
-
-The `RegisterableContainer` class is merely a mixin and leaves it up to the
-developer to implement the `IContainer` interface. In our case, we simply used
-the default btree container implementation to provide the container
-interface. However, the `RegisterableContainer` class does implement the
-`IRegisterableContainer` interface, which means it ensures the existance of
-the `registrationManager` attribute, which always contains an
-`IRegistrationManager` instance:
-
-  >>> registerables.registrationManager is not None
-  True
-  >>> interfaces.registration.IRegistrationManager.providedBy(
-  ...     registerables.registrationManager)
-  True
-
-The registration manager is a simple container that can only contain
-components providing `IRegistration` and implements a method called
-`addRegistration(registration)` that lets you add a registration to the
-manager without specifying a name. The name will be automatically chosen for
-you and is returned. So let's add our two existing components and their
-registrations:
-
-  >>> regManager = registerables.registrationManager
-
-  >>> registerables['foo'] = foo
-  >>> regManager.addRegistration(regFoo)
-  'Registration'
-
-  >>> registerables['bar'] = bar
-  >>> regManager.addRegistration(regBar)
-  'Registration2'
-
-  >>> items = list(registerables.items())
-  >>> items.sort()
-  >>> items
-  [(u'bar', <Component: 'Bar'>), (u'foo', <Component: 'Foo'>)]
-  >>> regs = list(regManager.items())
-  >>> regs.sort()
-  >>> regs #doctest: +NORMALIZE_WHITESPACE
-  [(u'Registration', <Registration for '<Component: 'Foo'>'>), 
-   (u'Registration2', <Registration for '<Component: 'Bar'>'>)]
-
-Of course, adding a registration to the registration manager does not mean the
-registration is added to the registry, since it still may not be active:
-
-  >>> registry.getComponents()
-  [<Component: 'Bar'>]
-
-Also, there are no restrictions on how many registrations you can create for a
-single component. For example, we can register the `foo` one more time:
-
-  >>> regFoo2 = Registration(foo)
-  >>> regManager.addRegistration(regFoo2)
-  'Registration3'
-  >>> regs = list(regManager.items())
-  >>> regs.sort()
-  >>> regs #doctest: +NORMALIZE_WHITESPACE
-  [(u'Registration', <Registration for '<Component: 'Foo'>'>), 
-   (u'Registration2', <Registration for '<Component: 'Bar'>'>),
-   (u'Registration3', <Registration for '<Component: 'Foo'>'>)]
-
-This also means that our registry can provide a component multiple times:
-
-  >>> regFoo.status = interfaces.registration.ActiveStatus
-  >>> regFoo2.status = interfaces.registration.ActiveStatus
-  >>> registry.getComponents()
-  [<Component: 'Bar'>, <Component: 'Foo'>, <Component: 'Foo'>]
-
-Here is a UML diagram of the registerable container and registration manager
-and their relationships to the other registration-related components we
-discussed.  
-
-::
-
-    ----------------------------
-    |  IRegisterableContainer  |
-    | - - - - - - - - - - - - -|
-    |                       1  |    1 --------------------------
-    |  registrationManager ----+------|  IRegistrationManager  |
-    |                          |      --------------------------
-    ---------------------------+                  | *
-             | *        | *  | 1                  |
-             |          |    |                    | 1
-             | 1        +----+           -------------------
-    -------------------                  |  IRegistration  |
-    |  IRegisterable  |                  -------------------
-    -------------------                           | *
-                                                  |
-                             --------------- 1    |
-                             |  IRegistry  |------+ if status == Active
-                             ---------------
-
-
-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
---------------------------
-
-Until now we have only discussed the most primitive usage of the
-`ComponentRegistration`. Usually, a registry is not just interested in a
-component, but a set of methods which are specified by a particular
-interface. Thus the component registration supports the `interface`
-attribute. By default it is `None`:
-
-  >>> regFoo.interface is None
-  True
-
-We can now write another `IComponentRegistration` implementation that knows
-about the interface; in fact, it will pick the most specific one of the
-component:
-
-  >>> from zope.interface import providedBy
-  >>> class SomethingRegistration(Registration):
-  ...
-  ...     def interface(self):
-  ...         return list(providedBy(self._component))[0]
-  ...     interface = property(interface)
-  
-Next we create an interface and its implementation:
-
-  >>> class ISomething(zope.interface.Interface):
-  ...     pass
-
-  >>> class Something(Component):
-  ...     zope.interface.implements(ISomething)
-
-Creating a "something registration", we can see that the interface attribute
-is now available:
-
-  >>> something = Something('Something')
-  >>> reg = SomethingRegistration(something)
-  >>> reg.interface
-  <InterfaceClass __builtin__.ISomething>
-
-But hold on, we are not done yet! The component registration also supports a
-`permission` attribute. When set and an interface is available, the component
-will always be proxied using an interface checker for the specified
-permission. By default the permission is `None`:
-
-  >>> reg.permission is None
-  True
-
-Now we set a permission for the registration and the component should be
-proxies when returned:
-
-  >>> from zope.security.checker import CheckerPublic  
-  >>> reg.permission = CheckerPublic
-  >>> reg.component is something
-  False
-  >>> type(reg.component) 
-  <type 'zope.security._proxy._Proxy'>
-
-You can also, specify a permission in the constructor:
-
-  >>> regNone = SomethingRegistration(None, 'zope.Public')
-  >>> regNone.permission is CheckerPublic
-  True
-
-If the interface is not available, the permission is ignored and the bare
-component is returned:
-
-  >>> regSomething2 = Registration(something, 'zope.Public')
-  >>> regSomething2.permission is CheckerPublic
-  True
-  >>> regSomething2.component is something
-  True
-
-
-The `Registered` Adapter
-------------------------
-
-Registerable components are able to get a list of all their
-registrations. However, the adapter only works for components and
-registrations that are stored in the registerable container and registration
-manager, respectively. 
-
-  >>> from zope.app.component.registration import Registered
-  >>> registered = Registered(foo)
-  >>> registered.registrations() #doctest: +NORMALIZE_WHITESPACE
-  [<Registration for '<Component: 'Foo'>'>, 
-   <Registration for '<Component: 'Foo'>'>]
-
-If the registerable component is not stored in a registrable container, a
-type error is raised, since no parent can be found:
-
-  >>> registered = Registered(something)
-  >>> registered.registrations() #doctest: +NORMALIZE_WHITESPACE
-  Traceback (most recent call last):
-  ...
-  TypeError: ('Not enough context information to get parent', 
-              <Component: 'Something'>)
-
-
-Registrations and Dependencies
-------------------------------
-
-Registerable objects and registrations have a very close dependence. For
-example, it makes no sense to delete a registerable component and leave its
-registrations around. Instead, registrations always are required to be removed
-before the component. Thus, it is also not allowed to simply copy a
-registerable component to another registerable container:
-
-  >>> orig = RegisterableManager()
-  >>> new = RegisterableManager()
-  >>> comp = Component('comp')
-  
-  >>> from zope.app.container.contained import ObjectMovedEvent
-  >>> event = ObjectMovedEvent(comp, orig, 'comp', new, 'comp')
-  
-  >>> from zope.app.component.registration import RegisterableMoveSubscriber
-  >>> RegisterableMoveSubscriber(comp, event)
-  Traceback (most recent call last):
-  ...
-  DependencyError: Can't move a registered component from its container.
-  
-Hoever, renaming the component is no problem:
-  
-  >>> event = ObjectMovedEvent(comp, orig, 'comp', orig, 'comp-new')
-  >>> RegisterableMoveSubscriber(comp, event)
-
-Whenever a registration is created it is added as a dependence to the
-registerable component, which is removed once the registration is removed. Two
-subscribers handle the management of the dependemcies. 
-
-Since the default `IDependable` adapter uses annotations to store the
-dependents, our component has to provide `IAttrbuteAnnotatable`:
- 
-  >>> from zope.app.annotation.interfaces import IAttributeAnnotatable
-  >>> from zope.interface import directlyProvides
-  >>> directlyProvides(comp, IAttributeAnnotatable)
-
-Make sure that we do not initially have any dependencies:
-
-  >>> from zope.app.dependable.interfaces import IDependable
-  >>> dependents = IDependable(comp)
-  >>> dependents.getPaths()
-  ()
-
-Since the path of the registration is used to store the dependency, we need to
-make sure that we have a containment root; so make the registration itself the
-root:
-
-  >>> reg = Registration(comp)
-  >>> from zope.app.traversing.interfaces import IContainmentRoot
-  >>> directlyProvides(reg, IContainmentRoot)
-
-The component registration add subscriber adds a dependent.
-
-  >>> from zope.app.container.contained import ObjectAddedEvent
-  >>> from zope.app.component.registration import RegistrationManager
-  >>> event = ObjectAddedEvent(reg, RegistrationManager(), 'reg1')
-
-  >>> from zope.app.component.registration import \
-  ...     ComponentRegistrationAddSubscriber
-  >>> ComponentRegistrationAddSubscriber(reg, event)
-
-  >>> dependents = IDependable(comp)
-  >>> dependents.getPaths()
-  (u'/',)
-
-We simply got a slash here, since the registration is a root object. Now we
-remove the dependency again by calling the component registration remove
-subscriber:
-
-  >>> from zope.app.container.contained import ObjectRemovedEvent
-  >>> event = ObjectRemovedEvent(reg, RegistrationManager(), 'reg1')
-
-  >>> from zope.app.component.registration import \
-  ...     ComponentRegistrationRemoveSubscriber
-  >>> ComponentRegistrationRemoveSubscriber(reg, event)
-
-  >>> dependents = IDependable(comp)
-  >>> 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/jim-adapter/src/zope/app/component/site.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/site.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/site.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -27,20 +27,26 @@
 
 import zope.event
 import zope.interface
-import zope.component
-from zope.component.exceptions import ComponentLookupError
+import zope.component.registry
+import zope.component.persistentregistry
+import zope.deprecation
+import zope.deferredimport
+
+from zope.component.interfaces import ComponentLookupError
+import zope.component.interfaces
 from zope.security.proxy import removeSecurityProxy
 
 from zope.app import zapi
-from zope.app.component import adapter
 from zope.app.component import interfaces
 from zope.app.component import registration
 from zope.app.component.hooks import setSite
 from zope.app.container.btree import BTreeContainer
 from zope.app.container.contained import Contained
+import zope.app.location
 from zope.app.event import objectevent
 from zope.app.filerepresentation.interfaces import IDirectoryFactory
 from zope.app.traversing.interfaces import IContainmentRoot
+import zope.app.component.back35
 
 ##############################################################################
 # from zope.app.module import resolve
@@ -65,10 +71,7 @@
 # from zope.app.module import resolve
 ##############################################################################
 
-# Goes away in 3.3.
-import bbb.site
-
-class SiteManagementFolder(registration.RegisterableContainer,
+class SiteManagementFolder(zope.app.component.back35.RegisterableContainer,
                            BTreeContainer):
     zope.interface.implements(interfaces.ISiteManagementFolder)
 
@@ -83,7 +86,7 @@
         return SiteManagementFolder()
 
 
-class SiteManagerContainer(bbb.site.BBBSiteManagerContainer, Contained):
+class SiteManagerContainer(Contained):
     """Implement access to the site manager (++etc++site).
 
     This is a mix-in that implements the IPossibleSite
@@ -91,8 +94,7 @@
     """
     zope.interface.implements(interfaces.IPossibleSite)
 
-    # BBB: Deactive in 3.3 again. Now provided by BBBSiteManagerContainer
-    #_sm = None
+    _sm = None
 
     def getSiteManager(self):
         if self._sm is not None:
@@ -104,12 +106,12 @@
         if interfaces.ISite.providedBy(self):
             raise TypeError("Already a site")
 
-        if zope.component.interfaces.ISiteManager.providedBy(sm):
+        if zope.component.interfaces.IComponentLookup.providedBy(sm):
             self._sm = sm
             sm.__name__ = '++etc++site'
             sm.__parent__ = self
         else:
-            raise ValueError('setSiteManager requires an ISiteManager')
+            raise ValueError('setSiteManager requires an IComponentLookup')
 
         zope.interface.directlyProvides(
             self, interfaces.ISite,
@@ -133,56 +135,64 @@
             return site.getSiteManager()
 
 
-class LocalUtilityRegistry(adapter.LocalAdapterRegistry):
-    """Custom local adapter registry for utilities, since utilities do not
-    just register themselves as null adapters, but also as subscribers."""
 
-    def _updateAdaptersFromRegistration(self, radapters, registration):
-        # Register as null adapter
-        key = (False, registration.with, registration.name,
-               registration.provided)
-        radapters[key] = removeSecurityProxy(registration.component)
-        # Register as subscriber
-        key = (True, registration.with, '', registration.provided)
-        radapters[key] = radapters.get(key, ()) + (
-            removeSecurityProxy(registration.component), )
+class _LocalAdapterRegistry(
+    zope.component.persistentregistry.PersistentAdapterRegistry,
+    zope.app.location.Location,
+    ):
+    pass
 
-
 class LocalSiteManager(BTreeContainer,
-                       bbb.site.BBBSiteManager,
-                       zope.component.site.SiteManager):
+                       zope.component.persistentregistry.PersistentComponents):
     """Local Site Manager implementation"""
-    zope.interface.implements(
-        interfaces.ILocalSiteManager,
-        interfaces.registration.IRegisterableContainerContaining)
+    zope.interface.implements(interfaces.ILocalSiteManager)
 
-    # See interfaces.registration.ILocatedRegistry
-    next = None
     subs = ()
-    base = None
 
+    @property
+    @zope.deprecation.deprecate("Goes away in Zope 3.5.  Use __bases__[0]")
+    def next(self):
+        if self.__bases__:
+            return self.__bases__[0]
+
+    def _setBases(self, bases):
+
+        # Update base subs
+        for base in self.__bases__:
+            if ((base not in bases)
+                and interfaces.ILocalSiteManager.providedBy(base)
+                ):
+                base.removeSub(self)
+
+        for base in bases:
+            if ((base not in self.__bases__)
+                and interfaces.ILocalSiteManager.providedBy(base)
+                ):
+                base.addSub(self)
+
+        super(LocalSiteManager, self)._setBases(bases)
+
     def __init__(self, site):
         # Locate the site manager
         self.__parent__ = site
         self.__name__ = '++etc++site'
 
-        # Make sure everything is setup correctly
         BTreeContainer.__init__(self)
-
-        # Set up adapter registries
-        gsm = zapi.getGlobalSiteManager()
-        self.adapters = adapter.LocalAdapterRegistry(gsm.adapters)
-        self.utilities = LocalUtilityRegistry(gsm.utilities)
-
-        # Setup located registry attributes
+        zope.component.persistentregistry.PersistentComponents.__init__(self)
+        
         next = _findNextSiteManager(site)
-        self.setNext(next)
+        if next is None:
+            next = zapi.getGlobalSiteManager()
+        self.__bases__ = (next, )
 
         # Setup default site management folder
         folder = SiteManagementFolder()
         zope.event.notify(objectevent.ObjectCreatedEvent(folder))
         self['default'] = folder
 
+    def _init_registries(self):
+        self.adapters = _LocalAdapterRegistry()
+        self.utilities = _LocalAdapterRegistry()
 
     def addSub(self, sub):
         """See interfaces.registration.ILocatedRegistry"""
@@ -193,19 +203,9 @@
         self.subs = tuple(
             [s for s in self.subs if s is not sub] )
 
+    @zope.deprecation.deprecate("Will go away in Zope 3.5")
     def setNext(self, next, base=None):
-        """See interfaces.registration.ILocatedRegistry"""
-        if self.next is not None:
-            self.next.removeSub(self)
-        if next is not None:
-            next.addSub(self)
-        self.next = next
-        if next is not None:
-            self.adapters.setNext(next.adapters)
-            self.utilities.setNext(next.utilities)
-        else:
-            self.adapters.setNext(None)
-            self.utilities.setNext(None)
+        self.__bases__ = tuple([b for b in (next, base) if b is not None])
 
     def __getRegistry(self, registration):
         """Determine the correct registry for the registration."""
@@ -218,87 +218,140 @@
                          "provide `IAdapterRegistration` or "
                          "`IUtilityRegistration`.")
 
+    @zope.deprecation.deprecate(
+        "Local registration is now much simpler.  The old baroque APIs "
+        "will go away in Zope 3.5.  See the new component-registration APIs "
+        "defined in zope.component, especially IComponentRegistry.",
+        )
     def register(self, registration):
-        """See zope.app.component.interfaces.registration.IRegistry"""
-        registry = self.__getRegistry(registration)
-        registry.register(registration)
+        if interfaces.IUtilityRegistration.providedBy(registration):
+            self.registerUtility(
+                registration.component,
+                registration.provided,
+                registration.name,
+                )
+        elif interfaces.IAdapterRegistration.providedBy(registration):
+            self.registerAdapter(
+                registration.component,
+                (registration.required, ) + registration.with,
+                registration.provided,
+                registration.name,
+                )
 
+    @zope.deprecation.deprecate(
+        "Local registration is now much simpler.  The old baroque APIs "
+        "will go away in Zope 3.5.  See the new component-registration APIs "
+        "defined in zope.component, especially IComponentRegistry.",
+        )
     def unregister(self, registration):
-        """See zope.app.component.interfaces.registration.IRegistry"""
-        registry = self.__getRegistry(registration)
-        registry.unregister(registration)
+        if interfaces.IUtilityRegistration.providedBy(registration):
+            self.unregisterUtility(
+                registration.component,
+                registration.provided,
+                registration.name,
+                )
+        elif interfaces.IAdapterRegistration.providedBy(registration):
+            self.unregisterAdapter(
+                registration.component,
+                (registration.required, ) + registration.with,
+                registration.provided,
+                registration.name,
+                )
 
+    @zope.deprecation.deprecate(
+        "Local registration is now much simpler.  The old baroque APIs "
+        "will go away in Zope 3.5.  See the new component-registration APIs "
+        "defined in zope.component, especially IComponentRegistry.",
+        )
     def registered(self, registration):
-        """See zope.app.component.interfaces.registration.IRegistry"""
-        return self.adapters.registered(registration) or \
-               self.utilities.registered(registration)
+        if zope.component.interfaces.IUtilityRegistration.providedBy(
+            registration):
+            return bool([
+                r for r in self.registeredUtilities()
+                if (
+                   r.component == registration.component
+                   and
+                   r.provided == registration.provided
+                   and
+                   r.name == registration.name
+                )
+                ])
+        elif zope.component.interfaces.IAdapterRegistration.providedBy(
+            registration):
+            return bool([
+                r for r in self.registeredAdapters()
+                if (
+                   r.factory == registration.component
+                   and
+                   r.provided == registration.provided
+                   and
+                   r.name == registration.name
+                   and
+                   r.required == ((registration.required, )
+                                  + registration.with)
+                )
+                ])
+        elif (
+         zope.component.interfaces.ISubscriptionAdapterRegistration.providedBy(
+            registration)):
+            return bool([
+                r for r in self.registeredSubscriptionAdapters()
+                if (
+                   r.factory == registration.component
+                   and
+                   r.provided == registration.provided
+                   and
+                   r.name == registration.name
+                   and
+                   r.required == ((registration.required, )
+                                  + registration.with)
+                )
+                ])
+        elif zope.component.interfaces.IHandlerRegistration.providedBy(
+            registration):
+            return bool([
+                r for r in self.registeredHandlers()
+                if (
+                   r.factory == registration.component
+                   and
+                   r.provided == registration.provided
+                   and
+                   r.name == registration.name
+                   and
+                   r.required == ((registration.required, )
+                                  + registration.with)
+                )
+                ])
+        return False
 
     def registrations(self):
         """See zope.component.interfaces.IRegistry"""
-        for reg in self.adapters.registrations():
-            yield reg
-        for reg in self.utilities.registrations():
-            yield reg
+        for r in self.registeredUtilities():
+            yield r
+        for r in self.registeredAdapters():
+            yield r
+        for r in self.registeredHandlers():
+            yield r
+        for r in self.registeredSubscriptionAdapters():
+            yield r
 
 
-class AdapterRegistration(registration.ComponentRegistration):
-    """Adapter component registration for persistent components
+## zope.deferredimport.deprecatedFrom(
+##     "Local registration is now much simpler.  The old baroque APIs "
+##     "will go away in Zope 3.5.  See the new component-registration APIs "
+##     "defined in zope.component, especially IComponentRegistry.",
+##     'zope.app.component.back35',
+##     'AdapterRegistration',
+##     )
 
-    This registration configures persistent components in packages to
-    be adapters.
-    """
-    zope.interface.implements(interfaces.IAdapterRegistration)
+zope.deferredimport.deprecatedFrom(
+    "Local registration is now much simpler.  The old baroque APIs "
+    "will go away in Zope 3.5.  See the new component-registration APIs "
+    "defined in zope.component, especially IComponentRegistry.",
+    'zope.app.component.back35',
+    'LocalAdapterRegistry', 'LocalUtilityRegistry', 'UtilityRegistration',
+    )
 
-    def __init__(self, required, provided, factoryName,
-                 name='', permission=None):
-        if not isinstance(required, (tuple, list)):
-            self.required = required
-            self.with = ()
-        else:
-            self.required = required[0]
-            self.with = tuple(required[1:])
-        self.provided = provided
-        self.name = name
-        self.factoryName = factoryName
-        self.permission = permission
-
-    def component(self):
-# Didn't work ... tests failed
-##         # Import here, so that we only have a soft dependence on
-##         # zope.app.module
-##         from zope.app.module import resolve
-        factory = resolve(self.factoryName, self)
-        return factory
-    component = property(component)
-
-    def getRegistry(self):
-        return zapi.getSiteManager(self)
-
-
-class UtilityRegistration(bbb.site.BBBUtilityRegistration,
-                          registration.ComponentRegistration):
-    """Utility component registration for persistent components
-
-    This registration configures persistent components in packages to
-    be utilities.
-    """
-    zope.interface.implements(interfaces.IUtilityRegistration)
-
-    ############################################################
-    # Make the adapter code happy.
-    required = zope.interface.adapter.Null
-    with = ()
-    ############################################################
-
-    def __init__(self, name, provided, component, permission=None):
-        super(UtilityRegistration, self).__init__(component, permission)
-        self.name = name
-        self.provided = provided
-
-    def getRegistry(self):
-        return zapi.getSiteManager(self)
-
-
 def threadSiteSubscriber(ob, event):
     """A subscriber to BeforeTraverseEvent
 
@@ -321,7 +374,7 @@
 
 
 def SiteManagerAdapter(ob):
-    """An adapter from ILocation to ISiteManager.
+    """An adapter from ILocation to IComponentLookup.
 
     The ILocation is interpreted flexibly, we just check for
     ``__parent__``.

Modified: Zope3/branches/jim-adapter/src/zope/app/component/site.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/site.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/site.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -64,7 +64,7 @@
    >>> myfolder2.setSiteManager(object)
    Traceback (most recent call last):
    ...
-   ValueError: setSiteManager requires an ISiteManager
+   ValueError: setSiteManager requires an IComponentLookup
 
 Also, if the possible site has been changed to a site already, a `TypeError`
 is raised, when one attempts to add a new site manager:
@@ -79,12 +79,12 @@
 
   >>> myfolder['mysubfolder'] = folder.Folder()
   >>> import zope.component
-  >>> zope.component.interfaces.ISiteManager(myfolder['mysubfolder']) is sm
+  >>> zope.component.interfaces.IComponentLookup(myfolder['mysubfolder']) is sm
   True
 
 If the location passed is a site, the site manager of that site is returned:
 
-  >>> zope.component.interfaces.ISiteManager(myfolder) is sm
+  >>> zope.component.interfaces.IComponentLookup(myfolder) is sm
   True
 
 During traversal, 
@@ -177,7 +177,7 @@
   MyUtility('Global Utility')
 
 Next let's see whether we can also successfully register an adapter as
-well. Here the adpater will provide the size of a file:
+well. Here the adapter will provide the size of a file:
 
   >>> class IFile(zope.interface.Interface):
   ...     pass
@@ -193,20 +193,10 @@
   ...     def __init__(self, context):
   ...         self.context = context
 
-We place the adapter in a particular module, so that adapter registration will
-be able to look it up by name.
+Now that we have the adapter we need to register it:
 
-  >>> import sys
-  >>> sys.modules['zope.app.component.tests'].FileSize = FileSize
+  >>> sm.registerAdapter(FileSize, [IFile])
 
-Now that we the adapter we need to register it:
-
-  >>> areg = site.AdapterRegistration(IFile, ISized, 
-  ...                                 'zope.app.component.tests.FileSize')
-  >>> default.registrationManager.addRegistration(areg)
-  'AdapterRegistration'
-  >>> areg.status = interfaces.registration.ActiveStatus
-
 Finally, we can get the adapter for a file:
 
   >>> file = File()
@@ -343,6 +333,7 @@
 
   # Make sure that our interfaces and classes are picklable.
 
+  >>> import sys
   >>> sys.modules['zope.app.component.tests'].IMyUtility = IMyUtility
   >>> IMyUtility.__module__ = 'zope.app.component.tests'
   >>> sys.modules['zope.app.component.tests'].MyUtility = MyUtility

Deleted: Zope3/branches/jim-adapter/src/zope/app/component/statusproperty.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/statusproperty.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/statusproperty.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,124 +0,0 @@
-============================
-Registration Status Property
-============================
-
-The registratio status property is a descriptor used to implement the
-`IRegistration`' interface's `status` property.
-
-The property accepts two possible values: `ActiveStatus` and
-`InactiveStatus`. When the registration is active, then the registration is
-also activated in the registry.
-
-  >>> from zope.app.component.interfaces.registration import ActiveStatus
-  >>> from zope.app.component.interfaces.registration import InactiveStatus
-
-When setting the `status` property to `ActiveStatus`, then the registration
-should be added to the nearest matching registry. Here, the registration's
-`getRegistry()` method is used to determine the registry. On the same token,
-if the value is set to `InactiveStatus` the registration should be removed
-from the registry.
-
-To demonstrate this functionality, we first have to create a stub registry
-
-  >>> class Registry(object):
-  ...     registrations = []
-  ...     def register(self, registration):
-  ...         self.registrations.append(registration)
-  ...
-  ...     def unregister(self, registration):
-  ...         del self.registrations[self.registrations.index(registration)]
-  ...
-  ...     def registered(self, registration):
-  ...         return registration in self.registrations
-  
-  >>> registry = Registry()
-
-and a simple registration object
-
-  >>> from zope.app.component.registration import RegistrationStatusProperty
-  >>> class Registration(object):
-  ...     status = RegistrationStatusProperty()
-  ...
-  ...     def __init__(self, registry):
-  ...         self.registry = registry
-  ...
-  ...     def getRegistry(self):
-  ...         return self.registry
-
-Note that here only the `getRegistry()` is part of the registration API.
-
-Now that we have a registry and a registration class, let's create a
-registration:
-
-  >>> reg = Registration(registry)
-
-At the beginning the registration is inactive:
-
-  >>> reg.status
-  u'Inactive'
-  >>> reg.status is InactiveStatus
-  True
-  >>> reg in registry.registrations
-  False
-
-Once we activate the registration, it appears in the registry:
-
-  >>> reg.status = ActiveStatus
-  >>> reg.status
-  u'Active'
-  >>> reg.status is ActiveStatus
-  True
-  >>> reg in registry.registrations
-  True
-
-Now, once we deactivate the registration, it is not available in the registry
-anymore:
-
-  >>> reg.status = InactiveStatus
-  >>> reg.status
-  u'Inactive'
-  >>> reg.status is InactiveStatus
-  True
-  >>> reg in registry.registrations
-  False
-
-
-Registration Events
--------------------
-
-When a registration is activated or deactivated, an
-`RegistrationActivatedEvent` or `RegistrationDeactivatedEvent` is created,
-respectively. Listening to these events can be useful for cases where you want
-to change the component based on registration status.
-
-To catch the events, we have to register a subscriber with the event
-framework:
-
-  >>> events = []
-  >>> def subscriber(event):
-  ...     global events
-  ...     events.append(event)
-
-  >>> import zope.event
-  >>> zope.event.subscribers.append(subscriber)
-
-Now we switch our registration to active:
-
-  >>> reg.status = ActiveStatus
-  >>> event = events.pop()
-  >>> event.__class__
-  <class 'zope.app.component.registration.RegistrationActivatedEvent'>
-  >>> event.object is reg
-  True
-
-and deactivate it again:
-
-  >>> reg.status = InactiveStatus
-  >>> events.pop().__class__
-  <class 'zope.app.component.registration.RegistrationDeactivatedEvent'>
-  >>> event.object is reg
-  True
-
-Now make sure that we remove the subscriber again:
-
-  >>> del zope.event.subscribers[zope.event.subscribers.index(subscriber)]

Modified: Zope3/branches/jim-adapter/src/zope/app/component/testing.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/testing.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/testing.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -16,8 +16,8 @@
 $Id$
 """
 import zope.interface
-from zope.component import site
-from zope.component.interfaces import ISiteManager
+from zope.component.interfaces import IComponentLookup
+from zope.app.component.interfaces import ILocalSiteManager
 from zope.app import zapi
 from zope.app.testing import setup
 from zope.app.testing.placelesssetup import PlacelessSetup
@@ -96,15 +96,15 @@
 
 
 class SiteManagerStub(object):
-    zope.interface.implements(ISiteManager)
+    zope.interface.implements(ILocalSiteManager)
     
-    next = None
+    __bases__ = ()
 
     def __init__(self):
         self._utils = {}
 
     def setNext(self, next):
-        self.next = next
+        self.__bases__ = (next, )
 
     def provideUtility(self, iface, util, name=''):
         self._utils[(iface, name)] = util
@@ -177,7 +177,7 @@
 
     sitemanager.provideUtility(interface, utility, name)
     utility.__conform__ = \
-       lambda iface: iface.isOrExtends(ISiteManager) and sitemanager or None
+       lambda iface: iface.isOrExtends(IComponentLookup) and sitemanager or None
     nextsitemanager.provideUtility(interface, nextutility, name)
     nextutility.__conform__ = \
-       lambda iface: iface.isOrExtends(ISiteManager) and nextsitemanager or None
+       lambda iface: iface.isOrExtends(IComponentLookup) and nextsitemanager or None

Copied: Zope3/branches/jim-adapter/src/zope/app/component/tests/deprecated35_registration.txt (from rev 66386, Zope3/branches/jim-adapter/src/zope/app/component/tests/deprecated35_registration.txt)

Copied: Zope3/branches/jim-adapter/src/zope/app/component/tests/deprecated35_statusproperty.txt (from rev 66386, Zope3/branches/jim-adapter/src/zope/app/component/tests/deprecated35_statusproperty.txt)

Deleted: Zope3/branches/jim-adapter/src/zope/app/component/tests/test_adapter.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/tests/test_adapter.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/tests/test_adapter.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,712 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2004 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Registration Tests
-
-$Id$
-"""
-__docformat__ = "reStructuredText"
-import unittest
-import transaction
-from ZODB.tests.util import DB
-
-import zope.component.testing as placelesssetup
-import zope.interface
-from zope.interface.adapter import AdapterRegistry
-from zope.testing import doctest
-
-from zope.app.component import interfaces
-from zope.app.component.adapter import LocalAdapterRegistry, AdapterRegistration
-from zope.app.testing import setup
-
-class IF0(zope.interface.Interface):
-    pass
-
-class IF1(IF0):
-    pass
-
-class IF2(IF1):
-    pass
-
-class IB0(zope.interface.Interface):
-    pass
-
-class IB1(IB0):
-    pass
-
-class IR0(zope.interface.Interface):
-    pass
-
-class IR1(IR0):
-    pass
-
-class R1(object):
-    zope.interface.implements(IR1)
-
-class F0(object):
-    zope.interface.implements(IF0)
-
-class F2(object):
-    zope.interface.implements(IF2)
-
-# Create a picklable global registry. The pickleability of other
-# global adapter registries is beyond the scope of these tests:
-class GlobalAdapterRegistry(AdapterRegistry):
-    def __reduce__(self):
-        return 'globalAdapterRegistry'
-
-globalAdapterRegistry = GlobalAdapterRegistry()
-
-def test_local_adapter():
-    """Local Adapter Tests
-
-   Local surrogates and adapter registries share declarations with
-   those "above" them.
-
-   Suppose we have a global AdapterRegistry:
-
-   >>> G = AdapterRegistry()
-
-   we also have a local adapter registry, with G as it's base:
-
-   >>> L1 = LocalAdapterRegistry(G)
-
-   and so on:
-
-   >>> L2 = LocalAdapterRegistry(G, L1)
-
-   Now, if we declare an adapter globally:
-
-   >>> G.register([IF1], IB1, '', 'A11G')
-
-   we can query it locally:
-
-   >>> L1.lookup([IF2], IB1)
-   'A11G'
-   
-   >>> L2.lookup([IF2], IB1)
-   'A11G'
-
-   We can add local definitions:
-
-   >>> ra011 = AdapterRegistration(required=IF0, provided=IB1, factory='A011',
-   ...                             registry=L1)
-   >>> ra011.status = interfaces.registration.ActiveStatus
-
-   and use it:
-
-   >>> L1.lookup([IF0], IB1)
-   'A011'
-   
-   >>> L2.lookup([IF0], IB1)
-   'A011'
-   
-   but not outside L1:
-
-   >>> G.lookup([IF0], IB1)
-
-   Note that it doesn't override the non-local adapter:
-
-   >>> L1.lookup([IF2], IB1)
-   'A11G'
-   
-   >>> L2.lookup([IF2], IB1)
-   'A11G'
-   
-   because it was more specific.
-
-   Let's override the adapter in L2:
-
-   >>> ra112 = AdapterRegistration(required=IF1, provided=IB1, factory='A112',
-   ...                             registry=L2)
-   >>> ra112.status = interfaces.registration.ActiveStatus
-
-   Now, in L2, we get the new adapter, because it's as specific and more
-   local than the one from G:
-
-   >>> L2.lookup([IF2], IB1)
-   'A112'
-   
-   But we still get the old one in L1
-
-   >>> L1.lookup([IF2], IB1)
-   'A11G'
-   
-   Note that we can ask for less specific interfaces and still get the adapter:
-
-   >>> L2.lookup([IF2], IB0)
-   'A112'
-
-   >>> L1.lookup([IF2], IB0)
-   'A11G'
-
-   We get the more specific adapter even if there is a less-specific
-   adapter to B0:
-
-   >>> G.register([IF1], IB1, '', 'A10G')
-
-   >>> L2.lookup([IF2], IB0)
-   'A112'
-
-   But if we have an equally specific and equally local adapter to B0, it
-   will win:
-
-   >>> ra102 = AdapterRegistration(required=IF1, provided=IB0, factory='A102',
-   ...                             registry=L2)
-   >>> ra102.status = interfaces.registration.ActiveStatus
-
-   >>> L2.lookup([IF2], IB0)
-   'A102'
-
-   We can deactivate registrations, which has the effect of deleting adapters:
-
-
-   >>> ra112.status = interfaces.registration.InactiveStatus
-
-   >>> L2.lookup([IF2], IB0)
-   'A102'
-
-   >>> L2.lookup([IF2], IB1)
-   'A10G'
-
-   >>> ra102.status = interfaces.registration.InactiveStatus
-
-   >>> L2.lookup([IF2], IB0)
-   'A10G'
-
-   We can ask for all of the registrations :
-
-   >>> L1.registrations() #doctest: +NORMALIZE_WHITESPACE
-   (<AdapterRegistration:
-        required=<InterfaceClass zope.app.component.tests.test_adapter.IF0>,
-        with=(),
-        provided=<InterfaceClass zope.app.component.tests.test_adapter.IB1>,
-        name='',
-        component='A011',
-        permission=None>,)
-
-   This shows only the local registrations in L1.
-   """
-
-def test_named_adapters():
-    """
-    Suppose we have a global AdapterRegistry:
-
-    >>> G = AdapterRegistry()
-
-    we also have a local adapter registry, with G as it's base:
-
-    >>> L1 = LocalAdapterRegistry(G)
-
-    and so on:
-
-    >>> L2 = LocalAdapterRegistry(G, L1)
-
-    Now, if we declare an adapter globally:
-
-    >>> G.register([IF1], IB1, 'bob', 'A11G')
-
-    we can query it locally:
-
-    >>> L1.lookup([IF2], IB1)
-    >>> L1.lookup([IF2], IB1, 'bob')
-    'A11G'
-
-    >>> L2.lookup([IF2], IB1)
-    >>> L2.lookup([IF2], IB1, 'bob')
-    'A11G'
-
-    We can add local definitions:
-
-    >>> ra011 = AdapterRegistration(required = IF0, provided=IB1,
-    ...                             factory='A011', name='bob',
-    ...                             registry=L1)
-    >>> ra011.status = interfaces.registration.ActiveStatus
-
-    and use it:
-
-    >>> L1.lookup([IF0], IB1)
-    >>> L1.lookup([IF0], IB1, 'bob')
-    'A011'
-
-    >>> L2.lookup([IF0], IB1)
-    >>> L2.lookup([IF0], IB1, 'bob')
-    'A011'
-
-    but not outside L1:
-
-    >>> G.lookup([IF0], IB1, 'bob')
-
-    Note that it doesn't override the non-local adapter:
-
-    >>> L1.lookup([IF2], IB1)
-    >>> L1.lookup([IF2], IB1, 'bob')
-    'A11G'
-
-    >>> L2.lookup([IF2], IB1)
-    >>> L2.lookup([IF2], IB1, 'bob')
-    'A11G'
-
-    because it was more specific.
-
-    Let's override the adapter in L2:
-
-    >>> ra112 = AdapterRegistration(required=IF1, provided=IB1,
-    ...                             factory='A112', name='bob',
-    ...                             registry=L2)
-    >>> ra112.status = interfaces.registration.ActiveStatus
-
-    Now, in L2, we get the new adapter, because it's as specific and more
-    local than the one from G:
-
-    >>> L2.lookup([IF2], IB1)
-    >>> L2.lookup([IF2], IB1, 'bob')
-    'A112'
-
-    But we still get thye old one in L1
-
-    >>> L1.lookup([IF2], IB1)
-    >>> L1.lookup([IF2], IB1, 'bob')
-    'A11G'
-
-    Note that we can ask for less specific interfaces and still get the adapter:
-
-    >>> L2.lookup([IF2], IB0)
-    >>> L2.lookup([IF2], IB0, 'bob')
-    'A112'
-
-    >>> L1.lookup([IF2], IB0)
-    >>> L1.lookup([IF2], IB0, 'bob')
-    'A11G'
-
-    We get the more specific adapter even if there is a less-specific
-    adapter to B0:
-
-    >>> G.register([IF1], IB1, 'bob', 'A10G')
-
-    >>> L2.lookup([IF2], IB0)
-    >>> L2.lookup([IF2], IB0, 'bob')
-    'A112'
-
-    But if we have an equally specific and equally local adapter to B0, it
-    will win:
-
-    >>> ra102 = AdapterRegistration(required = IF1, provided=IB0,
-    ...                             factory='A102', name='bob',
-    ...                             registry=L2)
-    >>> ra102.status = interfaces.registration.ActiveStatus
-    
-    >>> L2.lookup([IF2], IB0)
-    >>> L2.lookup([IF2], IB0, 'bob')
-    'A102'
-
-    We can deactivate registrations, which has the effect of deleting adapters:
-
-
-    >>> ra112.status = interfaces.registration.InactiveStatus
-
-    >>> L2.lookup([IF2], IB0)
-    >>> L2.lookup([IF2], IB0, 'bob')
-    'A102'
-
-    >>> L2.lookup([IF2], IB1)
-    >>> L2.lookup([IF2], IB1, 'bob')
-    'A10G'
-
-    >>> ra102.status = interfaces.registration.InactiveStatus
-
-    >>> L2.lookup([IF2], IB0)
-    >>> L2.lookup([IF2], IB0, 'bob')
-    'A10G'
-    """
-
-def test_multi_adapters():
-    """
-    Suppose we have a global AdapterRegistry:
-
-    >>> G = AdapterRegistry()
-
-    we also have a local adapter registry, with G as it's base:
-
-    >>> L1 = LocalAdapterRegistry(G)
-
-    and so on:
-
-    >>> L2 = LocalAdapterRegistry(G, L1)
-
-    Now, if we declare an adapter globally:
-
-    >>> G.register([IF1, IR0], IB1, 'bob', 'A11G')
-
-    we can query it locally:
-
-    >>> L1.lookup([IF2, IR1], IB1, 'bob')
-    'A11G'
-
-    >>> L2.lookup([IF2, IR1], IB1, 'bob')
-    'A11G'
-
-    We can add local definitions:
-
-    >>> ra011 = AdapterRegistration(required=(IF0, IR0), provided=IB1,
-    ...                             factory='A011', name='bob',
-    ...                             registry=L1)
-    >>> ra011.status = interfaces.registration.ActiveStatus
-    
-    and use it:
-
-    >>> L1.lookup([IF0, IR1], IB1, 'bob')
-    'A011'
-
-    >>> L2.lookup([IF0, IR1], IB1, 'bob')
-    'A011'
-
-    but not outside L1:
-
-    >>> G.lookup((IF0, IR1), IB1, 'bob')
-
-    Note that it doesn't override the non-local adapter:
-
-    >>> L1.lookup([IF2, IR1], IB1, 'bob')
-    'A11G'
-
-    >>> L2.lookup((IF2, IR1), IB1, 'bob')
-    'A11G'
-
-    because it was more specific.
-
-    Let's override the adapter in L2:
-
-    >>> ra112 = AdapterRegistration(required=(IF1, IR0), provided=IB1,
-    ...                             factory='A112', name='bob',
-    ...                             registry=L2)
-    >>> ra112.status = interfaces.registration.ActiveStatus
-
-    Now, in L2, we get the new adapter, because it's as specific and more
-    local than the one from G:
-
-    >>> L2.lookup((IF2, IR1), IB1, 'bob')
-    'A112'
-
-    But we still get the old one in L1
-
-    >>> L1.lookup((IF2, IR1), IB1, 'bob')
-    'A11G'
-
-    Note that we can ask for less specific interfaces and still get
-    the adapter:
-
-    >>> L2.lookup((IF2, IR1), IB0, 'bob')
-    'A112'
-
-    >>> L1.lookup((IF2, IR1), IB0, 'bob')
-    'A11G'
-
-    We get the more specific adapter even if there is a less-specific
-    adapter to B0:
-
-    >>> G.register([IF1, IR0], IB1, 'bob', 'A10G')
-
-    >>> L2.lookup((IF2, IR1), IB0, 'bob')
-    'A112'
-
-    But if we have an equally specific and equally local adapter to B0, it
-    will win:
-
-    >>> ra102 = AdapterRegistration(required=(IF1, IR0), provided=IB0,
-    ...                             factory='A102', name='bob',
-    ...                             registry=L2)
-    >>> ra102.status = interfaces.registration.ActiveStatus
-    
-    >>> L2.lookup((IF2, IR1), IB0, 'bob')
-    'A102'
-
-    We can deactivate registrations, which has the effect of deleting adapters:
-
-    >>> ra112.status = interfaces.registration.InactiveStatus
-
-    >>> L2.lookup((IF2, IR1), IB0, 'bob')
-    'A102'
-
-    >>> L2.lookup((IF2, IR1), IB1, 'bob')
-    'A10G'
-
-    >>> ra102.status = interfaces.registration.InactiveStatus
-
-    >>> L2.lookup([IF2], IB0)
-    >>> L2.lookup((IF2, IR1), IB0, 'bob')
-    'A10G'
-    """
-
-def test_persistence():
-    """
-    >>> db = DB()
-    >>> conn1 = db.open()
-
-    >>> G = globalAdapterRegistry
-    >>> L1 = LocalAdapterRegistry(G)
-    >>> L2 = LocalAdapterRegistry(G, L1)
-
-    >>> conn1.root()['L1'] = L1
-    >>> conn1.root()['L2'] = L2
-    
-    >>> G.register([IF1], IB1, 'bob', 'A11G')
-    >>> L1.lookup([IF2], IB1)
-    >>> L1.lookup([IF2], IB1, 'bob')
-    'A11G'
-
-    >>> L2.lookup([IF2], IB1)
-    >>> L2.lookup([IF2], IB1, 'bob')
-    'A11G'
-
-    We can add local definitions:
-
-    >>> ra011 = AdapterRegistration(required=IF0, provided=IB1,
-    ...                             factory='A011', name='bob',
-    ...                             registry=L1)
-    >>> ra011.status = interfaces.registration.ActiveStatus
-
-    and use it:
-
-    >>> L1.lookup([IF0], IB1)
-    >>> L1.lookup([IF0], IB1, 'bob')
-    'A011'
-
-    >>> L2.lookup([IF0], IB1)
-    >>> L2.lookup([IF0], IB1, 'bob')
-    'A011'
-
-    but not outside L1:
-
-    >>> G.lookup([IF0], IB1)
-
-    Note that it doesn't override the non-local adapter:
-
-    >>> L1.lookup([IF2], IB1)
-    >>> L1.lookup([IF2], IB1, 'bob')
-    'A11G'
-
-    >>> L2.lookup([IF2], IB1)
-    >>> L2.lookup([IF2], IB1, 'bob')
-    'A11G'
-
-    because it was more specific.
-
-    Let's override the adapter in L2:
-
-    >>> ra112 = AdapterRegistration(required=IF1, provided=IB1,
-    ...                             factory='A112', name='bob',
-    ...                             registry=L2)
-    >>> ra112.status = interfaces.registration.ActiveStatus
-
-    Now, in L2, we get the new adapter, because it's as specific and more
-    local than the one from G:
-
-    >>> L2.lookup([IF2], IB1)
-    >>> L2.lookup([IF2], IB1, 'bob')
-    'A112'
-
-    But we still get the old one in L1
-
-    >>> L1.lookup([IF2], IB1)
-    >>> L1.lookup([IF2], IB1, 'bob')
-    'A11G'
-
-    Note that we can ask for less specific interfaces and still get
-    the adapter:
-
-    >>> L2.lookup([IF2], IB0)
-    >>> L2.lookup([IF2], IB0, 'bob')
-    'A112'
-
-    >>> L1.lookup([IF2], IB0)
-    >>> L1.lookup([IF2], IB0, 'bob')
-    'A11G'
-
-    We get the more specific adapter even if there is a less-specific
-    adapter to B0:
-
-    >>> G.register([IF0], IB0, 'bob', 'A00G')
-
-    >>> L2.lookup([IF2], IB0)
-    >>> L2.lookup([IF2], IB0, 'bob')
-    'A112'
-
-    But if we have an equally specific and equally local adapter to B0, it
-    will win:
-
-    >>> ra102 = AdapterRegistration(required=IF1, provided=IB0,
-    ...                             factory='A102', name='bob',
-    ...                             registry=L2)
-    >>> ra102.status = interfaces.registration.ActiveStatus
-
-    >>> L2.lookup([IF2], IB0)
-    >>> L2.lookup([IF2], IB0, 'bob')
-    'A102'
-
-    >>> L1.lookup([IF2], IB0, 'bob')
-    'A11G'
-    >>> L1.lookup([IF2], IB1, 'bob')
-    'A11G'
-    >>> L2.lookup([IF2], IB0, 'bob')
-    'A102'
-    >>> L2.lookup([IF2], IB1, 'bob')
-    'A112'
-
-    >>> transaction.commit()
-
-    Now, let's open another transaction:
-
-    >>> conn2 = db.open()
-
-    >>> L1 = conn2.root()['L1']
-    >>> L2 = conn2.root()['L2']
-    >>> ra112 = L2._registrations[0]
-    >>> ra102 = L2._registrations[1]
-
-    We should get the same outputs:
-
-    >>> L1.lookup([IF2], IB0, 'bob')
-    'A11G'
-    >>> L1.lookup([IF2], IB1, 'bob')
-    'A11G'
-    >>> L2.lookup([IF2], IB0, 'bob')
-    'A102'
-    >>> L2.lookup([IF2], IB1, 'bob')
-    'A112'
-    
-    We can deactivate registrations, which has the effect of deleting
-    adapters:
-
-    >>> ra112.status = interfaces.registration.InactiveStatus
-    >>> ra102.status = interfaces.registration.InactiveStatus
-
-    >>> L1.lookup([IF2], IB0, 'bob')
-    'A11G'
-    >>> L1.lookup([IF2], IB1, 'bob')
-    'A11G'
-    >>> L2.lookup([IF2], IB0, 'bob')
-    'A11G'
-    >>> L2.lookup([IF2], IB1, 'bob')
-    'A11G'
-
-    >>> transaction.commit()
-
-    If we look back at the first connection, we should get the same data:
-
-    >>> conn1.sync()
-    >>> L1 = conn1.root()['L1']
-    >>> L2 = conn1.root()['L2']
-
-    We should see the result of the deactivations:
-    
-    >>> L1.lookup([IF2], IB0, 'bob')
-    'A11G'
-    >>> L1.lookup([IF2], IB1, 'bob')
-    'A11G'
-    >>> L2.lookup([IF2], IB0, 'bob')
-    'A11G'
-    >>> L2.lookup([IF2], IB1, 'bob')
-    'A11G'
-
-    Cleanup:
-    >>> G.__init__()
-    >>> db.close()
-    """
-
-
-def test_local_default():
-    """
-    >>> G = AdapterRegistry()
-    >>> L1 = LocalAdapterRegistry(G)
-
-    >>> r = AdapterRegistration(required=None, provided=IB1,
-    ...                         factory='Adapter', registry=L1)
-    >>> r.status = interfaces.registration.ActiveStatus
-    >>> L1.lookup([IF2], IB1)
-    'Adapter'
-    """
-
-
-def test_changing_next():
-    """
-    >>> G = AdapterRegistry()
-    >>> L1 = LocalAdapterRegistry(G)
-    >>> L2 = LocalAdapterRegistry(G, L1)
-    >>> f2 = F2()
-
-    >>> L2.lookup([IF2], IB1)
-
-    >>> G.register([IF1], IB1, '', 'A11G')
-    >>> L2.lookup([IF2], IB1)
-    'A11G'
-
-
-    >>> ra111 = AdapterRegistration(required=IF1, provided=IB1,
-    ...                             factory='A111', registry=L1)
-    >>> ra111.status = interfaces.registration.ActiveStatus
-    >>> L2.lookup([IF2], IB1)
-    'A111'
-
-    >>> L1.next
-    >>> L2.next == L1
-    True
-    >>> L1.subs == (L2,)
-    True
-    >>> L3 = LocalAdapterRegistry(G, L1)
-    >>> L2.setNext(L3)
-    >>> L2.next == L3
-    True
-    >>> L3.next == L1
-    True
-    >>> L1.subs == (L3,)
-    True
-    >>> L3.subs == (L2,)
-    True
-
-    >>> ra113 = AdapterRegistration(required=IF1, provided=IB1,
-    ...                             factory='A113', registry=L3)
-    >>> ra113.status = interfaces.registration.ActiveStatus
-
-    >>> L2.lookup([IF2], IB1)
-    'A113'
-    >>> L2.setNext(L1)
-    >>> L2.next == L1
-    True
-    >>> L3.next == L1
-    True
-    >>> L1.subs == (L3, L2)
-    True
-    >>> L3.subs == ()
-    True
-    >>> L2.lookup([IF2], IB1)
-    'A111'
-
-    """
-
-def setUp(test):
-    placelesssetup.setUp(test)
-    setup.setUpAnnotations()
-    setup.setUpDependable()
-    setup.setUpTraversal()
-
-def test_suite():
-    return unittest.TestSuite((
-        doctest.DocTestSuite(),
-        doctest.DocFileSuite('../adapterregistry.txt',
-                             setUp=setUp, tearDown=placelesssetup.tearDown),
-        ))
-
-if __name__ == "__main__":
-    unittest.main(defaultTest='test_suite')
-    

Modified: Zope3/branches/jim-adapter/src/zope/app/component/tests/test_contentdirective.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/tests/test_contentdirective.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/tests/test_contentdirective.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -23,7 +23,7 @@
 
 from zope.app import zapi
 from zope.component.interfaces import IFactory
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 from zope.configuration.xmlconfig import xmlconfig, XMLConfig
 from zope.app.testing.placelesssetup import PlacelessSetup
 from zope.app.component.interface import queryInterface

Modified: Zope3/branches/jim-adapter/src/zope/app/component/tests/test_directives.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/tests/test_directives.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/tests/test_directives.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -23,10 +23,9 @@
 
 from zope.interface import Interface, implements
 from zope.testing.doctestunit import DocTestSuite
-from zope.component.tests.request import Request
 from zope.component import createObject
 from zope.component.interfaces import IDefaultViewName
-from zope.component.site import SubscriptionRegistration
+from zope.component.registry import SubscriptionRegistration
 
 from zope.configuration.xmlconfig import xmlconfig, XMLConfig
 from zope.configuration.exceptions import ConfigurationError
@@ -38,16 +37,17 @@
 from zope.security.checker import selectChecker
 
 import zope.app.component
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 
 from zope.app import zapi
 from zope.app.testing.placelesssetup import PlacelessSetup
 from zope.app.component.interface import queryInterface
 from zope.app.component.metaconfigure import interface
-from zope.app.component.tests.adapter import A1, A2, A3, I1, I3, IS, Handler
+from zope.app.component.tests.adapter import A1, A2, A3, Handler
+from zope.app.component.tests.adapter import I1, I2, I3, IS
 from zope.app.component.tests.components import IContent, Content, Comp, comp
 from zope.app.component.tests.components import IApp
-from zope.app.component.tests.views import IV, IC, V1, R1, IR
+from zope.app.component.tests.views import Request, IV, IC, V1, R1, IR
 from zope.app.content.interfaces import IContentType
 
 from zope.app.component.tests import module, exampleclass
@@ -148,7 +148,7 @@
             )))
 
         gsm = zapi.getGlobalSiteManager()
-        doc = [reg.doc
+        doc = [reg.info
                for reg in gsm.registrations()
                if (isinstance(reg, SubscriptionRegistration) and
                    reg.provided is IS)][0]
@@ -212,17 +212,11 @@
             '''
             )))
 
-        content = Content()
-        a1 = A1()
-        a2 = A2()
-        subscribers = zapi.subscribers((content, a1, a2), None)
+        sm = zapi.getSiteManager()
+        a3 = sm.adapters.subscriptions((IContent, I1, I2), None)[0]
+        self.assertEqual(a3, A3)
 
-        a3 = subscribers[0]
 
-        self.assertEqual(a3.__class__, A3)
-        self.assertEqual(a3.context, (content, a1, a2))
-
-
     def testTrustedSubscriber(self):
         xmlconfig(StringIO(template % (
             '''

Modified: Zope3/branches/jim-adapter/src/zope/app/component/tests/test_registration.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/tests/test_registration.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/tests/test_registration.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -29,11 +29,13 @@
     setup.setUpTraversal()
 
 def test_suite():
-    return unittest.TestSuite((
-        doctest.DocFileSuite('../statusproperty.txt'),
-        doctest.DocFileSuite('../registration.txt',
+    suite = unittest.TestSuite((
+        doctest.DocFileSuite('deprecated35_statusproperty.txt'),
+        doctest.DocFileSuite('deprecated35_registration.txt',
                              setUp=setUp, tearDown=placelesssetup.tearDown),
         ))
+    suite.level = 2
+    return suite
 
 if __name__ == "__main__":
     unittest.main(defaultTest='test_suite')

Modified: Zope3/branches/jim-adapter/src/zope/app/component/tests/test_site.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/tests/test_site.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/tests/test_site.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -19,6 +19,7 @@
 import unittest
 
 import zope.interface
+import zope.interface.verify
 from zope.testing import doctest
 
 from zope.app.testing import setup

Modified: Zope3/branches/jim-adapter/src/zope/app/component/tests/views.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/component/tests/views.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/component/tests/views.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,8 +15,13 @@
 
 $Id: views.py 26551 2004-07-15 07:06:37Z srichter $
 """
-from zope.interface import Interface, implements
+from zope.interface import Interface, implements, directlyProvides
 
+class Request(object):
+
+    def __init__(self, type):
+        directlyProvides(self, type)
+
 class IR(Interface):
     pass
 

Modified: Zope3/branches/jim-adapter/src/zope/app/configure.zcml
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/configure.zcml	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/configure.zcml	2006-04-04 15:56:58 UTC (rev 66397)
@@ -25,7 +25,7 @@
   <include file="menus.zcml" />
 
   <include package="zope.app.copypastemove" />
-  <include package="zope.app.size" />
+  <include package="zope.size" />
   <include package="zope.app.location" />
   <include package="zope.app.container" />
 

Modified: Zope3/branches/jim-adapter/src/zope/app/container/browser/adding.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/container/browser/adding.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/container/browser/adding.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -27,8 +27,8 @@
 from zope.interface import implements
 from zope.publisher.interfaces import IPublishTraverse
 from zope.security.proxy import removeSecurityProxy
+from zope.exceptions.interfaces import UserError
 
-from zope.app.exception.interfaces import UserError
 from zope.app.container.interfaces import IAdding, INameChooser
 from zope.app.container.interfaces import IContainerNamesContainer
 from zope.app.container.constraints import checkFactory, checkObject

Modified: Zope3/branches/jim-adapter/src/zope/app/container/browser/contents.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/container/browser/contents.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/container/browser/contents.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -19,13 +19,13 @@
 
 import urllib
 
-from zope.app.exception.interfaces import UserError
-from zope.app.traversing.interfaces import TraversalError
+from zope.exceptions.interfaces import UserError
 from zope.security.interfaces import Unauthorized
 from zope.security import canWrite
+from zope.size.interfaces import ISized
 
 from zope.app import zapi
-from zope.app.size.interfaces import ISized
+from zope.app.traversing.interfaces import TraversalError
 from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
 from zope.app.publisher.browser import BrowserView
 from zope.app.i18n import ZopeMessageFactory as _

Modified: Zope3/branches/jim-adapter/src/zope/app/container/browser/tests/test_adding.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/container/browser/tests/test_adding.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/container/browser/tests/test_adding.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -20,12 +20,13 @@
 import zope.interface
 import zope.security.checker
 from zope.component.interfaces import IFactory
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 from zope.interface import implements, Interface, directlyProvides
 from zope.publisher.browser import TestRequest
 from zope.publisher.interfaces.browser import IBrowserRequest
 from zope.security.interfaces import ForbiddenAttribute
 from zope.testing.doctestunit import DocTestSuite
+from zope.exceptions.interfaces import UserError
 
 from zope.app import zapi
 from zope.app.testing import ztapi
@@ -33,7 +34,6 @@
 from zope.app.traversing.browser import AbsoluteURL
 from zope.app.traversing.browser.interfaces import IAbsoluteURL
 from zope.app.traversing.interfaces import IContainmentRoot
-from zope.app.exception.interfaces import UserError
 from zope.app.publisher.browser import BrowserView
 from zope.app.publisher.interfaces.browser import AddMenu
 from zope.app.publisher.interfaces.browser import IMenuItemType, IBrowserMenu

Modified: Zope3/branches/jim-adapter/src/zope/app/container/configure.zcml
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/container/configure.zcml	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/container/configure.zcml	2006-04-04 15:56:58 UTC (rev 66397)
@@ -33,7 +33,7 @@
 
   <adapter
       factory="zope.app.container.size.ContainerSized"
-      provides="zope.app.size.interfaces.ISized"
+      provides="zope.size.interfaces.ISized"
       for="zope.app.container.interfaces.IReadContainer"
       />
 

Modified: Zope3/branches/jim-adapter/src/zope/app/container/contained.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/container/contained.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/container/contained.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,7 +17,7 @@
 """
 __docformat__ = 'restructuredtext'
 
-from zope.exceptions import DuplicationError
+from zope.exceptions.interfaces import DuplicationError, UserError
 from zope.security.checker import selectChecker, CombinedChecker
 
 import zope.interface.declarations
@@ -26,8 +26,7 @@
 from zope.interface import providedBy
 
 from zope.app import zapi
-from zope.app.exception.interfaces import UserError
-from zope.app.event.objectevent import ObjectEvent
+from zope.component.interfaces import ObjectEvent
 from zope.app.event.objectevent import ObjectModifiedEvent
 from zope.event import notify
 from zope.app.i18n import ZopeMessageFactory as _

Modified: Zope3/branches/jim-adapter/src/zope/app/container/interfaces.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/container/interfaces.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/container/interfaces.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -24,7 +24,7 @@
 from zope.interface.common.mapping import IItemMapping
 from zope.interface.common.mapping import IReadMapping, IEnumerableMapping
 from zope.app.location.interfaces import ILocation
-from zope.app.event.interfaces import IObjectEvent
+from zope.component.interfaces import IObjectEvent
 from zope.app.event.interfaces import IObjectModifiedEvent
 
 deprecated('IContentContainer',

Modified: Zope3/branches/jim-adapter/src/zope/app/container/size.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/container/size.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/container/size.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -19,7 +19,7 @@
 __docformat__ = 'restructuredtext'
 
 from zope.app.i18n import ZopeMessageFactory as _
-from zope.app.size.interfaces import ISized
+from zope.size.interfaces import ISized
 from zope.interface import implements
 
 class ContainerSized(object):

Modified: Zope3/branches/jim-adapter/src/zope/app/container/tests/test_size.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/container/tests/test_size.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/container/tests/test_size.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,9 +17,9 @@
 """
 import unittest
 
-from zope.app.size.interfaces import ISized
+from zope.interface import implements
+from zope.size.interfaces import ISized
 from zope.app.container.interfaces import IContainer
-from zope.interface import implements
 
 class DummyContainer(object):
 

Modified: Zope3/branches/jim-adapter/src/zope/app/copypastemove/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/copypastemove/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/copypastemove/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,8 +17,6 @@
 """
 __docformat__ = 'restructuredtext'
 
-import zope.deprecation
-
 from zope.interface import implements, Invalid
 from zope.exceptions import DuplicationError
 from zope.component import adapts
@@ -42,14 +40,9 @@
 from zope.app.copypastemove.interfaces import IPrincipalClipboard
 from zope.app.copypastemove.interfaces import IItemNotFoundError
 
-# BBB (remove in 3.3)
-zope.deprecation.__show__.off()
-from zope.exceptions import NotFoundError
-zope.deprecation.__show__.on()
-
 import warnings # BBB (remove in 3.3)
 
-class ItemNotFoundError(NotFoundError):
+class ItemNotFoundError(LookupError):
     implements(IItemNotFoundError)
 
 class ObjectMover(object):
@@ -688,7 +681,7 @@
 
     Finally, we need to register our handler for copy events:
 
-      >>> from zope.app.tests import ztapi
+      >>> from zope.app.testing import ztapi
       >>> from zope.app.event.interfaces import IObjectCopiedEvent
       >>> ztapi.subscribe([None, IObjectCopiedEvent], None, handler)
 

Deleted: Zope3/branches/jim-adapter/src/zope/app/datetimeutils.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/datetimeutils.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/datetimeutils.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,948 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Commonly used utility functions.
-
-Encapsulation of date/time values
-
-$Id$
-"""
-import math
-import re
-import time as _time # there is a method definition that makes just "time"
-                     # problematic while executing a class definition
-
-from types import StringTypes
-
-try:
-    from time import tzname
-except ImportError:
-    tzname = ('UNKNOWN', 'UNKNOWN')
-
-# These are needed because the various date formats below must
-# be in english per the RFCs. That means we can't use strftime,
-# which is affected by different locale settings.
-weekday_abbr = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
-weekday_full = ['Monday', 'Tuesday', 'Wednesday', 'Thursday',
-                'Friday', 'Saturday', 'Sunday']
-monthname    = [None, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
-                'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
-
-
-def iso8601_date(ts=None):
-    # Return an ISO 8601 formatted date string, required
-    # for certain DAV properties.
-    # '2000-11-10T16:21:09-08:00
-    if ts is None:
-        ts = _time.time()
-    return _time.strftime('%Y-%m-%dT%H:%M:%SZ', _time.gmtime(ts))
-
-def rfc850_date(ts=None):
-    # Return an HTTP-date formatted date string.
-    # 'Friday, 10-Nov-00 16:21:09 GMT'
-    if ts is None:
-        ts = _time.time()
-    year, month, day, hh, mm, ss, wd, y, z = _time.gmtime(ts)
-    return "%s, %02d-%3s-%2s %02d:%02d:%02d GMT" % (
-            weekday_full[wd],
-            day, monthname[month],
-            str(year)[2:],
-            hh, mm, ss)
-
-def rfc1123_date(ts=None):
-    # Return an RFC 1123 format date string, required for
-    # use in HTTP Date headers per the HTTP 1.1 spec.
-    # 'Fri, 10 Nov 2000 16:21:09 GMT'
-    if ts is None:
-        ts = _time.time()
-    year, month, day, hh, mm, ss, wd, y, z = _time.gmtime(ts)
-    return "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (weekday_abbr[wd],
-                                                    day, monthname[month],
-                                                    year,
-                                                    hh, mm, ss)
-
-
-
-from timezones import historical_zone_info as _data
-
-class DateTimeError(Exception): "Date-time error"
-class DateError(DateTimeError): 'Invalid Date Components'
-class TimeError(DateTimeError): 'Invalid Time Components'
-class SyntaxError(DateTimeError): 'Invalid Date-Time String'
-
-# Determine machine epoch
-tm=((0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334),
-    (0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335))
-yr,mo,dy,hr,mn,sc = _time.gmtime(0)[:6]
-i=int(yr-1)
-to_year =int(i*365+i/4-i/100+i/400-693960.0)
-to_month=tm[yr%4==0 and (yr%100!=0 or yr%400==0)][mo]
-EPOCH  =(to_year+to_month+dy+(hr/24.0+mn/1440.0+sc/86400.0))*86400
-jd1901 =2415385L
-
-
-numericTimeZoneMatch=re.compile(r'[+-][0-9][0-9][0-9][0-9]').match #TS
-
-class _timezone:
-    def __init__(self,data):
-        self.name,self.timect,self.typect, \
-        self.ttrans,self.tindex,self.tinfo,self.az=data
-
-    def default_index(self):
-        if self.timect == 0: return 0
-        for i in range(self.typect):
-            if self.tinfo[i][1] == 0: return i
-        return 0
-
-    def index(self, t=None):
-        t = t or _time.time()
-        if self.timect == 0:
-            idx = (0, 0, 0)
-        elif t < self.ttrans[0]:
-            i = self.default_index()
-            idx = (i, ord(self.tindex[0]),i)
-        elif t >= self.ttrans[-1]:
-            if self.timect > 1:
-                idx=(ord(self.tindex[-1]),ord(self.tindex[-1]),
-                     ord(self.tindex[-2]))
-            else:
-                idx=(ord(self.tindex[-1]),ord(self.tindex[-1]),
-                     self.default_index())
-        else:
-            for i in range(self.timect-1):
-                if t < self.ttrans[i+1]:
-                    if i==0: idx=(ord(self.tindex[0]),ord(self.tindex[1]),
-                                  self.default_index())
-                    else:    idx=(ord(self.tindex[i]),ord(self.tindex[i+1]),
-                                  ord(self.tindex[i-1]))
-                    break
-        return idx
-
-    def info(self,t=None):
-        idx=self.index(t)[0]
-        zs =self.az[self.tinfo[idx][2]:]
-        return self.tinfo[idx][0],self.tinfo[idx][1],zs[: zs.find('\000')]
-
-
-
-
-class _cache:
-
-    _zlst=['Brazil/Acre','Brazil/DeNoronha','Brazil/East',
-           'Brazil/West','Canada/Atlantic','Canada/Central',
-           'Canada/Eastern','Canada/East-Saskatchewan',
-           'Canada/Mountain','Canada/Newfoundland',
-           'Canada/Pacific','Canada/Yukon',
-           'Chile/Continental','Chile/EasterIsland','CST','Cuba',
-           'Egypt','EST','GB-Eire','Greenwich','Hongkong','Iceland',
-           'Iran','Israel','Jamaica','Japan','Mexico/BajaNorte',
-           'Mexico/BajaSur','Mexico/General','MST','Poland','PST',
-           'Singapore','Turkey','Universal','US/Alaska','US/Aleutian',
-           'US/Arizona','US/Central','US/Eastern','US/East-Indiana',
-           'US/Hawaii','US/Indiana-Starke','US/Michigan',
-           'US/Mountain','US/Pacific','US/Samoa','UTC','UCT','GMT',
-
-           'GMT+0100','GMT+0200','GMT+0300','GMT+0400','GMT+0500',
-           'GMT+0600','GMT+0700','GMT+0800','GMT+0900','GMT+1000',
-           'GMT+1100','GMT+1200','GMT+1300','GMT-0100','GMT-0200',
-           'GMT-0300','GMT-0400','GMT-0500','GMT-0600','GMT-0700',
-           'GMT-0800','GMT-0900','GMT-1000','GMT-1100','GMT-1200',
-           'GMT+1',
-
-           'GMT+0130', 'GMT+0230', 'GMT+0330', 'GMT+0430', 'GMT+0530',
-           'GMT+0630', 'GMT+0730', 'GMT+0830', 'GMT+0930', 'GMT+1030',
-           'GMT+1130', 'GMT+1230',
-
-           'GMT-0130', 'GMT-0230', 'GMT-0330', 'GMT-0430', 'GMT-0530',
-           'GMT-0630', 'GMT-0730', 'GMT-0830', 'GMT-0930', 'GMT-1030',
-           'GMT-1130', 'GMT-1230',
-
-           'UT','BST','MEST','SST','FST','WADT','EADT','NZDT',
-           'WET','WAT','AT','AST','NT','IDLW','CET','MET',
-           'MEWT','SWT','FWT','EET','EEST','BT','ZP4','ZP5','ZP6',
-           'WAST','CCT','JST','EAST','GST','NZT','NZST','IDLE']
-
-
-    _zmap={'aest':'GMT+1000', 'aedt':'GMT+1100',
-           'aus eastern standard time':'GMT+1000',
-           'sydney standard time':'GMT+1000',
-           'tasmania standard time':'GMT+1000',
-           'e. australia standard time':'GMT+1000',
-           'aus central standard time':'GMT+0930',
-           'cen. australia standard time':'GMT+0930',
-           'w. australia standard time':'GMT+0800',
-
-           'brazil/acre':'Brazil/Acre',
-           'brazil/denoronha':'Brazil/Denoronha',
-           'brazil/east':'Brazil/East','brazil/west':'Brazil/West',
-           'canada/atlantic':'Canada/Atlantic',
-           'canada/central':'Canada/Central',
-           'canada/eastern':'Canada/Eastern',
-           'canada/east-saskatchewan':'Canada/East-Saskatchewan',
-           'canada/mountain':'Canada/Mountain',
-           'canada/newfoundland':'Canada/Newfoundland',
-           'canada/pacific':'Canada/Pacific','canada/yukon':'Canada/Yukon',
-           'central europe standard time':'GMT+0100',
-           'chile/continental':'Chile/Continental',
-           'chile/easterisland':'Chile/EasterIsland',
-           'cst':'US/Central','cuba':'Cuba','est':'US/Eastern','egypt':'Egypt',
-           'eastern standard time':'US/Eastern',
-           'us eastern standard time':'US/Eastern',
-           'central standard time':'US/Central',
-           'mountain standard time':'US/Mountain',
-           'pacific standard time':'US/Pacific',
-           'gb-eire':'GB-Eire','gmt':'GMT',
-
-           'gmt+0000':'GMT+0', 'gmt+0':'GMT+0',
-
-
-           'gmt+0100':'GMT+1', 'gmt+0200':'GMT+2', 'gmt+0300':'GMT+3',
-           'gmt+0400':'GMT+4', 'gmt+0500':'GMT+5', 'gmt+0600':'GMT+6',
-           'gmt+0700':'GMT+7', 'gmt+0800':'GMT+8', 'gmt+0900':'GMT+9',
-           'gmt+1000':'GMT+10','gmt+1100':'GMT+11','gmt+1200':'GMT+12',
-           'gmt+1300':'GMT+13',
-           'gmt-0100':'GMT-1', 'gmt-0200':'GMT-2', 'gmt-0300':'GMT-3',
-           'gmt-0400':'GMT-4', 'gmt-0500':'GMT-5', 'gmt-0600':'GMT-6',
-           'gmt-0700':'GMT-7', 'gmt-0800':'GMT-8', 'gmt-0900':'GMT-9',
-           'gmt-1000':'GMT-10','gmt-1100':'GMT-11','gmt-1200':'GMT-12',
-
-           'gmt+1': 'GMT+1', 'gmt+2': 'GMT+2', 'gmt+3': 'GMT+3',
-           'gmt+4': 'GMT+4', 'gmt+5': 'GMT+5', 'gmt+6': 'GMT+6',
-           'gmt+7': 'GMT+7', 'gmt+8': 'GMT+8', 'gmt+9': 'GMT+9',
-           'gmt+10':'GMT+10','gmt+11':'GMT+11','gmt+12':'GMT+12',
-           'gmt+13':'GMT+13',
-           'gmt-1': 'GMT-1', 'gmt-2': 'GMT-2', 'gmt-3': 'GMT-3',
-           'gmt-4': 'GMT-4', 'gmt-5': 'GMT-5', 'gmt-6': 'GMT-6',
-           'gmt-7': 'GMT-7', 'gmt-8': 'GMT-8', 'gmt-9': 'GMT-9',
-           'gmt-10':'GMT-10','gmt-11':'GMT-11','gmt-12':'GMT-12',
-
-           'gmt+130':'GMT+0130',  'gmt+0130':'GMT+0130',
-           'gmt+230':'GMT+0230',  'gmt+0230':'GMT+0230',
-           'gmt+330':'GMT+0330',  'gmt+0330':'GMT+0330',
-           'gmt+430':'GMT+0430',  'gmt+0430':'GMT+0430',
-           'gmt+530':'GMT+0530',  'gmt+0530':'GMT+0530',
-           'gmt+630':'GMT+0630',  'gmt+0630':'GMT+0630',
-           'gmt+730':'GMT+0730',  'gmt+0730':'GMT+0730',
-           'gmt+830':'GMT+0830',  'gmt+0830':'GMT+0830',
-           'gmt+930':'GMT+0930',  'gmt+0930':'GMT+0930',
-           'gmt+1030':'GMT+1030',
-           'gmt+1130':'GMT+1130',
-           'gmt+1230':'GMT+1230',
-
-           'gmt-130':'GMT-0130',  'gmt-0130':'GMT-0130',
-           'gmt-230':'GMT-0230',  'gmt-0230':'GMT-0230',
-           'gmt-330':'GMT-0330',  'gmt-0330':'GMT-0330',
-           'gmt-430':'GMT-0430',  'gmt-0430':'GMT-0430',
-           'gmt-530':'GMT-0530',  'gmt-0530':'GMT-0530',
-           'gmt-630':'GMT-0630',  'gmt-0630':'GMT-0630',
-           'gmt-730':'GMT-0730',  'gmt-0730':'GMT-0730',
-           'gmt-830':'GMT-0830',  'gmt-0830':'GMT-0830',
-           'gmt-930':'GMT-0930',  'gmt-0930':'GMT-0930',
-           'gmt-1030':'GMT-1030',
-           'gmt-1130':'GMT-1130',
-           'gmt-1230':'GMT-1230',
-
-           'greenwich':'Greenwich','hongkong':'Hongkong',
-           'iceland':'Iceland','iran':'Iran','israel':'Israel',
-           'jamaica':'Jamaica','japan':'Japan',
-           'mexico/bajanorte':'Mexico/BajaNorte',
-           'mexico/bajasur':'Mexico/BajaSur','mexico/general':'Mexico/General',
-           'mst':'US/Mountain','pst':'US/Pacific','poland':'Poland',
-           'singapore':'Singapore','turkey':'Turkey','universal':'Universal',
-           'utc':'Universal','uct':'Universal','us/alaska':'US/Alaska',
-           'us/aleutian':'US/Aleutian','us/arizona':'US/Arizona',
-           'us/central':'US/Central','us/eastern':'US/Eastern',
-           'us/east-indiana':'US/East-Indiana','us/hawaii':'US/Hawaii',
-           'us/indiana-starke':'US/Indiana-Starke','us/michigan':'US/Michigan',
-           'us/mountain':'US/Mountain','us/pacific':'US/Pacific',
-           'us/samoa':'US/Samoa',
-
-           'ut':'Universal',
-           'bst':'GMT+1', 'mest':'GMT+2', 'sst':'GMT+2',
-           'fst':'GMT+2', 'wadt':'GMT+8', 'eadt':'GMT+11', 'nzdt':'GMT+13',
-           'wet':'GMT', 'wat':'GMT-1', 'at':'GMT-2', 'ast':'GMT-4',
-           'nt':'GMT-11', 'idlw':'GMT-12', 'cet':'GMT+1', 'cest':'GMT+2',
-           'met':'GMT+1',
-           'mewt':'GMT+1', 'swt':'GMT+1', 'fwt':'GMT+1', 'eet':'GMT+2',
-           'eest':'GMT+3',
-           'bt':'GMT+3', 'zp4':'GMT+4', 'zp5':'GMT+5', 'zp6':'GMT+6',
-           'wast':'GMT+7', 'cct':'GMT+8', 'jst':'GMT+9', 'east':'GMT+10',
-           'gst':'GMT+10', 'nzt':'GMT+12', 'nzst':'GMT+12', 'idle':'GMT+12',
-           'ret':'GMT+4'
-           }
-
-    def __init__(self):
-        self._db = _data
-        self._d, self._zidx= {}, self._zmap.keys()
-
-    def __getitem__(self,k):
-        try:   n=self._zmap[k.lower()]
-        except KeyError:
-            if numericTimeZoneMatch(k) == None:
-                raise DateTimeError('Unrecognized timezone: %s' % k)
-            return k
-        try:
-            return self._d[n]
-        except KeyError:
-            z = self._d[n] = _timezone(self._db[n])
-            return z
-
-def _findLocalTimeZoneName(isDST):
-    if not _time.daylight:
-        # Daylight savings does not occur in this time zone.
-        isDST = 0
-    try:
-        # Get the name of the current time zone depending
-        # on DST.
-        _localzone = _cache._zmap[tzname[isDST].lower()]
-    except KeyError:
-        try:
-            # Generate a GMT-offset zone name.
-            if isDST:
-                localzone = _time.altzone
-            else:
-                localzone = _time.timezone
-            offset=(-localzone/(60*60))
-            majorOffset=int(offset)
-            if majorOffset != 0 :
-                minorOffset=abs(int((offset % majorOffset) * 60.0))
-            else: minorOffset = 0
-            m=majorOffset >= 0 and '+' or ''
-            lz='%s%0.02d%0.02d' % (m, majorOffset, minorOffset)
-            _localzone = _cache._zmap[('GMT%s' % lz).lower()]
-        except:
-            _localzone = ''
-    return _localzone
-
-# Some utility functions for calculating dates:
-
-def _calcSD(t):
-    # Returns timezone-independent days since epoch and the fractional
-    # part of the days.
-    dd = t + EPOCH - 86400.0
-    d = dd / 86400.0
-    s = d - math.floor(d)
-    return s, d
-
-def _calcDependentSecond(tz, t):
-    # Calculates the timezone-dependent second (integer part only)
-    # from the timezone-independent second.
-    fset = _tzoffset(tz, t)
-    return fset + long(math.floor(t)) + long(EPOCH) - 86400L
-
-def _calcDependentSecond2(yr,mo,dy,hr,mn,sc):
-    # Calculates the timezone-dependent second (integer part only)
-    # from the date given.
-    ss = int(hr) * 3600 + int(mn) * 60 + int(sc)
-    x = long(_julianday(yr,mo,dy)-jd1901) * 86400 + ss
-    return x
-
-def _calcIndependentSecondEtc(tz, x, ms):
-    # Derive the timezone-independent second from the timezone
-    # dependent second.
-    fsetAtEpoch = _tzoffset(tz, 0.0)
-    nearTime = x - fsetAtEpoch - long(EPOCH) + 86400L + ms
-    # nearTime is now within an hour of being correct.
-    # Recalculate t according to DST.
-    fset = long(_tzoffset(tz, nearTime))
-    x_adjusted = x - fset + ms
-    d = x_adjusted / 86400.0
-    t = x_adjusted - long(EPOCH) + 86400L
-    millis = (x + 86400 - fset) * 1000 + \
-             long(ms * 1000.0) - long(EPOCH * 1000.0)
-    s = d - math.floor(d)
-    return s,d,t,millis
-
-def _calcHMS(x, ms):
-    # hours, minutes, seconds from integer and float.
-    hr = x / 3600
-    x = x - hr * 3600
-    mn = x / 60
-    sc = x - mn * 60 + ms
-    return hr,mn,sc
-
-def _calcYMDHMS(x, ms):
-    # x is a timezone-dependent integer of seconds.
-    # Produces yr,mo,dy,hr,mn,sc.
-    yr,mo,dy=_calendarday(x / 86400 + jd1901)
-    x = int(x - (x / 86400) * 86400)
-    hr = x / 3600
-    x = x - hr * 3600
-    mn = x / 60
-    sc = x - mn * 60 + ms
-    return yr,mo,dy,hr,mn,sc
-
-def _julianday(yr,mo,dy):
-    y,m,d=long(yr),long(mo),long(dy)
-    if m > 12L:
-        y=y+m/12L
-        m=m%12L
-    elif m < 1L:
-        m=-m
-        y=y-m/12L-1L
-        m=12L-m%12L
-    if y > 0L: yr_correct=0L
-    else:      yr_correct=3L
-    if m < 3L: y, m=y-1L,m+12L
-    if y*10000L+m*100L+d > 15821014L: b=2L-y/100L+y/400L
-    else: b=0L
-    return (1461L*y-yr_correct)/4L+306001L*(m+1L)/10000L+d+1720994L+b
-
-def _calendarday(j):
-    j=long(j)
-    if(j < 2299160L):
-        b=j+1525L
-    else:
-        a=(4L*j-7468861L)/146097L
-        b=j+1526L+a-a/4L
-    c=(20L*b-2442L)/7305L
-    d=1461L*c/4L
-    e=10000L*(b-d)/306001L
-    dy=int(b-d-306001L*e/10000L)
-    mo=(e < 14L) and int(e-1L) or int(e-13L)
-    yr=(mo > 2) and (c-4716L) or (c-4715L)
-    return int(yr),int(mo),int(dy)
-
-def _tzoffset(tz, t):
-    try:
-        return DateTimeParser._tzinfo[tz].info(t)[0]
-    except:
-        if numericTimeZoneMatch(tz) is not None:
-            offset = int(tz[1:3])*3600+int(tz[3:5])*60
-            if tz[0] == '-':
-                return -offset
-            else:
-                return offset
-        else:
-            return 0 # Assume UTC
-
-def _correctYear(year):
-    # Y2K patch.
-    if year >= 0 and year < 100:
-        # 00-69 means 2000-2069, 70-99 means 1970-1999.
-        if year < 70:
-            year = 2000 + year
-        else:
-            year = 1900 + year
-    return year
-
-def safegmtime(t):
-    '''gmtime with a safety zone.'''
-    try:
-        t_int = int(t)
-    except OverflowError:
-        raise TimeError('The time %f is beyond the range '
-                        'of this Python implementation.' % float(t))
-    return _time.gmtime(t_int)
-
-def safelocaltime(t):
-    '''localtime with a safety zone.'''
-    try:
-        t_int = int(t)
-    except OverflowError:
-        raise TimeError('The time %f is beyond the range '
-                        'of this Python implementation.' % float(t))
-    return _time.localtime(t_int)
-
-class DateTimeParser:
-
-    def parse(self, arg, local=1):
-        """Parse a string containing some sort of date-time data.
-
-        This function returns a tuple (year, month, day, hour, minute,
-        second, timezone_string).
-
-        As a general rule, any date-time representation that is
-        recognized and unambigous to a resident of North America is
-        acceptable.(The reason for this qualification is that
-        in North America, a date like: 2/1/1994 is interpreted
-        as February 1, 1994, while in some parts of the world,
-        it is interpreted as January 2, 1994.) A date/time
-        string consists of two components, a date component and
-        an optional time component, separated by one or more
-        spaces. If the time component is omited, 12:00am is
-        assumed. Any recognized timezone name specified as the
-        final element of the date/time string will be used for
-        computing the date/time value. (If you create a DateTime
-        with the string 'Mar 9, 1997 1:45pm US/Pacific', the
-        value will essentially be the same as if you had captured
-        time.time() at the specified date and time on a machine in
-        that timezone)
-
-        x=parse('1997/3/9 1:45pm')
-        # returns specified time, represented in local machine zone.
-
-        y=parse('Mar 9, 1997 13:45:00')
-        # y is equal to x
-
-        The function automatically detects and handles
-        ISO8601 compliant dates (YYYY-MM-DDThh:ss:mmTZD).
-        See http://www.w3.org/TR/NOTE-datetime for full specs.
-
-        The date component consists of year, month, and day
-        values. The year value must be a one-, two-, or
-        four-digit integer. If a one- or two-digit year is
-        used, the year is assumed to be in the twentieth
-        century. The month may an integer, from 1 to 12, a
-        month name, or a month abreviation, where a period may
-        optionally follow the abreviation. The day must be an
-        integer from 1 to the number of days in the month. The
-        year, month, and day values may be separated by
-        periods, hyphens, forward, shashes, or spaces. Extra
-        spaces are permitted around the delimiters. Year,
-        month, and day values may be given in any order as long
-        as it is possible to distinguish the components. If all
-        three components are numbers that are less than 13,
-        then a a month-day-year ordering is assumed.
-
-        The time component consists of hour, minute, and second
-        values separated by colons.  The hour value must be an
-        integer between 0 and 23 inclusively. The minute value
-        must be an integer between 0 and 59 inclusively. The
-        second value may be an integer value between 0 and
-        59.999 inclusively. The second value or both the minute
-        and second values may be ommitted. The time may be
-        followed by am or pm in upper or lower case, in which
-        case a 12-hour clock is assumed.
-
-        If a string argument passed to the DateTime constructor cannot be
-        parsed, it will raise SyntaxError. Invalid date components
-        will raise a DateError, while invalid time or timezone components
-        will raise a DateTimeError.
-        """
-        if not isinstance(arg, StringTypes):
-            raise TypeError('Expected a string argument')
-
-        if not arg:
-            raise SyntaxError(arg)
-
-        if arg.find(' ')==-1 and len(arg) >= 5 and arg[4]=='-':
-            yr,mo,dy,hr,mn,sc,tz=self._parse_iso8601(arg)
-        else:
-            yr,mo,dy,hr,mn,sc,tz=self._parse(arg, local)
-
-
-        if not self._validDate(yr,mo,dy):
-            raise DateError(arg, yr, mo, dy)
-        if not self._validTime(hr,mn,int(sc)):
-            raise TimeError(arg)
-
-        return yr, mo, dy, hr, mn, sc, tz
-
-    def time(self, arg):
-        """Parse a string containing some sort of date-time data.
-
-        This function returns the time in seconds since the Epoch (in UTC).
-
-        See date() for the description of allowed input values.
-        """
-
-        yr, mo, dy, hr, mn, sc, tz = self.parse(arg)
-
-        ms = sc - math.floor(sc)
-        x = _calcDependentSecond2(yr,mo,dy,hr,mn,sc)
-
-        if tz:
-            try:
-                tz=self._tzinfo._zmap[tz.lower()]
-            except KeyError:
-                if numericTimeZoneMatch(tz) is None:
-                    raise DateTimeError('Unknown time zone in date: %s' % arg)
-        else:
-            tz = self._calcTimezoneName(x, ms)
-        s,d,t,millisecs = _calcIndependentSecondEtc(tz, x, ms)
-
-        return t
-
-
-    int_pattern  =re.compile(r'([0-9]+)') #AJ
-    flt_pattern  =re.compile(r':([0-9]+\.[0-9]+)') #AJ
-    name_pattern =re.compile(r'([a-zA-Z]+)', re.I) #AJ
-    space_chars  =' \t\n'
-    delimiters   ='-/.:,+'
-    _month_len  =((0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31),
-                  (0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31))
-    _until_month=((0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334),
-                  (0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335))
-    _monthmap   ={'january': 1,   'jan': 1,
-                  'february': 2,  'feb': 2,
-                  'march': 3,     'mar': 3,
-                  'april': 4,     'apr': 4,
-                  'may': 5,
-                  'june': 6,      'jun': 6,
-                  'july': 7,      'jul': 7,
-                  'august': 8,    'aug': 8,
-                  'september': 9, 'sep': 9, 'sept': 9,
-                  'october': 10,  'oct': 10,
-                  'november': 11, 'nov': 11,
-                  'december': 12, 'dec': 12}
-    _daymap     ={'sunday': 1,    'sun': 1,
-                  'monday': 2,    'mon': 2,
-                  'tuesday': 3,   'tues': 3,  'tue': 3,
-                  'wednesday': 4, 'wed': 4,
-                  'thursday': 5,  'thurs': 5, 'thur': 5, 'thu': 5,
-                  'friday': 6,    'fri': 6,
-                  'saturday': 7,  'sat': 7}
-
-    _localzone0 = _findLocalTimeZoneName(0)
-    _localzone1 = _findLocalTimeZoneName(1)
-    _multipleZones = (_localzone0 != _localzone1)
-    # For backward compatibility only:
-    _isDST = _time.localtime()[8]
-    _localzone = _isDST and _localzone1 or _localzone0
-
-    _tzinfo    = _cache()
-
-    def localZone(self, ltm=None):
-        '''Returns the time zone on the given date.  The time zone
-        can change according to daylight savings.'''
-        if not self._multipleZones:
-            return self._localzone0
-        if ltm == None:
-            ltm = _time.localtime()
-        isDST = ltm[8]
-        lz = isDST and self._localzone1 or self._localzone0
-        return lz
-
-    def _calcTimezoneName(self, x, ms):
-        # Derive the name of the local time zone at the given
-        # timezone-dependent second.
-        if not self._multipleZones:
-            return self._localzone0
-        fsetAtEpoch = _tzoffset(self._localzone0, 0.0)
-        nearTime = x - fsetAtEpoch - long(EPOCH) + 86400L + ms
-        # nearTime is within an hour of being correct.
-        try:
-            ltm = safelocaltime(nearTime)
-        except:
-            # We are beyond the range of Python's date support.
-            # Hopefully we can assume that daylight savings schedules
-            # repeat every 28 years.  Calculate the name of the
-            # time zone using a supported range of years.
-            yr,mo,dy,hr,mn,sc = _calcYMDHMS(x, 0)
-            yr = ((yr - 1970) % 28) + 1970
-            x = _calcDependentSecond2(yr,mo,dy,hr,mn,sc)
-            nearTime = x - fsetAtEpoch - long(EPOCH) + 86400L + ms
-            ltm = safelocaltime(nearTime)
-        tz = self.localZone(ltm)
-        return tz
-
-    def _parse(self, string, local=1):
-        # Parse date-time components from a string
-        month = year = tz = tm = None
-        spaces         = self.space_chars
-        intpat         = self.int_pattern
-        fltpat         = self.flt_pattern
-        wordpat        = self.name_pattern
-        delimiters     = self.delimiters
-        MonthNumbers   = self._monthmap
-        DayOfWeekNames = self._daymap
-        ValidZones     = self._tzinfo._zidx
-        TimeModifiers  = ['am','pm']
-
-        string = string.strip()
-
-        # Find timezone first, since it should always be the last
-        # element, and may contain a slash, confusing the parser.
-
-
-        # First check for time zone of form +dd:dd
-        tz = _iso_tz_re.search(string)
-        if tz:
-            tz = tz.start(0)
-            tz, string = string[tz:], string[:tz].strip()
-            tz = tz[:3]+tz[4:]
-        else:
-            # Look at last token
-            sp=string.split()
-            tz = sp[-1]
-            if tz and (tz.lower() in ValidZones):
-                string=' '.join(sp[:-1])
-            else:
-                tz = None  # Decide later, since the default time zone
-                           # could depend on the date.
-
-        ints,dels=[],[]
-        i,l=0,len(string)
-        while i < l:
-            while i < l and string[i] in spaces    : i=i+1
-            if i < l and string[i] in delimiters:
-                d=string[i]
-                i=i+1
-            else: d=''
-            while i < l and string[i] in spaces    : i=i+1
-
-            # The float pattern needs to look back 1 character, because it
-            # actually looks for a preceding colon like ':33.33'. This is
-            # needed to avoid accidentally matching the date part of a
-            # dot-separated date string such as '1999.12.31'.
-            if i > 0: b=i-1
-            else: b=i
-
-            ts_results = fltpat.match(string, b)
-            if ts_results:
-                s=ts_results.group(1)
-                i=i+len(s)
-                ints.append(float(s))
-                continue
-
-            #AJ
-            ts_results = intpat.match(string, i)
-            if ts_results:
-                s=ts_results.group(0)
-
-                ls=len(s)
-                i=i+ls
-                if (ls==4 and d and d in '+-' and
-                    (len(ints) + (not not month) >= 3)):
-                    tz='%s%s' % (d,s)
-                else:
-                    v=int(s)
-                    ints.append(v)
-                continue
-
-
-            ts_results = wordpat.match(string, i)
-            if ts_results:
-                o,s=ts_results.group(0),ts_results.group(0).lower()
-                i=i+len(s)
-                if i < l and string[i]=='.': i=i+1
-                # Check for month name:
-                if s in MonthNumbers:
-                    v=MonthNumbers[s]
-                    if month is None: month=v
-                    else: raise SyntaxError(string)
-                    continue
-                # Check for time modifier:
-                if s in TimeModifiers:
-                    if tm is None: tm=s
-                    else: raise SyntaxError(string)
-                    continue
-                # Check for and skip day of week:
-                if s in DayOfWeekNames:
-                    continue
-            raise SyntaxError(string)
-
-        day=None
-        if ints[-1] > 60 and d not in ['.',':'] and len(ints) > 2:
-            year=ints[-1]
-            del ints[-1]
-            if month:
-                day=ints[0]
-                del ints[:1]
-            else:
-                month=ints[0]
-                day=ints[1]
-                del ints[:2]
-        elif month:
-            if len(ints) > 1:
-                if ints[0] > 31:
-                    year=ints[0]
-                    day=ints[1]
-                else:
-                    year=ints[1]
-                    day=ints[0]
-                del ints[:2]
-        elif len(ints) > 2:
-            if ints[0] > 31:
-                year=ints[0]
-                if ints[1] > 12:
-                    day=ints[1]
-                    month=ints[2]
-                else:
-                    day=ints[2]
-                    month=ints[1]
-            if ints[1] > 31:
-                year=ints[1]
-                if ints[0] > 12 and ints[2] <= 12:
-                    day=ints[0]
-                    month=ints[2]
-                elif ints[2] > 12 and ints[0] <= 12:
-                    day=ints[2]
-                    month=ints[0]
-            elif ints[2] > 31:
-                year=ints[2]
-                if ints[0] > 12:
-                    day=ints[0]
-                    month=ints[1]
-                else:
-                    day=ints[1]
-                    month=ints[0]
-            elif ints[0] <= 12:
-                month=ints[0]
-                day=ints[1]
-                year=ints[2]
-            del ints[:3]
-
-        if day is None:
-            # Use today's date.
-            year,month,day = _time.localtime()[:3]
-
-        year = _correctYear(year)
-        if year < 1000: raise SyntaxError(string)
-
-        leap = year%4==0 and (year%100!=0 or year%400==0)
-        try:
-            if not day or day > self._month_len[leap][month]:
-                raise DateError(string)
-        except IndexError:
-            raise DateError(string)
-        tod=0
-        if ints:
-            i=ints[0]
-            # Modify hour to reflect am/pm
-            if tm and (tm=='pm') and i<12:  i=i+12
-            if tm and (tm=='am') and i==12: i=0
-            if i > 24: raise DateTimeError(string)
-            tod = tod + int(i) * 3600
-            del ints[0]
-            if ints:
-                i=ints[0]
-                if i > 60: raise DateTimeError(string)
-                tod = tod + int(i) * 60
-                del ints[0]
-                if ints:
-                    i=ints[0]
-                    if i > 60: raise DateTimeError(string)
-                    tod = tod + i
-                    del ints[0]
-                    if ints: raise SyntaxError(string)
-
-
-        tod_int = int(math.floor(tod))
-        ms = tod - tod_int
-        hr,mn,sc = _calcHMS(tod_int, ms)
-
-        if local and not tz:
-            # Figure out what time zone it is in the local area
-            # on the given date.
-            x = _calcDependentSecond2(year,month,day,hr,mn,sc)
-            tz = self._calcTimezoneName(x, ms)
-
-        return year,month,day,hr,mn,sc,tz
-
-    def _validDate(self,y,m,d):
-        if m<1 or m>12 or y<0 or d<1 or d>31: return 0
-        return d<=self._month_len[(y%4==0 and (y%100!=0 or y%400==0))][m]
-
-    def _validTime(self,h,m,s):
-        return h>=0 and h<=23 and m>=0 and m<=59 and s>=0 and s < 60
-
-    def _parse_iso8601(self,s):
-        try:
-            return self.__parse_iso8601(s)
-        except IndexError:
-            raise DateError(
-                'Not an ISO 8601 compliant date string: "%s"' %  s)
-
-
-    def __parse_iso8601(self,s):
-        """Parse an ISO 8601 compliant date.
-
-        TODO: Not all allowed formats are recognized (for some examples see
-        http://www.cl.cam.ac.uk/~mgk25/iso-time.html).
-        """
-        year=0
-        month=day=1
-        hour=minute=seconds=hour_off=min_off=0
-        tzsign='+'
-
-        datereg = re.compile(
-            '([0-9]{4})(-([0-9][0-9]))?(-([0-9][0-9]))?')
-        timereg = re.compile(
-            '([0-9]{2})(:([0-9][0-9]))?(:([0-9][0-9]))?(\.[0-9]{1,20})?'
-            '(\s*([-+])([0-9]{2})(:?([0-9]{2}))?)?')
-
-        # Date part
-
-        fields = datereg.split(s.strip())
-        if fields[1]:   year  = int(fields[1])
-        if fields[3]:   month = int(fields[3])
-        if fields[5]:   day   = int(fields[5])
-
-        if s.find('T')>-1:
-            fields = timereg.split(s[s.find('T')+1:])
-
-            if fields[1]:   hour     = int(fields[1])
-            if fields[3]:   minute   = int(fields[3])
-            if fields[5]:   seconds  = int(fields[5])
-            if fields[6]:   seconds  = seconds+float(fields[6])
-
-            if fields[8]:   tzsign   = fields[8]
-            if fields[9]:   hour_off = int(fields[9])
-            if fields[11]:  min_off  = int(fields[11])
-
-        return (year,month,day,hour,minute,seconds,
-                '%s%02d%02d' % (tzsign,hour_off,min_off))
-
-parser = DateTimeParser()
-parse = parser.parse
-time = parser.time
-
-######################################################################
-# Time-zone info based soley on offsets
-#
-# Share tzinfos for the same offset 
-
-from datetime import tzinfo as _tzinfo, timedelta as _timedelta
-
-class _tzinfo(_tzinfo):
-
-    def __init__(self, minutes):
-        if abs(minutes) > 1439:
-            raise ValueError("Time-zone offset is too large,", minutes)
-        self.__minutes = minutes
-        self.__offset = _timedelta(minutes=minutes)
-
-    def utcoffset(self, dt):
-        return self.__offset
-
-    def __reduce__(self):
-        return tzinfo, (self.__minutes, )
-
-    def dst(self, dt):
-        return None
-    
-    def tzname(self, dt):
-        return None
-
-    def __repr__(self):
-        return 'tzinfo(%d)' % self.__minutes
-
-
-def tzinfo(offset, _tzinfos = {}):
-
-    info = _tzinfos.get(offset)
-    if info is None:
-        # We haven't seen this one before. we need to save it.
-
-        # Use setdefault to avoid a race condition and make sure we have
-        # only one
-        info = _tzinfos.setdefault(offset, _tzinfo(offset))
-
-    return info
-
-tzinfo.__safe_for_unpickling__ = True
-
-#
-######################################################################
-
-from datetime import datetime as _datetime
-def parseDatetimetz(string):
-    y, mo, d, h, m, s, tz = parse(string)
-    s, micro = divmod(s, 1.0)
-    micro = round(micro * 1000000)
-    offset = _tzoffset(tz, None) / 60
-    return _datetime(y, mo, d, h, m, int(s), int(micro), tzinfo(offset))
-
-_iso_tz_re = re.compile("[-+]\d\d:\d\d$")

Modified: Zope3/branches/jim-adapter/src/zope/app/dav/adapter.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/dav/adapter.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/dav/adapter.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -21,12 +21,12 @@
 
 from zope.interface import implements
 from zope.i18n import translate
+from zope.size.interfaces import ISized
 
 from zope.app import zapi
 from zope.app.dav.interfaces import IDAVSchema
 from zope.app.dublincore.interfaces import IDCTimes
 from zope.app.filerepresentation.interfaces import IReadDirectory
-from zope.app.size.interfaces import ISized
 from zope.app.file.interfaces import IFile
 
 class DAVSchemaAdapter(object):

Modified: Zope3/branches/jim-adapter/src/zope/app/dav/tests/test_adapter.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/dav/tests/test_adapter.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/dav/tests/test_adapter.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -19,10 +19,10 @@
 from zope.testing.doctestunit import DocTestSuite
 
 from zope.interface import Interface, implements
+from zope.size.interfaces import ISized
 
 from zope.app.testing import ztapi
 from zope.app.testing.placelesssetup import setUp, tearDown
-from zope.app.size.interfaces import ISized
 from zope.app.filerepresentation.interfaces import IReadDirectory
 from zope.app.i18n import ZopeMessageFactory as _
 

Modified: Zope3/branches/jim-adapter/src/zope/app/dav/tests/test_propfind.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/dav/tests/test_propfind.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/dav/tests/test_propfind.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -26,6 +26,7 @@
 from zope.pagetemplate.tests.util import normalize_xml
 from zope.schema import getFieldNamesInOrder
 from zope.schema.interfaces import IText, ITextLine, IDatetime, ISequence
+from zope.size.interfaces import ISized
 
 from zope.app import zapi
 from zope.app.testing import ztapi
@@ -39,7 +40,6 @@
 from zope.app.dublincore.annotatableadapter import ZDCAnnotatableAdapter
 from zope.app.annotation.interfaces import IAnnotatable, IAnnotations
 from zope.app.annotation.attribute import AttributeAnnotations
-from zope.app.size.interfaces import ISized
 from zope.app.file.interfaces import IFile
 
 from zope.app.dav import propfind

Modified: Zope3/branches/jim-adapter/src/zope/app/debug/debug.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/debug/debug.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/debug/debug.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -20,8 +20,8 @@
 import base64, time
 from StringIO import StringIO
 from zope.publisher.publish import publish as _publish, debug_call
-from zope.publisher.browser import TestRequest
-from zope.app.publication.browser import BrowserPublication, setDefaultSkin
+from zope.publisher.browser import TestRequest, setDefaultSkin
+from zope.app.publication.browser import BrowserPublication
 from zope.app.appsetup import config, database
 
 class Debugger(object):

Deleted: Zope3/branches/jim-adapter/src/zope/app/decorator.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/decorator.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/decorator.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,245 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2003 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Decorator support
-
-Decorators are proxies that are mostly transparent but that may provide
-additional features.
-
-$Id$
-"""
-__docformat__ = "reStructuredText"
-
-from zope.proxy import getProxiedObject, ProxyBase
-from zope.security.checker import selectChecker, CombinedChecker
-from zope.security.proxy import Proxy, getChecker
-from zope.interface.declarations import ObjectSpecificationDescriptor
-from zope.interface.declarations import getObjectSpecification
-from zope.interface.declarations import ObjectSpecification
-from zope.interface import providedBy
-
-class DecoratorSpecificationDescriptor(ObjectSpecificationDescriptor):
-    """Support for interface declarations on decorators
-
-    >>> from zope.interface import *
-    >>> class I1(Interface):
-    ...     pass
-    >>> class I2(Interface):
-    ...     pass
-    >>> class I3(Interface):
-    ...     pass
-    >>> class I4(Interface):
-    ...     pass
-
-    >>> class D1(Decorator):
-    ...   implements(I1)
-
-
-    >>> class D2(Decorator):
-    ...   implements(I2)
-
-    >>> class X(object):
-    ...   implements(I3)
-
-    >>> x = X()
-    >>> directlyProvides(x, I4)
-
-    Interfaces of X are ordered with the directly-provided interfaces first
-
-    >>> [interface.getName() for interface in list(providedBy(x))]
-    ['I4', 'I3']
-
-    When we decorate objects, what order should the interfaces come
-    in?  One could argue that decorators are less specific, so they
-    should come last.
-
-    >>> [interface.getName() for interface in list(providedBy(D1(x)))]
-    ['I4', 'I3', 'I1']
-
-    >>> [interface.getName() for interface in list(providedBy(D2(D1(x))))]
-    ['I4', 'I3', 'I1', 'I2']
-    """
-    def __get__(self, inst, cls=None):
-        if inst is None:
-            return getObjectSpecification(cls)
-        else:
-            provided = providedBy(getProxiedObject(inst))
-
-            # Use type rather than __class__ because inst is a proxy and
-            # will return the proxied object's class.
-            cls = type(inst)
-            return ObjectSpecification(provided, cls)
-
-
-class DecoratedSecurityCheckerDescriptor(object):
-    """Descriptor for a Decorator that provides a decorated security checker.
-
-    To illustrate, we'll create a class that will be proxied:
-
-      >>> class Foo(object):
-      ...     a = 'a'
-
-    and a class to proxy it that uses a decorated security checker:
-
-      >>> class Wrapper(ProxyBase):
-      ...     b = 'b'
-      ...     __Security_checker__ = DecoratedSecurityCheckerDescriptor()
-
-    Next we'll create and register a checker for `Foo`:
-
-      >>> from zope.security.checker import NamesChecker, defineChecker
-      >>> fooChecker = NamesChecker(['a'])
-      >>> defineChecker(Foo, fooChecker)
-
-    along with a checker for `Wrapper`:
-
-      >>> wrapperChecker = NamesChecker(['b'])
-      >>> defineChecker(Wrapper, wrapperChecker)
-
-    Using `selectChecker()`, we can confirm that a `Foo` object uses
-    `fooChecker`:
-
-      >>> foo = Foo()
-      >>> selectChecker(foo) is fooChecker
-      True
-      >>> fooChecker.check(foo, 'a')
-      >>> fooChecker.check(foo, 'b')  # doctest: +ELLIPSIS
-      Traceback (most recent call last):
-      ForbiddenAttribute: ('b', <zope.app.decorator.Foo object ...>)
-
-    and that a `Wrapper` object uses `wrappeChecker`:
-
-      >>> wrapper = Wrapper(foo)
-      >>> selectChecker(wrapper) is wrapperChecker
-      True
-      >>> wrapperChecker.check(wrapper, 'b')
-      >>> wrapperChecker.check(wrapper, 'a')  # doctest: +ELLIPSIS
-      Traceback (most recent call last):
-      ForbiddenAttribute: ('a', <zope.app.decorator.Foo object ...>)
-
-    (Note that the object description says `Foo` because the object is a
-    proxy and generally looks and acts like the object it's proxying.)
-
-    When we access wrapper's ``__Security_checker__`` attribute, we invoke
-    the decorated security checker descriptor. The decorator's job is to make
-    sure checkers from both objects are used when available. In this case,
-    because both objects have checkers, we get a combined checker:
-
-      >>> checker = wrapper.__Security_checker__
-      >>> type(checker)
-      <class 'zope.security.checker.CombinedChecker'>
-      >>> checker.check(wrapper, 'a')
-      >>> checker.check(wrapper, 'b')
-
-    The decorator checker will work even with security proxied objects. To
-    illustrate, we'll proxify `foo`:
-
-      >>> from zope.security.proxy import ProxyFactory
-      >>> secure_foo = ProxyFactory(foo)
-      >>> secure_foo.a
-      'a'
-      >>> secure_foo.b  # doctest: +ELLIPSIS
-      Traceback (most recent call last):
-      ForbiddenAttribute: ('b', <zope.app.decorator.Foo object ...>)
-
-    when we wrap the secured `foo`:
-
-      >>> wrapper = Wrapper(secure_foo)
-
-    we still get a combined checker:
-
-      >>> checker = wrapper.__Security_checker__
-      >>> type(checker)
-      <class 'zope.security.checker.CombinedChecker'>
-      >>> checker.check(wrapper, 'a')
-      >>> checker.check(wrapper, 'b')
-
-    The decorator checker has three other scenarios:
-
-      - the wrapper has a checker but the proxied object doesn't
-      - the proxied object has a checker but the wrapper doesn't
-      - neither the wrapper nor the proxied object have checkers
-
-    When the wrapper has a checker but the proxied object doesn't:
-
-      >>> from zope.security.checker import NoProxy, _checkers
-      >>> del _checkers[Foo]
-      >>> defineChecker(Foo, NoProxy)
-      >>> selectChecker(foo) is None
-      True
-      >>> selectChecker(wrapper) is wrapperChecker
-      True
-
-    the decorator uses only the wrapper checker:
-
-      >>> wrapper = Wrapper(foo)
-      >>> wrapper.__Security_checker__ is wrapperChecker
-      True
-
-    When the proxied object has a checker but the wrapper doesn't:
-
-      >>> del _checkers[Wrapper]
-      >>> defineChecker(Wrapper, NoProxy)
-      >>> selectChecker(wrapper) is None
-      True
-      >>> del _checkers[Foo]
-      >>> defineChecker(Foo, fooChecker)
-      >>> selectChecker(foo) is fooChecker
-      True
-
-    the decorator uses only the proxied object checker:
-
-      >>> wrapper.__Security_checker__ is fooChecker
-      True
-
-    Finally, if neither the wrapper not the proxied have checkers:
-
-      >>> del _checkers[Foo]
-      >>> defineChecker(Foo, NoProxy)
-      >>> selectChecker(foo) is None
-      True
-      >>> selectChecker(wrapper) is None
-      True
-
-    the decorator doesn't have a checker:
-
-      >>> wrapper.__Security_checker__ is None
-      True
-
-    """
-    def __get__(self, inst, cls=None):
-        if inst is None:
-            return self
-        else:
-            proxied_object = getProxiedObject(inst)
-            if type(proxied_object) is Proxy:
-                checker = getChecker(proxied_object)
-            else:
-                checker = getattr(proxied_object, '__Security_checker__', None)
-                if checker is None:
-                    checker = selectChecker(proxied_object)
-            wrapper_checker = selectChecker(inst)
-            if wrapper_checker is None:
-                return checker
-            elif checker is None:
-                return wrapper_checker
-            else:
-                return CombinedChecker(wrapper_checker, checker)
-
-
-class Decorator(ProxyBase):
-    """Decorator base class"""
-
-    __providedBy__ = DecoratorSpecificationDescriptor()
-    __Security_checker__ = DecoratedSecurityCheckerDescriptor()
-

Modified: Zope3/branches/jim-adapter/src/zope/app/dependable/interfaces.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/dependable/interfaces.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/dependable/interfaces.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -18,7 +18,7 @@
 __docformat__ = 'restructuredtext'
 
 from zope.interface import Interface
-from zope.app.exception.interfaces import UserError
+from zope.exceptions.interfaces import UserError
 
 class IDependable(Interface):
     """Objects that other objects depend on.

Modified: Zope3/branches/jim-adapter/src/zope/app/dtmlpage/ftests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/dtmlpage/ftests.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/dtmlpage/ftests.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -111,7 +111,7 @@
 
 
 def test_suite():
-    from zope.app.tests import functional
+    from zope.app.testing import functional
     return unittest.TestSuite((
         unittest.makeSuite(DTMLPageTest),
         functional.FunctionalDocFileSuite('url.txt'),

Modified: Zope3/branches/jim-adapter/src/zope/app/dublincore/tests/test_zopedublincore.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/dublincore/tests/test_zopedublincore.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/dublincore/tests/test_zopedublincore.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -157,7 +157,7 @@
             (u'foo \u1111', u'2001-12-31'),
             ])
 
-        from zope.app.datetimeutils import parseDatetimetz
+        from zope.datetime import parseDatetimetz
 
         dc = self.dc
         self.assertEqual(dc.created,

Modified: Zope3/branches/jim-adapter/src/zope/app/dublincore/zopedublincore.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/dublincore/zopedublincore.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/dublincore/zopedublincore.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -20,9 +20,8 @@
 from datetime import datetime
 
 from zope.interface import implements
-
+from zope.datetime import parseDatetimetz
 from zope.app.dublincore.interfaces import IZopeDublinCore
-from zope.app.datetimeutils import parseDatetimetz
 
 class SimpleProperty(object):
 

Modified: Zope3/branches/jim-adapter/src/zope/app/error/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/error/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/error/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,31 +1 @@
-##############################################################################
-#
-# Copyright (c) 2006 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Error logging utility
-
-$Id$
-"""
-from zope.app.error.error import RootErrorReportingUtility
-from zope.app.error.error import ErrorReportingUtility
-from zope.app.error.error import globalErrorReportingUtility
-
-###############################################################################
-# BBB: 12/14/2004
-import sys
-sys.modules['zope.app.errorservice'] = sys.modules[__name__]
-
-RootErrorReportingService = RootErrorReportingUtility
-ErrorReportingService = ErrorReportingUtility
-globalErrorReportingService = globalErrorReportingUtility
-
-###############################################################################
+# import this

Modified: Zope3/branches/jim-adapter/src/zope/app/event/interfaces.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/event/interfaces.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/event/interfaces.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -18,19 +18,16 @@
 __docformat__ = 'restructuredtext'
 
 from zope.interface import Interface, Attribute
+import zope.deferredimport
+import zope.component.interfaces
 
+zope.deferredimport.deprecated(
+    "IObjectEvent is now defined in zope.component.interfaces.  "
+    "Importing IObjectEvent from zope.app.event will be disabled in Zope 3.5.",
+    IObjectEvent = 'zope.component.interfaces:IObjectEvent',
+    )
 
-class IObjectEvent(Interface):
-    """An event related to an object.
-
-    The object that generated this event is not necessarily the object
-    refered to by location.
-    """
-
-    object = Attribute("The subject of the event.")
-
-
-class IObjectCreatedEvent(IObjectEvent):
+class IObjectCreatedEvent(zope.component.interfaces.IObjectEvent):
     """An object has been created.
 
     The location will usually be ``None`` for this event."""
@@ -42,7 +39,7 @@
     original = Attribute("The original from which the copy was made")
 
 
-class IObjectModifiedEvent(IObjectEvent):
+class IObjectModifiedEvent(zope.component.interfaces.IObjectEvent):
     """An object has been modified"""
 
 

Modified: Zope3/branches/jim-adapter/src/zope/app/event/objectevent.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/event/objectevent.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/event/objectevent.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -69,7 +69,7 @@
 """
 __docformat__ = 'restructuredtext'
 
-from zope.app.event.interfaces import IObjectEvent, IObjectCreatedEvent
+from zope.app.event.interfaces import IObjectCreatedEvent
 from zope.app.event.interfaces import IObjectModifiedEvent
 from zope.app.event.interfaces import IObjectCopiedEvent
 from zope.app.event.interfaces import IObjectAnnotationsModifiedEvent
@@ -77,26 +77,20 @@
 from zope.app.event.interfaces import IAttributes, ISequence
 from zope.interface import implements
 from zope.event import notify
+import zope.component.interfaces
 from zope.component import subscribers
+import zope.deferredimport
 
-# BBB Backward Compatibility (Can go away in 3.3)
-import warnings 
-
-
 _marker = object()
 
+zope.deferredimport.deprecated(
+    "ObjectEvent is now defined in zope.component.interfaces.  "
+    "Importing ObjectEvent from zope.app.event will be disabled in Zope 3.5.",
+    ObjectEvent = 'zope.component.interfaces:ObjectEvent',
+    )
 
-class ObjectEvent(object):
-    """Something has happened to an object"""
 
-
-    implements(IObjectEvent)
-
-    def __init__(self, object):
-        self.object = object
-
-
-class ObjectCreatedEvent(ObjectEvent):
+class ObjectCreatedEvent(zope.component.interfaces.ObjectEvent):
     """An object has been created"""
 
     implements(IObjectCreatedEvent)
@@ -141,8 +135,7 @@
         self.interface = interface
         self.keys = keys
 
-
-class ObjectModifiedEvent(ObjectEvent):
+class ObjectModifiedEvent(zope.component.interfaces.ObjectEvent):
     """An object has been modified"""
 
     implements(IObjectModifiedEvent)
@@ -175,16 +168,9 @@
 
     implements(IObjectCopiedEvent)
 
-    def __init__(self, object, original=None):
+    def __init__(self, object, original):
         super(ObjectCopiedEvent, self).__init__(object)
         self.original = original
-        # BBB goes away in 3.3
-        if original is None:
-            warnings.warn(
-                "%s with no original is deprecated and will no-longer "
-                "be supported starting in Zope 3.3."
-                % self.__class__.__name__,
-                DeprecationWarning, stacklevel=2)
 
 
 def objectEventNotify(event):
@@ -192,59 +178,3 @@
     adapters = subscribers((event.object, event), None)
     for adapter in adapters:
         pass # getting them does the work
-
-
-# BBB:  Can go away in 3.3
-
-class ObjectAnnotationsModifiedEvent(ObjectModifiedEvent):
-    """An object's annotations have been modified"""
-
-    implements(IObjectAnnotationsModifiedEvent)
-
-    def __init__(self, object, deprecated_use=True) :
-        super(ObjectAnnotationsModifiedEvent, self).__init__(object)
-        if deprecated_use :
-            warnings.warn(
-                "%s is deprecated and will no-longer be supported "
-                "starting in Zope 3.3.  Use ObjectModifiedEvent "
-                "and modification descriptors instead."
-                % self.__class__.__name__,
-                DeprecationWarning)
-
-
-def annotationModified(object, deprecated_use=True):
-    warnings.warn(
-                "annotationModified is deprecated and will no-longer be "
-                "supported starting in Zope 3.3.  Use modified "
-                "and modification descriptors instead."
-                % self.__class__.__name__,
-                DeprecationWarning)
-                
-    notify(ObjectAnnotationsModifiedEvent(object, deprecated_use=False))
-
-
-class ObjectContentModifiedEvent(ObjectModifiedEvent):
-    """An object's content has been modified"""
-
-    implements(IObjectContentModifiedEvent)
-
-    def __init__(self, object, deprecated_use=True) :
-        super(ObjectContentModifiedEvent, self).__init__(object)
-        if deprecated_use :
-            warnings.warn(
-                "%s is deprecated and will no-longer be supported "
-                "starting in Zope 3.3.  Use ObjectModifiedEvent "
-                "and modification descriptors instead."
-                % self.__class__.__name__,
-                DeprecationWarning)
-
-
-def contentModified(object, deprecated_use=True):
-    warnings.warn(
-                "contentModified is deprecated and will no-longer be "
-                "supported starting in Zope 3.3.  Use modified "
-                "and modification descriptors instead."
-                % self.__class__.__name__,
-                DeprecationWarning)
-
-    notify(ObjectContentModifiedEvent(object, deprecated_use=False))

Modified: Zope3/branches/jim-adapter/src/zope/app/event/tests/placelesssetup.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/event/tests/placelesssetup.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/event/tests/placelesssetup.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -16,7 +16,7 @@
 $Id$
 """
 
-from zope.app.event.interfaces import IObjectEvent
+from zope.component.interfaces import IObjectEvent
 from zope.app.event.objectevent import objectEventNotify
 from zope.app.testing import ztapi
 
@@ -39,9 +39,9 @@
 class PlacelessSetup(object):
 
     def setUp(self):
-        clearEvents()
         ztapi.subscribe([None], None, events.append)
         ztapi.subscribe([IObjectEvent], None, objectEventNotify)
+        clearEvents()
 
 import zope.testing.cleanup
 zope.testing.cleanup.addCleanUp(clearEvents)

Modified: Zope3/branches/jim-adapter/src/zope/app/event/tests/test_objectevent.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/event/tests/test_objectevent.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/event/tests/test_objectevent.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -24,8 +24,6 @@
 from zope.app.dublincore.interfaces import IZopeDublinCore
 from zope.app.dublincore.annotatableadapter import ZDCAnnotatableAdapter
 from zope.app.event.objectevent import ObjectModifiedEvent
-from zope.app.event.objectevent import ObjectAnnotationsModifiedEvent
-from zope.app.event.objectevent import ObjectContentModifiedEvent
 from zope.app.event import objectevent
 from zope.app.container.contained import Contained, ObjectRemovedEvent
 from zope.app.container.interfaces import IContained, IObjectRemovedEvent
@@ -46,19 +44,6 @@
     def testGetObject(self):
         self.assertEqual(self.event.object, self.object)
 
-class TestObjectAnnotationsModifiedEvent(TestObjectModifiedEvent):
-    klass = ObjectAnnotationsModifiedEvent
-    
-    def setUp(self):
-        self.event = self.klass(self.object, deprecated_use=False)
-
-class TestObjectContentModifiedEvent(TestObjectModifiedEvent):
-    klass = ObjectContentModifiedEvent
-    
-    def setUp(self):
-        self.event = self.klass(self.object, deprecated_use=False)
-        
-
 class TestObjectEventNotifications(unittest.TestCase):
     def setUp(self):
         self.callbackTriggered = False
@@ -110,13 +95,13 @@
     def tearDown(self):
         tearDown()
 
-def setUpObjectEventDocTest(test) :
+def setUpObjectEventDocTest(test):
     setUp()
         
     ztapi.provideAdapter(IAttributeAnnotatable,
-                                IAnnotations, AttributeAnnotations) 
+                         IAnnotations, AttributeAnnotations) 
     ztapi.provideAdapter(IAnnotatable,
-                                IZopeDublinCore, ZDCAnnotatableAdapter)    
+                         IZopeDublinCore, ZDCAnnotatableAdapter)    
 
 def tearDownObjectEventDocTest(test) :
     tearDown()
@@ -124,13 +109,11 @@
 def test_suite():
     return unittest.TestSuite((
         unittest.makeSuite(TestObjectModifiedEvent),
-        unittest.makeSuite(TestObjectAnnotationsModifiedEvent),
-        unittest.makeSuite(TestObjectContentModifiedEvent),
         unittest.makeSuite(TestObjectEventNotifications),
         doctest.DocTestSuite("zope.app.event.objectevent",
-                                       setUp=setUpObjectEventDocTest,
-                                       tearDown=tearDownObjectEventDocTest,
-                                       optionflags=doctest.NORMALIZE_WHITESPACE),
+                             setUp=setUpObjectEventDocTest,
+                             tearDown=tearDownObjectEventDocTest,
+                             optionflags=doctest.NORMALIZE_WHITESPACE),
         ))
 
 if __name__=='__main__':

Modified: Zope3/branches/jim-adapter/src/zope/app/exception/browser/configure.zcml
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/exception/browser/configure.zcml	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/exception/browser/configure.zcml	2006-04-04 15:56:58 UTC (rev 66397)
@@ -11,14 +11,6 @@
       />
 
   <page
-      for="zope.exceptions.INotFoundError"
-      name="index.html"
-      template="systemerror.pt"
-      class="..systemerror.SystemErrorView"
-      permission="zope.Public"
-      />
-
-  <page
       for="zope.security.interfaces.IUnauthorized"
       name="index.html"
       permission="zope.Public"
@@ -28,7 +20,7 @@
   <zope:adapter factory=".unauthorized.default_template" name="default" />
 
   <page
-      for="zope.app.exception.interfaces.IUserError"
+      for="zope.exceptions.interfaces.IUserError"
       name="index.html"
       permission="zope.Public"
       template="user.pt"

Modified: Zope3/branches/jim-adapter/src/zope/app/exception/browser/ftests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/exception/browser/ftests.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/exception/browser/ftests.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -25,9 +25,9 @@
         raise ComponentLookupError()
 
 
-class TestNotFound(functional.BrowserTestCase):
+class TestComponentLookupError(functional.BrowserTestCase):
 
-    def testNotFound(self):
+    def testComponentLookupError(self):
         response = self.publish('/foobar', basic='mgr:mgrpw',
                                 handle_errors=True)
         self.assertEqual(response.getStatus(), 404)
@@ -38,7 +38,7 @@
 
 def test_suite():
     return unittest.TestSuite((
-        unittest.makeSuite(TestNotFound),
+        unittest.makeSuite(TestComponentLookupError),
         functional.FunctionalDocFileSuite('systemerror.txt'),
         ))
 

Modified: Zope3/branches/jim-adapter/src/zope/app/exception/browser/systemerror.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/exception/browser/systemerror.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/exception/browser/systemerror.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -59,11 +59,11 @@
     A system error occurred.
   ...
 
-Another way of getting a system error is the occurrence of an
-``INotFoundError``, such as ``ComponentLookupError``. I have registered a
-simple view in ``exception-ftesting.zcml`` that will raise a component lookup
-error. So if we call ``componentlookuperror.html``, we should get the error
-message:
+Another way of getting a system error is the occurrence of a system
+error, such as ``ComponentLookupError``. I have registered a simple
+view in ``exception-ftesting.zcml`` that will raise a component lookup
+error. So if we call ``componentlookuperror.html``, we should get the
+error message:
 
   >>> print http(r"""
   ... GET /componentlookuperror.html HTTP/1.1
@@ -72,4 +72,3 @@
   ...
     A system error occurred.
   ...
-

Modified: Zope3/branches/jim-adapter/src/zope/app/exception/interfaces.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/exception/interfaces.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/exception/interfaces.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,17 +17,19 @@
 
 from zope.interface import Interface, implements
 
-class IUserError(Interface):
-    """User error exceptions
-    """
+##############################################################################
+# BBB 2006/04/03 - to be removed after 12 months
 
-class UserError(Exception):
-    """User errors
+import zope.deferredimport
+zope.deferredimport.deprecated(
+    "UserError has been moved to zope.exceptions.interfaces. This "
+    "reference will be removed in Zope 3.5.",
+    UserError = 'zope.exceptions.interfaces:UserError',
+    IUserError = 'zope.exceptions.interfaces:IUserError',
+    )
 
-    These exceptions should generally be displayed to users unless
-    they are handled.
-    """
-    implements(IUserError)
+#
+##############################################################################
 
 class ISystemErrorView(Interface):
     """Error views that can classify their contexts as system errors
@@ -36,4 +38,3 @@
     def isSystemError():
         """Return a boolean indicating whether the error is a system errror
         """
-    

Modified: Zope3/branches/jim-adapter/src/zope/app/file/browser/file.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/file/browser/file.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/file/browser/file.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,19 +15,18 @@
 
 $Id$
 """
-
 from datetime import datetime
 
 import zope.event
-
 from zope.publisher import contenttype
 from zope.schema import Text
+from zope.exceptions.interfaces import UserError
+
 from zope.app import contenttypes
 from zope.app.event import objectevent
 from zope.app.file.file import File
 from zope.app.file.interfaces import IFile
 from zope.app.i18n import ZopeMessageFactory as _
-from zope.app.exception.interfaces import UserError
 
 __docformat__ = 'restructuredtext'
 
@@ -134,10 +133,6 @@
     >>> sio = StringIO.StringIO("some data")
     >>> sio.filename = 'abc.txt'
 
-    >>> def eventLog(event):
-    ...     print 'ModifiedEvent:', event.descriptions[0].attributes
-    >>> zope.event.subscribers.append(eventLog)
-
     Before we instanciate the request, we need to make sure that the
     ``IUserPreferredLanguages`` adapter exists, so that the request's
     locale exists.  This is necessary because the ``update_object``
@@ -150,6 +145,12 @@
     >>> ztapi.provideAdapter(IHTTPRequest, IUserPreferredLanguages,
     ...                      BrowserLanguages)
 
+    We install an event logger so we can see the events generated:
+
+    >>> def eventLog(event):
+    ...     print 'ModifiedEvent:', event.descriptions[0].attributes
+    >>> zope.event.subscribers.append(eventLog)
+
     Let's make sure we can use the uploaded file name if one isn't
     specified by the user, and can use the content type when
     specified.

Modified: Zope3/branches/jim-adapter/src/zope/app/file/browser/ftests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/file/browser/ftests.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/file/browser/ftests.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -302,7 +302,7 @@
         self.checkForBrokenLinks(body, '/image/@@preview.html', 'mgr:mgrpw')
 
 def test_suite():
-    from zope.app.tests import functional
+    from zope.app.testing import functional
     return unittest.TestSuite((
         unittest.makeSuite(FileTest),
         unittest.makeSuite(ImageTest),

Modified: Zope3/branches/jim-adapter/src/zope/app/file/browser/image.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/file/browser/image.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/file/browser/image.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,7 +17,7 @@
 """
 __docformat__ = 'restructuredtext'
 
-from zope.app.size.interfaces import ISized
+from zope.size.interfaces import ISized
 
 class ImageData(object):
 

Modified: Zope3/branches/jim-adapter/src/zope/app/file/configure.zcml
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/file/configure.zcml	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/file/configure.zcml	2006-04-04 15:56:58 UTC (rev 66397)
@@ -70,7 +70,7 @@
 
   <adapter
       factory=".image.ImageSized"
-      provides="zope.app.size.interfaces.ISized"
+      provides="zope.size.interfaces.ISized"
       for=".interfaces.IImage"
       />
 

Modified: Zope3/branches/jim-adapter/src/zope/app/file/image.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/file/image.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/file/image.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -21,15 +21,14 @@
 from cStringIO import StringIO
 
 from zope.interface import implements
+from zope.size.interfaces import ISized
+from zope.size import byteDisplay
 
-from zope.app.size.interfaces import ISized
-from zope.app.size import byteDisplay
 from zope.app.contenttypes import guess_content_type
 from zope.app.i18n import ZopeMessageFactory as _
+from zope.app.file.file import File
+from zope.app.file.interfaces import IImage
 
-from file import File
-from interfaces import IImage
-
 class Image(File):
     implements(IImage)
 

Modified: Zope3/branches/jim-adapter/src/zope/app/file/tests/test_image.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/file/tests/test_image.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/file/tests/test_image.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -131,7 +131,7 @@
 class TestSized(unittest.TestCase):
 
     def testInterface(self):
-        from zope.app.size.interfaces import ISized
+        from zope.size.interfaces import ISized
         self.failUnless(ISized.implementedBy(ImageSized))
         self.failUnless(verifyClass(ISized, ImageSized))
 

Modified: Zope3/branches/jim-adapter/src/zope/app/folder/folder.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/folder/folder.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/folder/folder.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -122,8 +122,8 @@
       []
 
       >>> sm = Contained()
-      >>> from zope.component.interfaces import ISiteManager
-      >>> directlyProvides(sm, ISiteManager)
+      >>> from zope.component.interfaces import IComponentLookup
+      >>> directlyProvides(sm, IComponentLookup)
       >>> folder.setSiteManager(sm)
       >>> directlyProvides(folder, ISite)
       >>> subs = list(FolderSublocations(folder).sublocations())

Modified: Zope3/branches/jim-adapter/src/zope/app/form/browser/add.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/form/browser/add.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/form/browser/add.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -182,4 +182,4 @@
         layer = IDefaultBrowserLayer
     
     s = zapi.getGlobalSiteManager()
-    s.provideAdapter((for_, layer), Interface, name, class_)
+    s.registerAdapter(class_, (for_, layer), Interface, name)

Modified: Zope3/branches/jim-adapter/src/zope/app/form/browser/editview.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/form/browser/editview.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/form/browser/editview.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -146,4 +146,4 @@
         layer = IDefaultBrowserLayer
 
     s = zapi.getGlobalSiteManager()
-    s.provideAdapter((for_, layer), Interface, name, class_)
+    s.registerAdapter(class_, (for_, layer), Interface, name)

Modified: Zope3/branches/jim-adapter/src/zope/app/form/browser/ftests/test_datetimewidget.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/form/browser/ftests/test_datetimewidget.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/form/browser/ftests/test_datetimewidget.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,16 +17,15 @@
 """
 import unittest
 import re
-from persistent import Persistent
+
 import transaction
+import zope.security.checker
+from persistent import Persistent
 from datetime import datetime
-from zope.app.datetimeutils import parseDatetimetz, tzinfo
-
+from zope.datetime import parseDatetimetz, tzinfo
 from zope.interface import Interface
 from zope.interface import implements
-
 from zope.schema import Datetime, Choice
-import zope.security.checker
 
 from support import *
 from zope.app.traversing.api import traverse

Modified: Zope3/branches/jim-adapter/src/zope/app/form/browser/schemadisplay.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/form/browser/schemadisplay.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/form/browser/schemadisplay.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -82,4 +82,4 @@
         layer = IDefaultBrowserLayer
 
     sm = zapi.getGlobalSiteManager()
-    sm.provideAdapter((for_, layer), Interface, name, class_)
+    sm.registerAdapter(class_, (for_, layer), Interface, name)

Modified: Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_add.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_add.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_add.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -18,7 +18,7 @@
 import unittest
 
 from zope.component.interfaces import IFactory
-from zope.component.interfaces import ISiteManager
+from zope.component.interfaces import IComponentLookup
 from zope.component.factory import Factory
 from zope.interface import Interface, implements
 from zope.publisher.browser import TestRequest
@@ -287,7 +287,7 @@
                 return "."
 
         # register content factory for content factory id lookup
-        ztapi.provideAdapter(None, ISiteManager, SiteManagerAdapter)
+        ztapi.provideAdapter(None, IComponentLookup, SiteManagerAdapter)
         ztapi.provideUtility(IFactory, Factory(C), name='C')
         
         adding = Adding(self)

Modified: Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_datetimewidget.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_datetimewidget.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_datetimewidget.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -16,7 +16,7 @@
 $Id$
 """
 import unittest, doctest
-from zope.app.datetimeutils import parseDatetimetz
+from zope.datetime import parseDatetimetz
 from zope.app.form.browser.tests.test_browserwidget import SimpleInputWidgetTest
 from zope.app.form.interfaces import IInputWidget
 from zope.app.form.browser import DatetimeWidget

Modified: Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_datewidget.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_datewidget.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_datewidget.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -16,7 +16,7 @@
 $Id$
 """
 import unittest, doctest
-from zope.app.datetimeutils import parseDatetimetz
+from zope.datetime import parseDatetimetz
 from zope.app.form.browser.tests.test_browserwidget import SimpleInputWidgetTest
 from zope.app.form.interfaces import IInputWidget
 from zope.app.form.browser import DateWidget

Modified: Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_directives.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_directives.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_directives.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -19,7 +19,7 @@
 import unittest
 from cStringIO import StringIO
 
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 from zope.configuration.xmlconfig import xmlconfig, XMLConfig
 from zope.app.traversing.interfaces import TraversalError
 from zope.interface import Interface, implements

Modified: Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_editview.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_editview.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/form/browser/tests/test_editview.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -21,16 +21,16 @@
 from zope.publisher.browser import TestRequest
 from zope.schema import TextLine, accessors
 from zope.schema.interfaces import ITextLine
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 
 from zope.app.testing import ztapi
 from zope.app.testing.placelesssetup import PlacelessSetup
-from zope.app.event.tests.placelesssetup import getEvents
+from zope.app.event.tests.placelesssetup import getEvents, clearEvents
 
 from zope.app.form.browser import TextWidget
 from zope.app.form.browser.editview import EditView
 from zope.app.form.browser.submit import Update
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 from zope.app.form.interfaces import IInputWidget
 from zope.app.form.tests import utils
 from zope.app.location.interfaces import ILocation
@@ -108,6 +108,7 @@
         super(Test, self).setUp()
         ztapi.browserViewProviding(ITextLine, TextWidget, IInputWidget)
         ztapi.provideAdapter(IFoo, IBar, FooBarAdapter)
+        clearEvents()
 
     def test_setPrefix_and_widgets(self):
         v = EV(C(), TestRequest())

Modified: Zope3/branches/jim-adapter/src/zope/app/form/browser/textwidgets.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/form/browser/textwidgets.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/form/browser/textwidgets.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -19,13 +19,13 @@
 
 from xml.sax import saxutils
 from zope.interface import implements
+from zope.datetime import parseDatetimetz
+from zope.datetime import DateTimeError
 
 from zope.app.form.interfaces import IInputWidget, ConversionError
 from zope.app.form.browser.interfaces import ITextBrowserWidget
 from zope.app.form.browser.widget import SimpleInputWidget, renderElement
 from zope.app.form.browser.widget import DisplayWidget
-from zope.app.datetimeutils import parseDatetimetz
-from zope.app.datetimeutils import DateTimeError
 
 from zope.app.i18n import ZopeMessageFactory as _
 

Modified: Zope3/branches/jim-adapter/src/zope/app/form/browser/widgets.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/form/browser/widgets.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/form/browser/widgets.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -47,9 +47,9 @@
     from zope.interface import Interface
     from zope.schema import Object, Tuple, TextLine
     from zope.schema.interfaces import ITextLine
-    from zope.i18n import MessageIDFactory
+    from zope.i18nmessageid import MessageFactory
 
-    _ = MessageIDFactory("poll")
+    _ = MessageFactory("poll")
 
     class IPollOption(Interface):
         label = TextLine(title=u'Label', min_length=1)

Modified: Zope3/branches/jim-adapter/src/zope/app/form/interfaces.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/form/interfaces.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/form/interfaces.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -21,7 +21,7 @@
 from zope.component.interfaces import IView
 from zope.interface import Attribute, Interface, implements
 from zope.schema import Bool
-from zope.app.exception.interfaces import UserError
+from zope.exceptions.interfaces import UserError
 
 class IWidgetInputError(Interface):
     """Placeholder for a snippet View"""

Modified: Zope3/branches/jim-adapter/src/zope/app/form/tests/test_utility.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/form/tests/test_utility.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/form/tests/test_utility.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -18,8 +18,7 @@
 import doctest
 
 from zope.interface import Interface, implements
-from zope.component.interfaces import IViewFactory
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import IViewFactory, ComponentLookupError
 from zope.publisher.browser import TestRequest
 import zope.security.checker
 from zope.security.interfaces import ForbiddenAttribute, Unauthorized

Modified: Zope3/branches/jim-adapter/src/zope/app/form/tests/test_widget.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/form/tests/test_widget.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/form/tests/test_widget.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -100,11 +100,11 @@
     All widgets rely on a field and a request:
 
         >>> from zope.schema import Field
-        >>> from zope.component.tests.request import Request
         >>> field = Field()
         >>> from zope.interface import Interface
         >>> class ITestRequest(Interface):
         ...     pass
+        >>> from zope.app.component.tests.views import Request
         >>> widget = TestInputWidget(field, Request(ITestRequest))
 
     The default implementation of hasValidInput relies on

Modified: Zope3/branches/jim-adapter/src/zope/app/fssync/fsregistry.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/fssync/fsregistry.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/fssync/fsregistry.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -19,21 +19,12 @@
 """
 __docformat__ = 'restructuredtext'
 
-import zope.deprecation
-
 from zope.exceptions import DuplicationError
 from zope.interface import implements
 from zope.app.fssync.interfaces import IGlobalFSSyncUtility
 from zope.app.fssync.interfaces import IFactoryNotFoundError
 
-# BBB Backward Compatibility (Can go away in 3.3)
-zope.deprecation.__show__.off()
-from zope.exceptions import NotFoundError
-zope.deprecation.__show__.on()
-
-class FactoryNotFoundError(NotFoundError):
-    # BBB : NotFoundError inheritance
-    # Backward Compatibility (Can go away in 3.3)
+class FactoryNotFoundError(LookupError):
     implements(IFactoryNotFoundError)
 
 class FSRegistry(object):

Modified: Zope3/branches/jim-adapter/src/zope/app/http/exception/configure.zcml
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/http/exception/configure.zcml	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/http/exception/configure.zcml	2006-04-04 15:56:58 UTC (rev 66397)
@@ -28,23 +28,7 @@
     name="index.html"
     />
 
-<!-- BBB : can be removed in 3.3 -->
 <view
-    for="zope.exceptions.INotFoundError"
-    type="zope.publisher.interfaces.http.IHTTPRequest"
-    name="index.html"
-    permission="zope.Public"
-    factory=".notfound.NotFound"
-    />
-
-<defaultView
-    for="zope.exceptions.INotFoundError"
-    type="zope.publisher.interfaces.http.IHTTPRequest"
-    name="index.html"
-    />
-<!-- END BBB : can be removed in 3.3 -->
-
-<view
     for="zope.app.publication.http.IMethodNotAllowed"
     factory="zope.app.http.exception.methodnotallowed.MethodNotAllowedView"
     name="index.html"

Modified: Zope3/branches/jim-adapter/src/zope/app/i18n/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/i18n/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/i18n/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,19 +17,6 @@
 """
 __docformat__ = 'restructuredtext'
 
-# BBB 2005/10/10 -- MessageIDs are to be removed for Zope 3.3
-import zope.deprecation
-zope.deprecation.__show__.off()
-from zope.i18nmessageid import MessageIDFactory, MessageFactory
-zope.deprecation.__show__.on()
-
-# import one of these as _ to create i18n messages in the zope domain
-ZopeMessageIDFactory = MessageIDFactory('zope')
+# import this as _ to create i18n messages in the zope domain
+from zope.i18nmessageid import MessageFactory
 ZopeMessageFactory = MessageFactory('zope')
-
-zope.deprecation.deprecated('ZopeMessageIDFactory',
-                            'Mutable i18n messages ("message ids") have been '
-                            'deprecated in favour of immutable ones and will '
-                            'be removed in Zope 3.3.  Please use '
-                            'ZopeMessageFactory instead of '
-                            'ZopeMessageIDFactory.')

Modified: Zope3/branches/jim-adapter/src/zope/app/i18n/tests/testi18ndirectives.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/i18n/tests/testi18ndirectives.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/i18n/tests/testi18ndirectives.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -18,7 +18,7 @@
 import os
 import unittest
 
-from zope.component.tests.placelesssetup import PlacelessSetup
+from zope.component.testing import PlacelessSetup
 from zope.configuration import xmlconfig
 
 from zope.app import zapi

Modified: Zope3/branches/jim-adapter/src/zope/app/i18n/translationdomain.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/i18n/translationdomain.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/i18n/translationdomain.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -29,7 +29,6 @@
 from zope.i18n.interfaces import INegotiator, ITranslationDomain
 from zope.i18n.simpletranslationdomain import SimpleTranslationDomain
 from zope.app.container.contained import Contained
-from zope.app.component.site import UtilityRegistration
 from zope.app.component import queryNextUtility
 
 class TranslationDomain(BTreeContainer, SimpleTranslationDomain, Contained):
@@ -221,9 +220,6 @@
                                    fmsg['mod_time'])
 
 
-# BBB: Backward compatibility. 12/09/2004
-DomainRegistration = UtilityRegistration
-
 def setDomainOnActivation(domain, event):
     """Set the permission id upon registration activation.
 

Modified: Zope3/branches/jim-adapter/src/zope/app/i18nfile/browser/i18nimage.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/i18nfile/browser/i18nimage.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/i18nfile/browser/i18nimage.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -20,10 +20,10 @@
 from urllib import quote
 
 from zope.i18n.negotiator import negotiator
+from zope.size import ISized
 
 from zope.app.i18n import ZopeMessageFactory as _
 from zope.app.file.browser.image import ImageData
-from zope.app.size import ISized
 
 
 class I18nImageEdit(object):

Modified: Zope3/branches/jim-adapter/src/zope/app/introspector/browser.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/introspector/browser.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/introspector/browser.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,7 +17,7 @@
 """
 __docformat__ = 'restructuredtext'
 
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 from zope.interface import directlyProvides, directlyProvidedBy
 from zope.proxy import removeAllProxies
 

Modified: Zope3/branches/jim-adapter/src/zope/app/locales/extract.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/locales/extract.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/locales/extract.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -25,15 +25,10 @@
 import traceback
 from pygettext import safe_eval, normalize, make_escapes
 
-from interfaces import IPOTEntry, IPOTMaker, ITokenEater
 from zope.interface import implements
+from zope.i18nmessageid import Message
+from zope.app.locales.interfaces import IPOTEntry, IPOTMaker, ITokenEater
 
-# BBB 2005/10/10 -- MessageIDs are to be removed for Zope 3.3
-import zope.deprecation
-zope.deprecation.__show__.off()
-from zope.i18nmessageid import MessageID, Message
-zope.deprecation.__show__.on()
-
 DEFAULT_CHARSET = 'UTF-8'
 DEFAULT_ENCODING = '8bit'
 
@@ -117,10 +112,8 @@
     def write(self, file):
         if self.comments:
             file.write(self.comments)
-        if (isinstance(self.msgid, MessageID) and
-               self.msgid != self.msgid.default) or (
-           isinstance(self.msgid, Message) and
-               self.msgid.default is not None):
+        if (isinstance(self.msgid, Message) and
+            self.msgid.default is not None):
             default = self.msgid.default.strip()
             lines = normalize(default).split("\n")
             lines[0] = "#. Default: %s\n" % lines[0]

Modified: Zope3/branches/jim-adapter/src/zope/app/location/location.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/location/location.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/location/location.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -19,9 +19,9 @@
 
 import zope.interface
 from zope.app.location.interfaces import ILocation
-from zope.proxy import ProxyBase, getProxiedObject
-from zope.app.decorator import DecoratorSpecificationDescriptor
-from zope.app.decorator import DecoratedSecurityCheckerDescriptor
+from zope.proxy import ProxyBase, getProxiedObject, non_overridable
+from zope.decorator import DecoratorSpecificationDescriptor
+from zope.decorator import DecoratedSecurityCheckerDescriptor
 
 class Location(object):
     """Stupid mix-in that defines `__parent__` and `__name__` attributes
@@ -161,6 +161,7 @@
         self.__parent__ = container
         self.__name__ = name
 
+    @non_overridable
     def __reduce__(self, proto=None):
         raise TypeError("Not picklable")
 

Modified: Zope3/branches/jim-adapter/src/zope/app/locking/configure.zcml
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/locking/configure.zcml	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/locking/configure.zcml	2006-04-04 15:56:58 UTC (rev 66397)
@@ -47,7 +47,7 @@
   <class class=".storage.Sized">
     <require
         permission="zope.Public"
-        interface="zope.app.size.interfaces.ISized"
+        interface="zope.size.interfaces.ISized"
         />
   </class>
 

Modified: Zope3/branches/jim-adapter/src/zope/app/locking/interfaces.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/locking/interfaces.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/locking/interfaces.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -18,9 +18,8 @@
 """
 from zope import interface, schema
 
-from zope.app.event.interfaces import IObjectEvent
+from zope.component.interfaces import ObjectEvent, IObjectEvent
 from zope.interface.common.mapping import IMapping
-from zope.app.event.objectevent import ObjectEvent
 from zope.app.i18n import ZopeMessageFactory as _
 
 class ILockable(interface.Interface):

Modified: Zope3/branches/jim-adapter/src/zope/app/locking/storage.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/locking/storage.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/locking/storage.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -25,12 +25,12 @@
 from BTrees.IOBTree import IOBTree
 
 from zope import component, interface
+from zope.size.interfaces import ISized
 
 from zope.app.keyreference.interfaces import IKeyReference
 from zope.app.locking import interfaces
 # for backwards compatibility:
 from zope.app.locking.interfaces import ILockStorage
-from zope.app.size.interfaces import ISized
 
 from zope.app.i18n import ZopeMessageFactory as _
 

Modified: Zope3/branches/jim-adapter/src/zope/app/locking/tests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/locking/tests.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/locking/tests.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -18,7 +18,7 @@
 """
 
 import sys, unittest, time
-from zope.component.tests.placelesssetup import PlacelessSetup
+from zope.component.testing import PlacelessSetup
 import zope.event
 from zope.testing import doctest
 from transaction import abort
@@ -66,6 +66,9 @@
     def __cmp__(self, other):
         return cmp(id(self.object), id(other.object))
 
+def maybeFakeKeyReference(ob):
+    if not isinstance(ob, int):
+        return FakeKeyReference(ob)
 
 class TestLockStorage(unittest.TestCase):
 
@@ -136,7 +139,7 @@
     dict['__name__'] = name
     sys.modules[name] = FakeModule(dict)
 
-    ztapi.provideAdapter(Interface, IKeyReference, FakeKeyReference)
+    ztapi.provideAdapter(Interface, IKeyReference, maybeFakeKeyReference)
     ztapi.provideAdapter(Interface, ILockable, LockingAdapterFactory)
     ztapi.provideAdapter(None, IPathAdapter, LockingPathAdapter,
                          "locking")

Modified: Zope3/branches/jim-adapter/src/zope/app/mail/tests/test_directives.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/mail/tests/test_directives.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/mail/tests/test_directives.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -21,7 +21,7 @@
 import threading
 import time
 
-from zope.component.tests.placelesssetup import PlacelessSetup
+from zope.component.testing import PlacelessSetup
 from zope.configuration import xmlconfig
 from zope.interface import implements
 

Modified: Zope3/branches/jim-adapter/src/zope/app/module/README.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/module/README.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/module/README.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -113,7 +113,7 @@
   >>> ZopeModuleRegistry.findModule('mymodule') is module
   True
   >>> ZopeModuleRegistry.modules()
-  ['mymodule']
+  [u'mymodule']
 
 Additionally, the package provides two API functions that look up a module in
 the registry and then in `sys.modules`:
@@ -149,4 +149,4 @@
 
   >>> zope.app.module.uninstallPersistentModuleImporter(event)
   >>> __builtin__.__import__
-  <built-in function __import__>
\ No newline at end of file
+  <built-in function __import__>

Modified: Zope3/branches/jim-adapter/src/zope/app/module/configure.zcml
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/module/configure.zcml	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/module/configure.zcml	2006-04-04 15:56:58 UTC (rev 66397)
@@ -9,12 +9,14 @@
   </localUtility>
 
   <subscriber
-     for="..component.interfaces.registration.IRegistrationActivatedEvent"
+     for="zope.component.interfaces.IUtilityRegistration
+          zope.component.interfaces.IRegistrationActivatedEvent"
      handler=".manager.setNameOnActivation"
      />
 
   <subscriber
-     for="..component.interfaces.registration.IRegistrationDeactivatedEvent"
+     for="zope.component.interfaces.IUtilityRegistration
+          zope.component.interfaces.IRegistrationDeactivatedEvent"
      handler=".manager.unsetNameOnDeactivation"
      />
 

Modified: Zope3/branches/jim-adapter/src/zope/app/onlinehelp/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/onlinehelp/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/onlinehelp/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -61,7 +61,7 @@
     >>> import os
     >>> from tests.test_onlinehelp import testdir
     >>> from tests.test_onlinehelp import I1, Dummy1, Dummy2
-    >>> from zope.app.tests import ztapi
+    >>> from zope.app.testing import ztapi
     >>> from zope.component.interfaces import IFactory
     >>> from zope.component.factory import Factory
     >>> from zope.app.onlinehelp.onlinehelptopic import OnlineHelpTopic

Modified: Zope3/branches/jim-adapter/src/zope/app/onlinehelp/onlinehelp.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/onlinehelp/onlinehelp.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/onlinehelp/onlinehelp.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -33,7 +33,7 @@
 class OnlineHelp(OnlineHelpTopic):
     """
     >>> import os
-    >>> from zope.app.tests import ztapi
+    >>> from zope import component
     >>> from zope.component.interfaces import IFactory
     >>> from zope.component.factory import Factory
     >>> from zope.app.onlinehelp.tests.test_onlinehelp import testdir
@@ -63,10 +63,10 @@
     >>> rest = Factory(RESTOnlineHelpTopic)
     >>> stx = Factory(STXOnlineHelpTopic)
     >>> zpt = Factory(ZPTOnlineHelpTopic)
-    >>> ztapi.provideUtility(IFactory, default, 'onlinehelp.topic.default')
-    >>> ztapi.provideUtility(IFactory, rest, 'onlinehelp.topic.rest')
-    >>> ztapi.provideUtility(IFactory, stx, 'onlinehelp.topic.stx')
-    >>> ztapi.provideUtility(IFactory, zpt, 'onlinehelp.topic.zpt')
+    >>> component.provideUtility(default, IFactory, 'onlinehelp.topic.default')
+    >>> component.provideUtility(rest, IFactory, 'onlinehelp.topic.rest')
+    >>> component.provideUtility(stx, IFactory, 'onlinehelp.topic.stx')
+    >>> component.provideUtility(zpt, IFactory, 'onlinehelp.topic.zpt')
     >>> path = os.path.join(testdir(), 'help2.txt')
     >>> onlinehelp.registerHelpTopic('', 'help2', 'Help 2',
     ...     path, I1, 'view.html')
@@ -153,5 +153,5 @@
         #utils = zapi.getService(Utilities)
         #utils.provideUtility(IOnlineHelpTopic, topic, topic.getTopicPath())
 
-        zapi.getGlobalSiteManager().provideUtility(
-            IOnlineHelpTopic, topic, topic.getTopicPath())
+        zapi.getGlobalSiteManager().registerUtility(
+            topic, IOnlineHelpTopic, topic.getTopicPath())

Modified: Zope3/branches/jim-adapter/src/zope/app/onlinehelp/tests/test_treeview.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/onlinehelp/tests/test_treeview.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/onlinehelp/tests/test_treeview.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -19,10 +19,10 @@
 
 from unittest import TestCase, TestLoader, TextTestRunner
 
+from zope import component
 from zope.pagetemplate.tests.util import check_xml
 from zope.publisher.browser import TestRequest
 from zope.app.site.tests.placefulsetup import PlacefulSetup
-from zope.app.tests import ztapi
 from zope.app.onlinehelp.tests import util
 from zope.app.onlinehelp.interfaces import IOnlineHelp, IOnlineHelpTopic
 from zope.app.onlinehelp.onlinehelp import OnlineHelp
@@ -41,7 +41,7 @@
         PlacefulSetup.setUp(self, site=True)
         path = os.path.join(testdir(), 'help.txt')
         self.onlinehelp = OnlineHelp('Help', path)
-        ztapi.provideUtility(IOnlineHelp, self.onlinehelp, "OnlineHelp")
+        component.provideUtility(self.onlinehelp, IOnlineHelp, "OnlineHelp")
 
     def test_onlinehelp(self):
         view = OnlineHelpTopicTreeView

Modified: Zope3/branches/jim-adapter/src/zope/app/pagetemplate/configure.zcml
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/pagetemplate/configure.zcml	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/pagetemplate/configure.zcml	2006-04-04 15:56:58 UTC (rev 66397)
@@ -44,4 +44,11 @@
     <allow attributes="__call__" />
  </class>
 
+ <adapter
+     for="zope.app.pagetemplate.viewpagetemplatefile.BoundPageTemplate
+          zope.publisher.interfaces.browser.IBrowserRequest"
+     provides="zope.publisher.interfaces.browser.IBrowserPublisher"
+     factory="zope.app.publication.traversers.NoTraverser"
+     />
+
 </configure>

Modified: Zope3/branches/jim-adapter/src/zope/app/pagetemplate/engine.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/pagetemplate/engine.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/pagetemplate/engine.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -28,7 +28,7 @@
 from zope.tales.pythonexpr import PythonExpr
 from zope.tales.tales import ExpressionEngine, Context
 
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 from zope.app.traversing.interfaces import TraversalError
 from zope.security.untrustedpython import rcompile
 from zope.security.proxy import ProxyFactory

Modified: Zope3/branches/jim-adapter/src/zope/app/pagetemplate/talesapi.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/pagetemplate/talesapi.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/pagetemplate/talesapi.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,16 +17,17 @@
 """
 __docformat__ = 'restructuredtext'
 
-from zope.app.dublincore.interfaces import IDCDescriptiveProperties
-from zope.app.dublincore.interfaces import IDCTimes
-from zope.app.dublincore.interfaces import IZopeDublinCore
-from zope.app.size.interfaces import ISized
-from zope.app import zapi
 from zope.interface import implements
+from zope.size.interfaces import ISized
 from zope.security.interfaces import Unauthorized
 from zope.tales.interfaces import ITALESFunctionNamespace
 
+from zope.app import zapi
+from zope.app.dublincore.interfaces import IDCDescriptiveProperties
+from zope.app.dublincore.interfaces import IDCTimes
+from zope.app.dublincore.interfaces import IZopeDublinCore
 
+
 class ZopeTalesAPI(object):
 
     implements(IDCTimes, IDCDescriptiveProperties, ITALESFunctionNamespace)

Modified: Zope3/branches/jim-adapter/src/zope/app/pagetemplate/tests/test_talesapi.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/pagetemplate/tests/test_talesapi.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/pagetemplate/tests/test_talesapi.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,12 +15,13 @@
 
 $Id$
 """
+from datetime import datetime
 from zope.testing.doctestunit import DocTestSuite
 from zope.interface import implements
+from zope.size.interfaces import ISized
+
 from zope.app.dublincore.interfaces import IZopeDublinCore
-from zope.app.size.interfaces import ISized
 from zope.app.traversing.interfaces import IPhysicallyLocatable
-from datetime import datetime
 from zope.app.pagetemplate.talesapi import ZopeTalesAPI
 
 class TestObject(object):

Modified: Zope3/branches/jim-adapter/src/zope/app/publication/browser.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publication/browser.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/publication/browser.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -20,19 +20,27 @@
 """
 __docformat__ = 'restructuredtext'
 
-from zope.interface import providedBy
-from zope.interface import directlyProvides
-
+from zope.component import queryMultiAdapter
 from zope.publisher.interfaces.browser import IBrowserPublisher
-from zope.publisher.interfaces.browser import IDefaultSkin
-from zope.publisher.interfaces.browser import IDefaultBrowserLayer
+from zope.security.checker import ProxyFactory
 
-from zope.app import zapi
 from zope.app.publication.publicationtraverse \
      import PublicationTraverser as PublicationTraverser_
 from zope.app.publication.http import BaseHTTPPublication
-from zope.security.checker import ProxyFactory
 
+##############################################################################
+# BBB 2006/04/03 - to be removed after 12 months
+
+import zope.deferredimport
+zope.deferredimport.deprecated(
+    "setDefaultSkin has been moved to zope.publisher.browser. This "
+    "reference will be removed in Zope 3.5.",
+    setDefaultSkin = 'zope.publisher.browser:setDefaultSkin',
+    )
+
+#
+##############################################################################
+
 class PublicationTraverser(PublicationTraverser_):
 
     def traverseRelativeURL(self, request, ob, path):
@@ -57,7 +65,7 @@
             # ob is already proxied, so the result of calling a method will be
             return ob.browserDefault(request)
         else:
-            adapter = zapi.queryMultiAdapter((ob, request), IBrowserPublisher)
+            adapter = queryMultiAdapter((ob, request), IBrowserPublisher)
             if adapter is not None:
                 ob, path = adapter.browserDefault(request)
                 ob = ProxyFactory(ob)
@@ -79,72 +87,3 @@
 
     def __call__(self):
         return self.__pub
-
-def setDefaultSkin(request):
-    """Sets the default skin for the request.
-
-    The default skin is a marker interface that can be registered as an
-    adapter that provides IDefaultSkin for the request type.
-
-    If a default skin is not available, the default layer
-    (IDefaultBrowserLayer) is used.
-
-    To illustrate, we'll first use setDefaultSkin without a registered
-    IDefaultSkin adapter:
-
-      >>> from zope.publisher.interfaces.browser import IBrowserRequest
-      >>> from zope.interface import implements
-      >>> class Request(object):
-      ...     implements(IBrowserRequest)
-
-      >>> request = Request()
-      >>> IDefaultBrowserLayer.providedBy(request)
-      False
-
-      >>> setDefaultSkin(request)
-      >>> IDefaultBrowserLayer.providedBy(request)
-      True
-
-    When we register a default layer, however:
-
-      >>> from zope.interface import Interface
-      >>> class IMySkin(Interface):
-      ...     pass
-      >>> from zope.app.testing import ztapi
-      >>> ztapi.provideAdapter(IBrowserRequest, IDefaultSkin, IMySkin)
-
-    setDefaultSkin uses the layer instead of IDefaultBrowserLayer.providedBy:
-
-      >>> request = Request()
-      >>> IMySkin.providedBy(request)
-      False
-      >>> IDefaultSkin.providedBy(request)
-      False
-
-      >>> setDefaultSkin(request)
-
-      >>> IMySkin.providedBy(request)
-      True
-      >>> IDefaultBrowserLayer.providedBy(request)
-      False
-
-    Any interfaces that are directly provided by the request coming into this
-    method are replaced by the applied layer/skin interface:
-
-      >>> request = Request()
-      >>> class IFoo(Interface):
-      ...     pass
-      >>> directlyProvides(request, IFoo)
-      >>> IFoo.providedBy(request)
-      True
-      >>> setDefaultSkin(request)
-      >>> IFoo.providedBy(request)
-      False
-
-    """
-    adapters = zapi.getSiteManager().adapters
-    skin = adapters.lookup((providedBy(request),), IDefaultSkin, '')
-    if skin is not None:
-        directlyProvides(request, skin)
-    else:
-        directlyProvides(request, IDefaultBrowserLayer)

Modified: Zope3/branches/jim-adapter/src/zope/app/publication/httpfactory.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publication/httpfactory.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/publication/httpfactory.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -20,9 +20,9 @@
 from zope import interface
 
 from zope.publisher.interfaces.browser import IBrowserRequest
+from zope.publisher.browser import setDefaultSkin
 
 from zope.app.publication import interfaces
-from zope.app.publication.browser import setDefaultSkin
 from zope.app.publication.requestpublicationregistry import factoryRegistry
 
 

Modified: Zope3/branches/jim-adapter/src/zope/app/publication/interfaces.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publication/interfaces.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/publication/interfaces.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -18,7 +18,7 @@
 __docformat__ = 'restructuredtext'
 
 from zope import interface
-import zope.app.event.interfaces
+import zope.component.interfaces
 
 class IPublicationRequestFactory(interface.Interface):
     """Publication request factory"""
@@ -29,7 +29,7 @@
         A request is created and configured with a publication object.
         """
 
-class IBeforeTraverseEvent(zope.app.event.interfaces.IObjectEvent):
+class IBeforeTraverseEvent(zope.component.interfaces.IObjectEvent):
     """An event which gets sent on publication traverse"""
 
     request = interface.Attribute("The current request")

Modified: Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_browserpublication.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_browserpublication.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_browserpublication.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -16,9 +16,8 @@
 $Id: test_browserpublication.py 38357 2005-09-07 20:14:34Z srichter $
 """
 import unittest
-from zope.testing import doctest
 
-from zope.app.testing import placelesssetup, ztapi
+from zope.app.testing import ztapi
 from StringIO import StringIO
 
 from zope.security.interfaces import ForbiddenAttribute
@@ -316,10 +315,6 @@
         unittest.makeSuite(BrowserPublicationTests, 'test'),
         unittest.makeSuite(BrowserDefaultTests, 'test'),
         unittest.makeSuite(HTTPPublicationRequestFactoryTests, 'test'),
-        doctest.DocTestSuite('zope.app.publication.browser',
-                             setUp=placelesssetup.setUp,
-                             tearDown=placelesssetup.tearDown),
-
         ))
 
 

Modified: Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_httpfactory.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_httpfactory.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_httpfactory.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -23,7 +23,7 @@
 from zope.publisher.browser import BrowserRequest
 from zope.publisher.http import HTTPRequest
 from zope.publisher.xmlrpc import XMLRPCRequest
-from zope.component.tests.placelesssetup import PlacelessSetup
+from zope.component.testing import PlacelessSetup
 
 from zope.app.publication.httpfactory import HTTPPublicationRequestFactory
 from zope.app.publication.browser import BrowserPublication

Modified: Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_requestpublicationfactories.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_requestpublicationfactories.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_requestpublicationfactories.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -23,7 +23,7 @@
 from zope.publisher.browser import BrowserRequest
 from zope.publisher.http import HTTPRequest
 from zope.publisher.xmlrpc import XMLRPCRequest
-from zope.component.tests.placelesssetup import PlacelessSetup
+from zope.component.testing import PlacelessSetup
 
 from zope.app.publication.httpfactory import HTTPPublicationRequestFactory
 from zope.app.publication.browser import BrowserPublication

Modified: Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_requestpublicationregistry.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_requestpublicationregistry.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_requestpublicationregistry.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -21,7 +21,7 @@
 
 from zope import component, interface
 from zope.interface.verify import verifyClass
-from zope.component.tests.placelesssetup import PlacelessSetup
+from zope.component.testing import PlacelessSetup
 
 from zope.configuration.exceptions import ConfigurationError
 from zope.app.publication import interfaces

Modified: Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_simplecomponenttraverser.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_simplecomponenttraverser.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_simplecomponenttraverser.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -16,9 +16,8 @@
 $Id$
 """
 import unittest
-from zope.component.tests.request import Request
 from zope.publisher.interfaces import NotFound
-from zope.interface import Interface
+from zope.interface import Interface, directlyProvides
 
 from zope.app.publication.traversers import SimpleComponentTraverser
 from zope.app.testing.placelesssetup import PlacelessSetup
@@ -37,7 +36,11 @@
         return getattr(self, name, default)
 
 
-class Request(Request):
+class Request(object):
+
+    def __init__(self, type):
+        directlyProvides(self, type)
+
     def getEffectiveURL(self):
         return ''
 

Modified: Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_zopepublication.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_zopepublication.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/publication/tests/test_zopepublication.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -27,7 +27,7 @@
 from zope.interface.verify import verifyClass
 from zope.interface import implements, classImplements, implementedBy
 from zope.i18n.interfaces import IUserPreferredCharsets
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 from zope.publisher.base import TestPublication, TestRequest
 from zope.publisher.http import IHTTPRequest, HTTPCharsets
 from zope.publisher.interfaces import IRequest, IPublishTraverse

Modified: Zope3/branches/jim-adapter/src/zope/app/publication/traversers.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publication/traversers.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/publication/traversers.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -67,6 +67,9 @@
 
         return view, path
 
+def NoTraverser(ob, request):
+    return None
+
 class TestTraverser(object):
     """Bobo-style traverser, mostly useful for testing"""
     implements(IBrowserPublisher)
@@ -77,7 +80,7 @@
     def browserDefault(self, request):
         ob = self.context
 
-        if providedBy(ob):
+        if list(providedBy(ob)):
             view_name = zapi.getDefaultViewName(ob, request)
             return ob, (("@@%s" % view_name),)
 

Modified: Zope3/branches/jim-adapter/src/zope/app/publisher/browser/fields.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publisher/browser/fields.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/publisher/browser/fields.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -18,7 +18,7 @@
 __docformat__ = 'restructuredtext'
 
 import zope.schema
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 from zope.configuration.exceptions import ConfigurationError
 from zope.configuration.fields import GlobalObject
 from zope.interface.interfaces import IInterface

Modified: Zope3/branches/jim-adapter/src/zope/app/publisher/browser/fileresource.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publisher/browser/fileresource.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/publisher/browser/fileresource.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,20 +17,16 @@
 """
 
 import time
-
+from zope.security.proxy import Proxy
+from zope.interface import implements
+from zope.datetime import time as timeFromDateTimeString
 from zope.publisher.interfaces import NotFound
-
-from zope.app.publisher.browser import BrowserView
 from zope.publisher.interfaces.browser import IBrowserPublisher
 
+from zope.app.publisher.browser import BrowserView
 from zope.app.publisher.fileresource import File, Image
 from zope.app.publisher.browser.resource import Resource
-from zope.app.datetimeutils import time as timeFromDateTimeString
 
-from zope.security.proxy import Proxy
-
-from zope.interface import implements
-
 class FileResource(BrowserView, Resource):
 
     implements(IBrowserPublisher)

Modified: Zope3/branches/jim-adapter/src/zope/app/publisher/browser/viewmeta.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publisher/browser/viewmeta.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/publisher/browser/viewmeta.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,8 +17,7 @@
 """
 import os
 
-from zope.component.exceptions import ComponentLookupError
-from zope.component.interfaces import IDefaultViewName
+from zope.component.interfaces import ComponentLookupError, IDefaultViewName
 from zope.interface import implements, classImplements, Interface
 from zope.publisher.interfaces import NotFound
 from zope.security.checker import CheckerPublic, Checker

Modified: Zope3/branches/jim-adapter/src/zope/app/publisher/fieldconverters.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publisher/fieldconverters.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/publisher/fieldconverters.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -18,13 +18,13 @@
 from datetime import datetime
 
 from zope.publisher.browser import registerTypeConverter
-from zope.app.datetimeutils import parse as parseDateTime
+from zope.datetime import parse as parseDateTime
 
 def field2date_via_datetimeutils(v):
     """Converter for request fields marshalled as ':date'.
 
     o TODO: Uses the non-localized and non-tzinfo-aware 'parseDateTime'
-            utility from zope.app.datetimeutils;  a better alternative
+            utility from zope.datetime;  a better alternative
             would be more I18N / L10N aware, perhaps even adapting to
             the expressed preferences of the user.
     """

Modified: Zope3/branches/jim-adapter/src/zope/app/publisher/fileresource.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publisher/fileresource.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/publisher/fileresource.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -21,7 +21,7 @@
 from time import time
 
 from zope.app.contenttypes import guess_content_type
-from zope.app.datetimeutils import rfc1123_date
+from zope.datetime import rfc1123_date
 
 
 class File(object):

Modified: Zope3/branches/jim-adapter/src/zope/app/publisher/xmlrpc/tests/test_directives.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publisher/xmlrpc/tests/test_directives.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/publisher/xmlrpc/tests/test_directives.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -19,12 +19,9 @@
 
 from zope.configuration import xmlconfig
 from zope.configuration.exceptions import ConfigurationError
-from zope.app.component.tests.views import IC, V1
+from zope.app.component.tests.views import Request, IC, V1
 from zope.app.testing.placelesssetup import PlacelessSetup
 from zope.security.proxy import ProxyFactory
-
-from zope.component.tests.request import Request
-
 from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest
 
 from zope.app import zapi

Modified: Zope3/branches/jim-adapter/src/zope/app/publisher/xmlrpc/tests/xmlrpc_error.zcml
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publisher/xmlrpc/tests/xmlrpc_error.zcml	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/publisher/xmlrpc/tests/xmlrpc_error.zcml	2006-04-04 15:56:58 UTC (rev 66397)
@@ -6,8 +6,8 @@
 
   <xmlrpc:view
         name="test"
-        factory="zope.component.tests.views.V1"
-        for="zope.component.tests.views.IC"
+        factory="zope.app.component.tests.views.V1"
+        for="zope.app.component.tests.views.IC"
         methods="action index"
         permission="zope.Public" />
 

Modified: Zope3/branches/jim-adapter/src/zope/app/schema/tests/test_fieldfactory.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/schema/tests/test_fieldfactory.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/schema/tests/test_fieldfactory.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -20,8 +20,7 @@
 import zope.app.schema
 
 from zope.app import zapi
-from zope.component.exceptions import ComponentLookupError
-from zope.component.interfaces import IFactory
+from zope.component.interfaces import ComponentLookupError, IFactory
 from zope.app.testing.placelesssetup import PlacelessSetup
 from zope.schema.interfaces import IField, IText
 from zope.interface import Interface

Modified: Zope3/branches/jim-adapter/src/zope/app/schema/tests/test_interfaceutility.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/schema/tests/test_interfaceutility.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/schema/tests/test_interfaceutility.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -19,11 +19,10 @@
 from zope.interface import Interface, implements
 from zope.interface.interface import InterfaceClass
 from zope.interface.interfaces import IInterface
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 
 from zope.app import zapi
 from zope.app.component.interfaces import ILocalUtility
-from zope.app.component.site import UtilityRegistration
 from zope.app.component.testing import PlacefulSetup
 from zope.app.component.interface import getInterface, searchInterface
 from zope.app.component.interfaces.registration import ActiveStatus
@@ -200,21 +199,14 @@
         default = traverse(self.rootFolder, "++etc++site/default")
         default['foo'] = Foo("local")
         foo = default['foo']
-        cm = default.registrationManager
 
         for name in ('', 'bob'):
-            registration = UtilityRegistration(name, IInterface, foo)
-            cname = cm.addRegistration(registration)
-            registration = traverse(cm, cname)
-
             gout = name and "foo global "+name or "foo global"
             self.assertEqual(sm.queryUtility(IInterface, name).foo(), gout)
-
-            registration.status = ActiveStatus
+            sm.registerUtility(foo, IInterface, name)
             self.assertEqual(
                 sm.queryUtility(IInterface, name).foo(), "foo local")
-
-            registration.status = InactiveStatus
+            sm.unregisterUtility(foo, IInterface, name)
             self.assertEqual(sm.queryUtility(IInterface, name).foo(), gout)
 
 

Modified: Zope3/branches/jim-adapter/src/zope/app/schemacontent/browser/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/schemacontent/browser/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/schemacontent/browser/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -24,7 +24,7 @@
 from zope.app.form.interfaces import IInputWidget
 from zope.app.schemacontent.interfaces import IContentComponentDefinition
 from zope.app.schemacontent.content import ContentComponentInstance
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 from zope.interface import implements
 from zope.publisher.interfaces import IPublishTraverse
 from zope.schema import getFieldsInOrder, Choice

Modified: Zope3/branches/jim-adapter/src/zope/app/schemacontent/tests/test_content.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/schemacontent/tests/test_content.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/schemacontent/tests/test_content.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,7 +17,7 @@
 """
 import unittest
 
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 from zope.interface import Interface, classImplements
 from zope.schema import Int, TextLine, Text
 

Modified: Zope3/branches/jim-adapter/src/zope/app/security/_protections.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/security/_protections.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/security/_protections.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,30 +17,19 @@
 """
 
 def protect():
-    from zope.security.checker import NoProxy
-
-    # BBB 2005/10/10 -- MessageIDs are to be removed for Zope 3.3
-    import zope.deprecation
-    zope.deprecation.__show__.off()
-    from zope.i18nmessageid import MessageID, Message
-    zope.deprecation.__show__.on()
-
     # Add message id types to the basic types, so their setting cannot be
     # overridden, once set. `protect()` was not guranteed to run after
     # zope.security.checker._clear, so that sometimes the proxies were not set.
     # This is not the ideal solution, but it is effective.
 
-    # Make sure the message id gets never proxied
-    # TODO because MessageIDs are mutable, this is a security hole.  This hole
-    # is one of the primary reasons for the development of the Message
-    # replacement.  See zope/i18nmessageid/messages.txt.
-    zope.security.checker.BasicTypes[MessageID] = NoProxy
-    # this, however, is not a security hole, because Messages are immutable.
+    # Make sure the message id gets never proxied.  This is not a
+    # security hole because Messages are immutable.
+    import zope.security.checker
+    from zope.security.checker import NoProxy
+    from zope.i18nmessageid import Message
     zope.security.checker.BasicTypes[Message] = NoProxy
 
     # add __parent__ and __name__ to always available names
-    import zope.security.checker
     for name in ['__name__', '__parent__']:
         if name not in zope.security.checker._available_by_default:
             zope.security.checker._available_by_default.append(name)
-

Modified: Zope3/branches/jim-adapter/src/zope/app/security/interfaces.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/security/interfaces.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/security/interfaces.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,20 +15,12 @@
 
 $Id$
 """
-
-import zope.deprecation
-
 from zope.interface import Interface
 from zope.schema import Text, TextLine
 from zope.security.interfaces import IPrincipal, IPermission, IGroup
 from zope.schema.interfaces import ISource
 
-# BBB : Can move away in 3.3
-zope.deprecation.__show__.off()
-from zope.exceptions import NotFoundError
-zope.deprecation.__show__.on()
-
-class PrincipalLookupError(NotFoundError):
+class PrincipalLookupError(LookupError):
     """A prncipal could not be found for a principal id
     """
 

Modified: Zope3/branches/jim-adapter/src/zope/app/security/principal.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/security/principal.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/security/principal.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,36 +15,16 @@
 
 $Id$
 """
-
-import zope.deprecation
-
-from zope.app import zapi
+from zope.component import getUtility
 from zope.app.security.interfaces import PrincipalLookupError
 from zope.app.security.interfaces import IAuthentication
 
-# BBB Backward Compatibility (Can go away in 3.3)
-zope.deprecation.__show__.off()
-from zope.exceptions import NotFoundError
-zope.deprecation.__show__.on()
-
-import warnings
-
 def checkPrincipal(context, principal_id):
-
-    auth = zapi.getUtility(IAuthentication, context=context)
+    auth = getUtility(IAuthentication, context=context)
     try:
         if auth.getPrincipal(principal_id):
             return
     except PrincipalLookupError:
         pass
-    except NotFoundError: # BBB Backward Compatibility
-        warnings.warn(
-            "A %s instance raised a NotFoundError in "
-            "getPrincipals.  Raising NotFoundError in this "
-            "method is deprecated and will no-longer be supported "
-            "staring in Zope 3.3.  PrincipalLookupError should "
-            "be raised instead."
-            % auth.__class__.__name__,
-            DeprecationWarning)
 
     raise ValueError("Undefined principal id", principal_id)

Modified: Zope3/branches/jim-adapter/src/zope/app/security/tests/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/security/tests/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/security/tests/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -30,4 +30,4 @@
             """
             )
     gsm = zapi.getGlobalSiteManager()
-    gsm.provideUtility(IPermission, perm, perm.id)
+    gsm.registerUtility(perm, IPermission, perm.id)

Modified: Zope3/branches/jim-adapter/src/zope/app/security/tests/test_securitydirectives.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/security/tests/test_securitydirectives.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/security/tests/test_securitydirectives.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -23,7 +23,6 @@
 from zope.app.testing import ztapi
 from zope.app.testing.placelesssetup import PlacelessSetup
 
-from zope.app.servicenames import Authentication
 from zope.app.security.interfaces import IAuthentication, IPermission
 from zope.app.security.principalregistry import principalRegistry
 from zope.app.security.settings import Allow

Modified: Zope3/branches/jim-adapter/src/zope/app/security/vocabulary.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/security/vocabulary.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/security/vocabulary.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,15 +17,13 @@
 
 $Id$
 """
-import warnings
-import zope.deprecation
-
-from zope.security.checker import CheckerPublic
-from zope.app import zapi
 from zope.interface import implements, classProvides
 from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary
 from zope.schema.interfaces import ISourceQueriables
 from zope.security.interfaces import IPermission
+from zope.security.checker import CheckerPublic
+
+from zope.app import zapi
 from zope.app.security.interfaces import IAuthentication
 from zope.app.security.interfaces import PrincipalLookupError
 from zope.app.security.interfaces import IPrincipalSource
@@ -33,11 +31,6 @@
 from zope.app.component.vocabulary import UtilityVocabulary
 from zope.app.schema.interfaces import IVocabularyFactory
 
-# BBB Backward Compatibility
-zope.deprecation.__show__.off()
-from zope.exceptions import NotFoundError
-zope.deprecation.__show__.on()
-
 class PermissionsVocabulary(UtilityVocabulary):
     classProvides(IVocabularyFactory)
     interface = IPermission
@@ -164,16 +157,6 @@
             auth.getPrincipal(id)
         except PrincipalLookupError:
             return False
-        except NotFoundError: # BBB Backward Compatibility
-            warnings.warn(
-                "A %s instance raised a NotFoundError in "
-                "getPrincipals.  Raising NotFoundError in this "
-                "method is deprecated and will no-longer be supported "
-                "starting in Zope 3.3.  PrincipalLookupError should "
-                "be raised instead."
-                % auth.__class__.__name__,
-                DeprecationWarning)
-            return False
         else:
             return True
 

Modified: Zope3/branches/jim-adapter/src/zope/app/securitypolicy/browser/ftests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/securitypolicy/browser/ftests.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/securitypolicy/browser/ftests.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,12 +17,12 @@
 """
 import unittest
 
+import zope.component
 from zope.app.testing import functional
 from zope.app.security.interfaces import IPermission
 from zope.app.security.permission import Permission
 from zope.app.securitypolicy.role import Role
 from zope.app.securitypolicy.interfaces import IRole
-from zope.app.tests import ztapi
 
 
 class RolePermissionsTest(functional.BrowserTestCase):
@@ -87,7 +87,7 @@
 
     def testAllRolePermissionsFormForLocalRoles(self):
         role = Role(u"id", u"Local Role")
-        ztapi.provideUtility(IRole, role)
+        zope.component.provideUtility(role, IRole)
         self.testAllRolePermissions()
 
         response = self.publish(
@@ -98,7 +98,7 @@
 
     def testAllRolePermissionsFormForLocalPermissions(self):
         permission = Permission(u"id", u"Local Permission")
-        ztapi.provideUtility(IPermission, permission)
+        zope.component.provideUtility(permission, IPermission)
         self.testAllRolePermissions()
 
         response = self.publish(
@@ -109,7 +109,7 @@
 
     def testRolesWithPermissionsFormForLocalPermission(self):
         permission = Permission(u"id", u"Local Permission")
-        ztapi.provideUtility(IPermission, permission)
+        zope.component.provideUtility(permission, IPermission)
 
         response = self.publish(
             '/++etc++site/@@AllRolePermissions.html',

Modified: Zope3/branches/jim-adapter/src/zope/app/securitypolicy/browser/rolepermissionview.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/securitypolicy/browser/rolepermissionview.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/securitypolicy/browser/rolepermissionview.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -19,9 +19,9 @@
 
 from zope.i18n import translate
 from zope.interface import implements
+from zope.exceptions.interfaces import UserError
 
 from zope.app import zapi
-from zope.app.exception.interfaces import UserError
 from zope.app.i18n import ZopeMessageFactory as _
 from zope.app.security.settings import Unset, Allow, Deny
 from zope.app.security.interfaces import IPermission

Modified: Zope3/branches/jim-adapter/src/zope/app/securitypolicy/browser/tests/test_rolepermissionview.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/securitypolicy/browser/tests/test_rolepermissionview.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/securitypolicy/browser/tests/test_rolepermissionview.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -21,8 +21,8 @@
 from zope.i18n.interfaces import ITranslationDomain
 from zope.i18nmessageid import Message
 from zope.publisher.browser import TestRequest
+from zope.exceptions.interfaces import UserError
 
-from zope.app.exception.interfaces import UserError
 from zope.app.publisher.browser import BrowserView
 from zope.app.testing import ztapi
 from zope.app.security.permission import Permission

Modified: Zope3/branches/jim-adapter/src/zope/app/securitypolicy/role.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/securitypolicy/role.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/securitypolicy/role.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -42,11 +42,6 @@
         self.title = title
         self.description = description
 
-# BBB: Renamed component on 12/05/2004
-PersistentRole = LocalRole
-from zope.app.component.site import UtilityRegistration
-RoleRegistration = UtilityRegistration
-
 def setIdOnActivation(role, event):
     """Set the permission id upon registration activation.
 

Modified: Zope3/branches/jim-adapter/src/zope/app/servicenames.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/servicenames.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/servicenames.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,6 +15,10 @@
 
 $Id$
 """
+import warnings
+warnings.warn("This module is deprecated and will go away in Zope 3.5.",
+              DeprecationWarning, 2)
+
 from zope.component.servicenames import *
 
 Authentication = 'Authentication'

Modified: Zope3/branches/jim-adapter/src/zope/app/session/http.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/session/http.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/session/http.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -21,7 +21,6 @@
 from zope.app.i18n import ZopeMessageFactory as _
 from zope.app import zapi
 from zope.app.session.interfaces import IClientIdManager
-from zope.app.component.interfaces import ILocalUtility
 from zope import schema
 from zope.interface import implements
 from zope.app.http.httpdate import build_http_date
@@ -73,9 +72,7 @@
 class CookieClientIdManager(Persistent):
     """Session utility implemented using cookies."""
 
-    implements(IClientIdManager, ICookieClientIdManager,
-               ILocalUtility, IAttributeAnnotatable,
-               )
+    implements(IClientIdManager, ICookieClientIdManager, IAttributeAnnotatable)
 
     __parent__ = __name__ = None
 

Modified: Zope3/branches/jim-adapter/src/zope/app/session/session.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/session/session.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/session/session.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -26,7 +26,6 @@
 from zope.component import ComponentLookupError
 from zope.app.zapi import getUtility
 from BTrees.OOBTree import OOBTree
-from zope.app.component.interfaces import ILocalUtility
 from zope.app.annotation.interfaces import IAttributeAnnotatable
 
 from interfaces import \
@@ -73,7 +72,7 @@
     """A SessionDataContainer that stores data in the ZODB"""
     __parent__ = __name__ = None
 
-    implements(ISessionDataContainer, ILocalUtility, IAttributeAnnotatable)
+    implements(ISessionDataContainer, IAttributeAnnotatable)
 
     _v_last_sweep = 0 # Epoch time sweep last run
 

Modified: Zope3/branches/jim-adapter/src/zope/app/site/interfaces.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/site/interfaces.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/site/interfaces.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -29,13 +29,7 @@
            'This interface has been moved to zope.app.component.interfaces. '
            'The reference will be gone in Zope 3.3.')
 
-ISiteManager = ILocalSiteManager
 
-deprecated('ISiteManager',
-           'This interface has been moved to zope.app.component.interfaces '
-           'and been renamed ISiteManager. '
-           'The reference will be gone in Zope 3.3.')
-
 class ILocalService(registration.IRegisterable):
     """A local service isn't a local service if it doesn't implement this.
 

Modified: Zope3/branches/jim-adapter/src/zope/app/sqlexpr/sqlexpr.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/sqlexpr/sqlexpr.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/sqlexpr/sqlexpr.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,12 +15,13 @@
 
 $Id$
 """
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 from zope.interface import implements
 from zope.tales.interfaces import ITALESExpression
 from zope.tales.expressions import StringExpr
+from zope.exceptions.interfaces import UserError 
+
 from zope.app import zapi
-from zope.app.exception.interfaces import UserError 
 from zope.app.rdb import queryForResults
 from zope.app.rdb.interfaces import IZopeDatabaseAdapter, IZopeConnection
 

Modified: Zope3/branches/jim-adapter/src/zope/app/sqlexpr/tests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/sqlexpr/tests.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/sqlexpr/tests.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -20,7 +20,7 @@
 from zope.interface import implements
 from zope.component.factory import Factory
 from zope.component.interfaces import IFactory
-from zope.component.tests.placelesssetup import PlacelessSetup
+from zope.component.testing import PlacelessSetup
 from zope.tales.tests.test_expressions import Data
 from zope.tales.engine import Engine
 

Copied: Zope3/branches/jim-adapter/src/zope/app/testing/back35.py (from rev 66386, Zope3/branches/jim-adapter/src/zope/app/testing/back35.py)

Modified: Zope3/branches/jim-adapter/src/zope/app/testing/functional.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/testing/functional.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/testing/functional.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -32,7 +32,7 @@
 from ZODB.DemoStorage import DemoStorage
 
 from zope import interface, component
-from zope.publisher.browser import BrowserRequest
+from zope.publisher.browser import BrowserRequest, setDefaultSkin
 from zope.publisher.http import HTTPRequest
 from zope.publisher.publish import publish
 from zope.publisher.xmlrpc import XMLRPCRequest
@@ -44,7 +44,7 @@
 from zope.app import zapi
 from zope.app.debug import Debugger
 from zope.app.publication.http import HTTPPublication
-from zope.app.publication.browser import BrowserPublication, setDefaultSkin
+from zope.app.publication.browser import BrowserPublication
 from zope.app.publication.xmlrpc import XMLRPCPublication
 from zope.app.publication.soap import SOAPPublication
 from zope.app.publication.interfaces import ISOAPRequestFactory

Modified: Zope3/branches/jim-adapter/src/zope/app/testing/placelesssetup.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/testing/placelesssetup.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/testing/placelesssetup.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,8 +17,7 @@
 """
 from zope.app.testing import ztapi
 from zope.schema.vocabulary import setVocabularyRegistry
-from zope.component.tests.placelesssetup \
-    import PlacelessSetup as CAPlacelessSetup
+from zope.component.testing import PlacelessSetup as CAPlacelessSetup
 from zope.app.event.tests.placelesssetup \
     import PlacelessSetup as EventPlacelessSetup
 from zope.app.i18n.tests.placelesssetup \

Modified: Zope3/branches/jim-adapter/src/zope/app/testing/setup.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/testing/setup.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/testing/setup.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -21,45 +21,14 @@
 from zope.app.testing import ztapi
 from zope.interface import classImplements
 
+import zope.deferredimport
 
-#############################################################################
-# BBB: Goes away in 3.3
+zope.deferredimport.deprecatedFrom(
+    "Goes away in Zope 3.5",
+    "zope.app.testing.back35",
+    "addService",
+    )
 
-import zope.deprecation
-
-zope.deprecation.__show__.off()
-from zope.component.bbb.service import IService
-from zope.app.site.interfaces import ISimpleService
-zope.deprecation.__show__.on()
-
-from zope.app.component.site import UtilityRegistration
-
-def addService(servicemanager, name, service, suffix=''):
-    """Add a service to a service manager
-
-    This utility is useful for tests that need to set up services.
-    """
-    # Most local services implement ISimpleService in ZCML; therefore make
-    # sure we got it here as well.
-    zope.interface.directlyProvides(service, ISimpleService)
-
-    default = zapi.traverse(servicemanager, 'default')
-    default[name+suffix] = service
-    registration = UtilityRegistration(name, IService, service, default)
-    key = default.registrationManager.addRegistration(registration)
-    zapi.traverse(default.registrationManager, key).status = ActiveStatus
-    return default[name+suffix]
-
-def createServiceManager(folder, setsite=False):
-    return createSiteManager(folder, setsite)
-
-zope.deprecation.deprecated(
-    'createServiceManager',
-    '`ServiceManager`s became `SiteManager`s. Use `createSiteManager` '
-    'instead. Gone in Zope 3.3.')
-
-#############################################################################
-
 #------------------------------------------------------------------------
 # Annotations
 from zope.app.annotation.attribute import AttributeAnnotations
@@ -78,16 +47,6 @@
                          Dependable)
 
 #------------------------------------------------------------------------
-# Registrations
-
-from zope.app.component.interfaces.registration import IComponentRegistration
-from zope.app.component.interfaces.registration import IRegistrationEvent
-from zope.app.component.registration import componentRegistrationEventNotify
-def setUpRegistered():
-    ztapi.subscribe((IComponentRegistration, IRegistrationEvent), None,
-                     componentRegistrationEventNotify)
-
-#------------------------------------------------------------------------
 # Traversal
 from zope.app.traversing.browser.interfaces import IAbsoluteURL
 from zope.app.container.traversal import ContainerTraversable
@@ -128,10 +87,10 @@
 #------------------------------------------------------------------------
 # ISiteManager lookup
 from zope.app.component.site import SiteManagerAdapter
-from zope.component.interfaces import ISiteManager
+from zope.component.interfaces import IComponentLookup
 from zope.interface import Interface
 def setUpSiteManagerLookup():
-    ztapi.provideAdapter(Interface, ISiteManager, SiteManagerAdapter)
+    ztapi.provideAdapter(Interface, IComponentLookup, SiteManagerAdapter)
 
 #------------------------------------------------------------------------
 # Placeful setup
@@ -143,7 +102,6 @@
     zope.app.component.hooks.setHooks()
     setUpAnnotations()
     setUpDependable()
-    setUpRegistered()
     setUpTraversal()
     setUpSiteManagerLookup()
 
@@ -215,20 +173,17 @@
 
 #------------------------------------------------------------------------
 # Local Utility Addition
-from zope.app.component.site import UtilityRegistration
-from zope.app.component.interfaces.registration import ActiveStatus
 def addUtility(sitemanager, name, iface, utility, suffix=''):
     """Add a utility to a site manager
 
     This helper function is useful for tests that need to set up utilities.
     """
     folder_name = (name or (iface.__name__ + 'Utility')) + suffix
-    default = zapi.traverse(sitemanager, 'default')
+    default = sitemanager['default']
     default[folder_name] = utility
-    registration = UtilityRegistration(name, iface, default[folder_name])
-    key = default.registrationManager.addRegistration(registration)
-    zapi.traverse(default.registrationManager, key).status = ActiveStatus
-    return default[folder_name]
+    utility = default[folder_name]
+    sitemanager.registerUtility(utility, iface, name)
+    return utility
 
 
 #------------------------------------------------------------------------

Modified: Zope3/branches/jim-adapter/src/zope/app/testing/ztapi.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/testing/ztapi.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/testing/ztapi.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -72,19 +72,19 @@
     elif not isinstance(required, stypes):
         required = (required,)
 
-    gsm.provideAdapter(required, provided, name, factory)
+    gsm.registerAdapter(factory, required, provided, name)
 
 def subscribe(required, provided, factory):
     gsm = zapi.getGlobalSiteManager()
-    gsm.subscribe(required, provided, factory)
+    if provided is None:
+        gsm.registerHandler(factory, required)
+    else:
+        gsm.registerSubscriptionAdapter(factory, required, provided)
+        
 
-# BBB: Deprecated. Gone in 3.3
-def handle(required, handler):
-    subscribe(required, None, handler)
-
 def provideUtility(provided, component, name=''):
     gsm = zapi.getGlobalSiteManager()
-    gsm.provideUtility(provided, component, name)
+    gsm.registerUtility(component, provided, name)
 
 def unprovideUtility(provided, name=''):
     gsm = zapi.getGlobalSiteManager()

Deleted: Zope3/branches/jim-adapter/src/zope/app/timezones.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/timezones.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/timezones.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,1202 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2003 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-""" Historical timezone data, ported from Zope2's DateTime.DateTimeZone.
-
-$Id$
-"""
-
-historical_zone_info = {
-'Brazil/Acre': ('Brazil/Acre', 101, 2,
-[ '561970800', '571644000', '593420400', '603093600', '625561200',
-'634543200', '656924400', '665992800', '688374000', '697442400',
-'719823600', '729496800', '751273200', '760946400', '782722800',
-'792396000', '814863600', '823845600', '846226800', '855295200',
-'877676400', '887436000', '909126000', '918799200', '940575600',
-'950248800', '972716400', '981698400', '1004079600', '1013148000',
-'1035529200', '1044597600', '1066978800', '1076738400', '1098428400',
-'1108101600', '1129878000', '1139551200', '1162018800', '1171000800',
-'1193382000', '1202450400', '1224831600', '1234591200', '1256281200',
-'1265954400', '1287730800', '1297404000', '1319180400', '1328853600',
-'1351234800', '1360303200', '1382684400', '1391752800', '1414134000',
-'1423893600', '1445583600', '1455256800', '1477033200', '1486706400',
-'1509174000', '1518156000', '1540537200', '1549605600', '1571986800',
-'1581055200', '1603436400', '1613109600', '1634886000', '1644559200',
-'1666335600', '1676008800', '1698476400', '1707458400', '1729839600',
-'1738908000', '1761289200', '1771048800', '1792738800', '1802412000',
-'1824188400', '1833861600', '1856329200', '1865311200', '1887692400',
-'1896760800', '1919142000', '1928210400', '1950591600', '1960351200',
-'1982041200', '1991714400', '2013490800', '2023164000', '2045631600',
-'2054613600', '2076994800', '2086063200', '2108444400', '2118204000',
-'2139894000',
-],
-'\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-18000, 0, 0), (-14400, 1, 4)], 'AST\x00ADT\x00'),
-'Brazil/DeNoronha': ('Brazil/DeNoronha', 101, 2,
-[ '561960000', '571633200', '593409600', '603082800', '625550400',
-'634532400', '656913600', '665982000', '688363200', '697431600',
-'719812800', '729486000', '751262400', '760935600', '782712000',
-'792385200', '814852800', '823834800', '846216000', '855284400',
-'877665600', '887425200', '909115200', '918788400', '940564800',
-'950238000', '972705600', '981687600', '1004068800', '1013137200',
-'1035518400', '1044586800', '1066968000', '1076727600', '1098417600',
-'1108090800', '1129867200', '1139540400', '1162008000', '1170990000',
-'1193371200', '1202439600', '1224820800', '1234580400', '1256270400',
-'1265943600', '1287720000', '1297393200', '1319169600', '1328842800',
-'1351224000', '1360292400', '1382673600', '1391742000', '1414123200',
-'1423882800', '1445572800', '1455246000', '1477022400', '1486695600',
-'1509163200', '1518145200', '1540526400', '1549594800', '1571976000',
-'1581044400', '1603425600', '1613098800', '1634875200', '1644548400',
-'1666324800', '1675998000', '1698465600', '1707447600', '1729828800',
-'1738897200', '1761278400', '1771038000', '1792728000', '1802401200',
-'1824177600', '1833850800', '1856318400', '1865300400', '1887681600',
-'1896750000', '1919131200', '1928199600', '1950580800', '1960340400',
-'1982030400', '1991703600', '2013480000', '2023153200', '2045620800',
-'2054602800', '2076984000', '2086052400', '2108433600', '2118193200',
-'2139883200',
-],
-'\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-7200, 0, 0), (-3600, 1, 4)], 'FST\x00FDT\x00'),
-'Brazil/East': ('Brazil/East', 101, 2,
-[ '561963600', '571636800', '593413200', '603086400', '625554000',
-'634536000', '656917200', '665985600', '688366800', '697435200',
-'719816400', '729489600', '751266000', '760939200', '782715600',
-'792388800', '814856400', '823838400', '846219600', '855288000',
-'877669200', '887428800', '909118800', '918792000', '940568400',
-'950241600', '972709200', '981691200', '1004072400', '1013140800',
-'1035522000', '1044590400', '1066971600', '1076731200', '1098421200',
-'1108094400', '1129870800', '1139544000', '1162011600', '1170993600',
-'1193374800', '1202443200', '1224824400', '1234584000', '1256274000',
-'1265947200', '1287723600', '1297396800', '1319173200', '1328846400',
-'1351227600', '1360296000', '1382677200', '1391745600', '1414126800',
-'1423886400', '1445576400', '1455249600', '1477026000', '1486699200',
-'1509166800', '1518148800', '1540530000', '1549598400', '1571979600',
-'1581048000', '1603429200', '1613102400', '1634878800', '1644552000',
-'1666328400', '1676001600', '1698469200', '1707451200', '1729832400',
-'1738900800', '1761282000', '1771041600', '1792731600', '1802404800',
-'1824181200', '1833854400', '1856322000', '1865304000', '1887685200',
-'1896753600', '1919134800', '1928203200', '1950584400', '1960344000',
-'1982034000', '1991707200', '2013483600', '2023156800', '2045624400',
-'2054606400', '2076987600', '2086056000', '2108437200', '2118196800',
-'2139886800',
-],
-'\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-10800, 0, 0), (-7200, 1, 4)], 'EST\x00EDT\x00'),
-'Brazil/West': ('Brazil/West', 101, 2,
-[ '561967200', '571640400', '593416800', '603090000', '625557600',
-'634539600', '656920800', '665989200', '688370400', '697438800',
-'719820000', '729493200', '751269600', '760942800', '782719200',
-'792392400', '814860000', '823842000', '846223200', '855291600',
-'877672800', '887432400', '909122400', '918795600', '940572000',
-'950245200', '972712800', '981694800', '1004076000', '1013144400',
-'1035525600', '1044594000', '1066975200', '1076734800', '1098424800',
-'1108098000', '1129874400', '1139547600', '1162015200', '1170997200',
-'1193378400', '1202446800', '1224828000', '1234587600', '1256277600',
-'1265950800', '1287727200', '1297400400', '1319176800', '1328850000',
-'1351231200', '1360299600', '1382680800', '1391749200', '1414130400',
-'1423890000', '1445580000', '1455253200', '1477029600', '1486702800',
-'1509170400', '1518152400', '1540533600', '1549602000', '1571983200',
-'1581051600', '1603432800', '1613106000', '1634882400', '1644555600',
-'1666332000', '1676005200', '1698472800', '1707454800', '1729836000',
-'1738904400', '1761285600', '1771045200', '1792735200', '1802408400',
-'1824184800', '1833858000', '1856325600', '1865307600', '1887688800',
-'1896757200', '1919138400', '1928206800', '1950588000', '1960347600',
-'1982037600', '1991710800', '2013487200', '2023160400', '2045628000',
-'2054610000', '2076991200', '2086059600', '2108440800', '2118200400',
-'2139890400',
-],
-'\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-14400, 0, 0), (-10800, 1, 4)], 'WST\x00WDT\x00'),
-'Canada/Atlantic': ('Canada/Atlantic', 138, 2,
-[ '-21492000', '-5770800', '9957600', '25678800', '41407200',
-'57733200', '73461600', '89182800', '104911200', '120632400',
-'136360800', '152082000', '167810400', '183531600', '199260000',
-'215586000', '230709600', '247035600', '262764000', '278485200',
-'294213600', '309934800', '325663200', '341384400', '357112800',
-'372834000', '388562400', '404888400', '420012000', '436338000',
-'452066400', '467787600', '483516000', '499237200', '514965600',
-'530686800', '544600800', '562136400', '576050400', '594190800',
-'607500000', '625640400', '638949600', '657090000', '671004000',
-'688539600', '702453600', '719989200', '733903200', '752043600',
-'765352800', '783493200', '796802400', '814942800', '828856800',
-'846392400', '860306400', '877842000', '891756000', '909291600',
-'923205600', '941346000', '954655200', '972795600', '986104800',
-'1004245200', '1018159200', '1035694800', '1049608800', '1067144400',
-'1081058400', '1099198800', '1112508000', '1130648400', '1143957600',
-'1162098000', '1175407200', '1193547600', '1207461600', '1224997200',
-'1238911200', '1256446800', '1270360800', '1288501200', '1301810400',
-'1319950800', '1333260000', '1351400400', '1365314400', '1382850000',
-'1396764000', '1414299600', '1428213600', '1445749200', '1459663200',
-'1477803600', '1491112800', '1509253200', '1522562400', '1540702800',
-'1554616800', '1572152400', '1586066400', '1603602000', '1617516000',
-'1635656400', '1648965600', '1667106000', '1680415200', '1698555600',
-'1712469600', '1730005200', '1743919200', '1761454800', '1775368800',
-'1792904400', '1806818400', '1824958800', '1838268000', '1856408400',
-'1869717600', '1887858000', '1901772000', '1919307600', '1933221600',
-'1950757200', '1964671200', '1982811600', '1996120800', '2014261200',
-'2027570400', '2045710800', '2059020000', '2077160400', '2091074400',
-'2108610000', '2122524000', '2140059600',
-],
-'\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-10800, 1, 0), (-14400, 0, 4)], 'ADT\x00AST\x00'),
-'Canada/Central': ('Canada/Central', 138, 2,
-[ '-21484800', '-5763600', '9964800', '25686000', '41414400',
-'57740400', '73468800', '89190000', '104918400', '120639600',
-'136368000', '152089200', '167817600', '183538800', '199267200',
-'215593200', '230716800', '247042800', '262771200', '278492400',
-'294220800', '309942000', '325670400', '341391600', '357120000',
-'372841200', '388569600', '404895600', '420019200', '436345200',
-'452073600', '467794800', '483523200', '499244400', '514972800',
-'530694000', '544608000', '562143600', '576057600', '594198000',
-'607507200', '625647600', '638956800', '657097200', '671011200',
-'688546800', '702460800', '719996400', '733910400', '752050800',
-'765360000', '783500400', '796809600', '814950000', '828864000',
-'846399600', '860313600', '877849200', '891763200', '909298800',
-'923212800', '941353200', '954662400', '972802800', '986112000',
-'1004252400', '1018166400', '1035702000', '1049616000', '1067151600',
-'1081065600', '1099206000', '1112515200', '1130655600', '1143964800',
-'1162105200', '1175414400', '1193554800', '1207468800', '1225004400',
-'1238918400', '1256454000', '1270368000', '1288508400', '1301817600',
-'1319958000', '1333267200', '1351407600', '1365321600', '1382857200',
-'1396771200', '1414306800', '1428220800', '1445756400', '1459670400',
-'1477810800', '1491120000', '1509260400', '1522569600', '1540710000',
-'1554624000', '1572159600', '1586073600', '1603609200', '1617523200',
-'1635663600', '1648972800', '1667113200', '1680422400', '1698562800',
-'1712476800', '1730012400', '1743926400', '1761462000', '1775376000',
-'1792911600', '1806825600', '1824966000', '1838275200', '1856415600',
-'1869724800', '1887865200', '1901779200', '1919314800', '1933228800',
-'1950764400', '1964678400', '1982818800', '1996128000', '2014268400',
-'2027577600', '2045718000', '2059027200', '2077167600', '2091081600',
-'2108617200', '2122531200', '2140066800',
-],
-'\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-18000, 1, 0), (-21600, 0, 4)], 'CDT\x00CST\x00'),
-'Canada/East-Saskatchewan': ('Canada/East-Saskatchewan', 0, 1,
-[ ],
-'',
-[(-21600, 0, 0)], 'CST\x00'),
-'Canada/Eastern': ('Canada/Eastern', 138, 2,
-[ '-21488400', '-5767200', '9961200', '25682400', '41410800',
-'57736800', '73465200', '89186400', '104914800', '120636000',
-'136364400', '152085600', '167814000', '183535200', '199263600',
-'215589600', '230713200', '247039200', '262767600', '278488800',
-'294217200', '309938400', '325666800', '341388000', '357116400',
-'372837600', '388566000', '404892000', '420015600', '436341600',
-'452070000', '467791200', '483519600', '499240800', '514969200',
-'530690400', '544604400', '562140000', '576054000', '594194400',
-'607503600', '625644000', '638953200', '657093600', '671007600',
-'688543200', '702457200', '719992800', '733906800', '752047200',
-'765356400', '783496800', '796806000', '814946400', '828860400',
-'846396000', '860310000', '877845600', '891759600', '909295200',
-'923209200', '941349600', '954658800', '972799200', '986108400',
-'1004248800', '1018162800', '1035698400', '1049612400', '1067148000',
-'1081062000', '1099202400', '1112511600', '1130652000', '1143961200',
-'1162101600', '1175410800', '1193551200', '1207465200', '1225000800',
-'1238914800', '1256450400', '1270364400', '1288504800', '1301814000',
-'1319954400', '1333263600', '1351404000', '1365318000', '1382853600',
-'1396767600', '1414303200', '1428217200', '1445752800', '1459666800',
-'1477807200', '1491116400', '1509256800', '1522566000', '1540706400',
-'1554620400', '1572156000', '1586070000', '1603605600', '1617519600',
-'1635660000', '1648969200', '1667109600', '1680418800', '1698559200',
-'1712473200', '1730008800', '1743922800', '1761458400', '1775372400',
-'1792908000', '1806822000', '1824962400', '1838271600', '1856412000',
-'1869721200', '1887861600', '1901775600', '1919311200', '1933225200',
-'1950760800', '1964674800', '1982815200', '1996124400', '2014264800',
-'2027574000', '2045714400', '2059023600', '2077164000', '2091078000',
-'2108613600', '2122527600', '2140063200',
-],
-'\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-14400, 1, 0), (-18000, 0, 4)], 'EDT\x00EST\x00'),
-'Canada/Mountain': ('Canada/Mountain', 138, 2,
-[ '-21481200', '-5760000', '9968400', '25689600', '41418000',
-'57744000', '73472400', '89193600', '104922000', '120643200',
-'136371600', '152092800', '167821200', '183542400', '199270800',
-'215596800', '230720400', '247046400', '262774800', '278496000',
-'294224400', '309945600', '325674000', '341395200', '357123600',
-'372844800', '388573200', '404899200', '420022800', '436348800',
-'452077200', '467798400', '483526800', '499248000', '514976400',
-'530697600', '544611600', '562147200', '576061200', '594201600',
-'607510800', '625651200', '638960400', '657100800', '671014800',
-'688550400', '702464400', '720000000', '733914000', '752054400',
-'765363600', '783504000', '796813200', '814953600', '828867600',
-'846403200', '860317200', '877852800', '891766800', '909302400',
-'923216400', '941356800', '954666000', '972806400', '986115600',
-'1004256000', '1018170000', '1035705600', '1049619600', '1067155200',
-'1081069200', '1099209600', '1112518800', '1130659200', '1143968400',
-'1162108800', '1175418000', '1193558400', '1207472400', '1225008000',
-'1238922000', '1256457600', '1270371600', '1288512000', '1301821200',
-'1319961600', '1333270800', '1351411200', '1365325200', '1382860800',
-'1396774800', '1414310400', '1428224400', '1445760000', '1459674000',
-'1477814400', '1491123600', '1509264000', '1522573200', '1540713600',
-'1554627600', '1572163200', '1586077200', '1603612800', '1617526800',
-'1635667200', '1648976400', '1667116800', '1680426000', '1698566400',
-'1712480400', '1730016000', '1743930000', '1761465600', '1775379600',
-'1792915200', '1806829200', '1824969600', '1838278800', '1856419200',
-'1869728400', '1887868800', '1901782800', '1919318400', '1933232400',
-'1950768000', '1964682000', '1982822400', '1996131600', '2014272000',
-'2027581200', '2045721600', '2059030800', '2077171200', '2091085200',
-'2108620800', '2122534800', '2140070400',
-],
-'\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-21600, 1, 0), (-25200, 0, 4)], 'MDT\x00MST\x00'),
-'Canada/Newfoundland': ('Canada/Newfoundland', 138, 2,
-[ '-21493800', '-5772600', '9955800', '25677000', '41405400',
-'57731400', '73459800', '89181000', '104909400', '120630600',
-'136359000', '152080200', '167808600', '183529800', '199258200',
-'215584200', '230707800', '247033800', '262762200', '278483400',
-'294211800', '309933000', '325661400', '341382600', '357111000',
-'372832200', '388560600', '404886600', '420010200', '436336200',
-'452064600', '467785800', '483514200', '499235400', '514963800',
-'530685000', '544599000', '562134600', '576048600', '594189000',
-'607498200', '625638600', '638947800', '657088200', '671002200',
-'688537800', '702451800', '719987400', '733901400', '752041800',
-'765351000', '783491400', '796800600', '814941000', '828855000',
-'846390600', '860304600', '877840200', '891754200', '909289800',
-'923203800', '941344200', '954653400', '972793800', '986103000',
-'1004243400', '1018157400', '1035693000', '1049607000', '1067142600',
-'1081056600', '1099197000', '1112506200', '1130646600', '1143955800',
-'1162096200', '1175405400', '1193545800', '1207459800', '1224995400',
-'1238909400', '1256445000', '1270359000', '1288499400', '1301808600',
-'1319949000', '1333258200', '1351398600', '1365312600', '1382848200',
-'1396762200', '1414297800', '1428211800', '1445747400', '1459661400',
-'1477801800', '1491111000', '1509251400', '1522560600', '1540701000',
-'1554615000', '1572150600', '1586064600', '1603600200', '1617514200',
-'1635654600', '1648963800', '1667104200', '1680413400', '1698553800',
-'1712467800', '1730003400', '1743917400', '1761453000', '1775367000',
-'1792902600', '1806816600', '1824957000', '1838266200', '1856406600',
-'1869715800', '1887856200', '1901770200', '1919305800', '1933219800',
-'1950755400', '1964669400', '1982809800', '1996119000', '2014259400',
-'2027568600', '2045709000', '2059018200', '2077158600', '2091072600',
-'2108608200', '2122522200', '2140057800',
-],
-'\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-9000, 1, 0), (-12600, 0, 4)], 'NDT\x00NST\x00'),
-'Canada/Pacific': ('Canada/Pacific', 138, 2,
-[ '-21477600', '-5756400', '9972000', '25693200', '41421600',
-'57747600', '73476000', '89197200', '104925600', '120646800',
-'136375200', '152096400', '167824800', '183546000', '199274400',
-'215600400', '230724000', '247050000', '262778400', '278499600',
-'294228000', '309949200', '325677600', '341398800', '357127200',
-'372848400', '388576800', '404902800', '420026400', '436352400',
-'452080800', '467802000', '483530400', '499251600', '514980000',
-'530701200', '544615200', '562150800', '576064800', '594205200',
-'607514400', '625654800', '638964000', '657104400', '671018400',
-'688554000', '702468000', '720003600', '733917600', '752058000',
-'765367200', '783507600', '796816800', '814957200', '828871200',
-'846406800', '860320800', '877856400', '891770400', '909306000',
-'923220000', '941360400', '954669600', '972810000', '986119200',
-'1004259600', '1018173600', '1035709200', '1049623200', '1067158800',
-'1081072800', '1099213200', '1112522400', '1130662800', '1143972000',
-'1162112400', '1175421600', '1193562000', '1207476000', '1225011600',
-'1238925600', '1256461200', '1270375200', '1288515600', '1301824800',
-'1319965200', '1333274400', '1351414800', '1365328800', '1382864400',
-'1396778400', '1414314000', '1428228000', '1445763600', '1459677600',
-'1477818000', '1491127200', '1509267600', '1522576800', '1540717200',
-'1554631200', '1572166800', '1586080800', '1603616400', '1617530400',
-'1635670800', '1648980000', '1667120400', '1680429600', '1698570000',
-'1712484000', '1730019600', '1743933600', '1761469200', '1775383200',
-'1792918800', '1806832800', '1824973200', '1838282400', '1856422800',
-'1869732000', '1887872400', '1901786400', '1919322000', '1933236000',
-'1950771600', '1964685600', '1982826000', '1996135200', '2014275600',
-'2027584800', '2045725200', '2059034400', '2077174800', '2091088800',
-'2108624400', '2122538400', '2140074000',
-],
-'\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-25200, 1, 0), (-28800, 0, 4)], 'PDT\x00PST\x00'),
-'Canada/Yukon': ('Canada/Yukon', 138, 2,
-[ '-21474000', '-5752800', '9975600', '25696800', '41425200',
-'57751200', '73479600', '89200800', '104929200', '120650400',
-'136378800', '152100000', '167828400', '183549600', '199278000',
-'215604000', '230727600', '247053600', '262782000', '278503200',
-'294231600', '309952800', '325681200', '341402400', '357130800',
-'372852000', '388580400', '404906400', '420030000', '436356000',
-'452084400', '467805600', '483534000', '499255200', '514983600',
-'530704800', '544618800', '562154400', '576068400', '594208800',
-'607518000', '625658400', '638967600', '657108000', '671022000',
-'688557600', '702471600', '720007200', '733921200', '752061600',
-'765370800', '783511200', '796820400', '814960800', '828874800',
-'846410400', '860324400', '877860000', '891774000', '909309600',
-'923223600', '941364000', '954673200', '972813600', '986122800',
-'1004263200', '1018177200', '1035712800', '1049626800', '1067162400',
-'1081076400', '1099216800', '1112526000', '1130666400', '1143975600',
-'1162116000', '1175425200', '1193565600', '1207479600', '1225015200',
-'1238929200', '1256464800', '1270378800', '1288519200', '1301828400',
-'1319968800', '1333278000', '1351418400', '1365332400', '1382868000',
-'1396782000', '1414317600', '1428231600', '1445767200', '1459681200',
-'1477821600', '1491130800', '1509271200', '1522580400', '1540720800',
-'1554634800', '1572170400', '1586084400', '1603620000', '1617534000',
-'1635674400', '1648983600', '1667124000', '1680433200', '1698573600',
-'1712487600', '1730023200', '1743937200', '1761472800', '1775386800',
-'1792922400', '1806836400', '1824976800', '1838286000', '1856426400',
-'1869735600', '1887876000', '1901790000', '1919325600', '1933239600',
-'1950775200', '1964689200', '1982829600', '1996138800', '2014279200',
-'2027588400', '2045728800', '2059038000', '2077178400', '2091092400',
-'2108628000', '2122542000', '2140077600',
-],
-'\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-28800, 1, 0), (-32400, 0, 4)], 'YDT\x00YST\x00'),
-'Chile/Continental': ('Chile/Continental', 121, 2,
-[ '245217600', '258519600', '276667200', '289969200', '308721600',
-'321418800', '340171200', '352868400', '371620800', '384922800',
-'403070400', '416372400', '434520000', '447822000', '466574400',
-'479271600', '498024000', '510721200', '529473600', '542170800',
-'560923200', '574225200', '592372800', '605674800', '623822400',
-'637124400', '655876800', '668574000', '687326400', '700023600',
-'718776000', '732078000', '750225600', '763527600', '781675200',
-'794977200', '813124800', '826426800', '845179200', '857876400',
-'876628800', '889326000', '908078400', '921380400', '939528000',
-'952830000', '970977600', '984279600', '1003032000', '1015729200',
-'1034481600', '1047178800', '1065931200', '1079233200', '1097380800',
-'1110682800', '1128830400', '1142132400', '1160280000', '1173582000',
-'1192334400', '1205031600', '1223784000', '1236481200', '1255233600',
-'1268535600', '1286683200', '1299985200', '1318132800', '1331434800',
-'1350187200', '1362884400', '1381636800', '1394334000', '1413086400',
-'1425783600', '1444536000', '1457838000', '1475985600', '1489287600',
-'1507435200', '1520737200', '1539489600', '1552186800', '1570939200',
-'1583636400', '1602388800', '1615690800', '1633838400', '1647140400',
-'1665288000', '1678590000', '1696737600', '1710039600', '1728792000',
-'1741489200', '1760241600', '1772938800', '1791691200', '1804993200',
-'1823140800', '1836442800', '1854590400', '1867892400', '1886644800',
-'1899342000', '1918094400', '1930791600', '1949544000', '1962846000',
-'1980993600', '1994295600', '2012443200', '2025745200', '2043892800',
-'2057194800', '2075947200', '2088644400', '2107396800', '2120094000',
-'2138846400',
-],
-'\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00',
-[(-10800, 1, 0), (-14400, 0, 4)], 'CDT\x00CST\x00'),
-'Chile/EasterIsland': ('Chile/EasterIsland', 121, 2,
-[ '245224800', '258526800', '276674400', '289976400', '308728800',
-'321426000', '340178400', '352875600', '371628000', '384930000',
-'403077600', '416379600', '434527200', '447829200', '466581600',
-'479278800', '498031200', '510728400', '529480800', '542178000',
-'560930400', '574232400', '592380000', '605682000', '623829600',
-'637131600', '655884000', '668581200', '687333600', '700030800',
-'718783200', '732085200', '750232800', '763534800', '781682400',
-'794984400', '813132000', '826434000', '845186400', '857883600',
-'876636000', '889333200', '908085600', '921387600', '939535200',
-'952837200', '970984800', '984286800', '1003039200', '1015736400',
-'1034488800', '1047186000', '1065938400', '1079240400', '1097388000',
-'1110690000', '1128837600', '1142139600', '1160287200', '1173589200',
-'1192341600', '1205038800', '1223791200', '1236488400', '1255240800',
-'1268542800', '1286690400', '1299992400', '1318140000', '1331442000',
-'1350194400', '1362891600', '1381644000', '1394341200', '1413093600',
-'1425790800', '1444543200', '1457845200', '1475992800', '1489294800',
-'1507442400', '1520744400', '1539496800', '1552194000', '1570946400',
-'1583643600', '1602396000', '1615698000', '1633845600', '1647147600',
-'1665295200', '1678597200', '1696744800', '1710046800', '1728799200',
-'1741496400', '1760248800', '1772946000', '1791698400', '1805000400',
-'1823148000', '1836450000', '1854597600', '1867899600', '1886652000',
-'1899349200', '1918101600', '1930798800', '1949551200', '1962853200',
-'1981000800', '1994302800', '2012450400', '2025752400', '2043900000',
-'2057202000', '2075954400', '2088651600', '2107404000', '2120101200',
-'2138853600',
-],
-'\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00',
-[(-18000, 1, 0), (-21600, 0, 4)], 'EDT\x00EST\x00'),
-'Cuba': ('Cuba', 118, 2,
-[ '290581200', '308721600', '322030800', '340171200', '358318800',
-'371620800', '389768400', '403070400', '421218000', '434520000',
-'453272400', '466574400', '484722000', '498024000', '516171600',
-'529473600', '547621200', '560923200', '579070800', '592372800',
-'611125200', '623822400', '642574800', '655876800', '674024400',
-'687326400', '705474000', '718776000', '736923600', '750225600',
-'768373200', '781675200', '800427600', '813124800', '831877200',
-'845179200', '863326800', '876628800', '894776400', '908078400',
-'926226000', '939528000', '958280400', '970977600', '989730000',
-'1003032000', '1021179600', '1034481600', '1052629200', '1065931200',
-'1084078800', '1097380800', '1115528400', '1128830400', '1147582800',
-'1160280000', '1179032400', '1192334400', '1210482000', '1223784000',
-'1241931600', '1255233600', '1273381200', '1286683200', '1304830800',
-'1318132800', '1336885200', '1350187200', '1368334800', '1381636800',
-'1399784400', '1413086400', '1431234000', '1444536000', '1462683600',
-'1475985600', '1494738000', '1507435200', '1526187600', '1539489600',
-'1557637200', '1570939200', '1589086800', '1602388800', '1620536400',
-'1633838400', '1651986000', '1665288000', '1684040400', '1696737600',
-'1715490000', '1728792000', '1746939600', '1760241600', '1778389200',
-'1791691200', '1809838800', '1823140800', '1841893200', '1854590400',
-'1873342800', '1886644800', '1904792400', '1918094400', '1936242000',
-'1949544000', '1967691600', '1980993600', '1999141200', '2012443200',
-'2031195600', '2043892800', '2062645200', '2075947200', '2094094800',
-'2107396800', '2125544400', '2138846400',
-],
-'\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-14400, 1, 0), (-18000, 0, 4)], 'CDT\x00CST\x00'),
-'Egypt': ('Egypt', 152, 2,
-[ '-305164800', '-291949200', '-273628800', '-260413200', '-242092800',
-'-228877200', '-210556800', '-197341200', '-178934400', '-165718800',
-'-147398400', '-134182800', '-115862400', '-102646800', '-84326400',
-'-71110800', '-52704000', '-39488400', '-21168000', '-7952400',
-'10368000', '23583600', '41904000', '55119600', '73526400',
-'86742000', '105062400', '118278000', '136598400', '149814000',
-'168134400', '181350000', '199756800', '212972400', '231292800',
-'244508400', '262828800', '276044400', '294364800', '307580400',
-'325987200', '339202800', '420595200', '433810800', '452217600',
-'465433200', '483753600', '496969200', '515289600', '528505200',
-'546825600', '560041200', '578448000', '591663600', '609984000',
-'623199600', '641520000', '654735600', '673056000', '686271600',
-'704678400', '717894000', '736214400', '749430000', '767750400',
-'780966000', '799286400', '812502000', '830908800', '844124400',
-'862444800', '875660400', '893980800', '907196400', '925516800',
-'938732400', '957139200', '970354800', '988675200', '1001890800',
-'1020211200', '1033426800', '1051747200', '1064962800', '1083369600',
-'1096585200', '1114905600', '1128121200', '1146441600', '1159657200',
-'1177977600', '1191193200', '1209600000', '1222815600', '1241136000',
-'1254351600', '1272672000', '1285887600', '1304208000', '1317423600',
-'1335830400', '1349046000', '1367366400', '1380582000', '1398902400',
-'1412118000', '1430438400', '1443654000', '1462060800', '1475276400',
-'1493596800', '1506812400', '1525132800', '1538348400', '1556668800',
-'1569884400', '1588291200', '1601506800', '1619827200', '1633042800',
-'1651363200', '1664578800', '1682899200', '1696114800', '1714521600',
-'1727737200', '1746057600', '1759273200', '1777593600', '1790809200',
-'1809129600', '1822345200', '1840752000', '1853967600', '1872288000',
-'1885503600', '1903824000', '1917039600', '1935360000', '1948575600',
-'1966982400', '1980198000', '1998518400', '2011734000', '2030054400',
-'2043270000', '2061590400', '2074806000', '2093212800', '2106428400',
-'2124748800', '2137964400',
-],
-'\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(10800, 1, 0), (7200, 0, 8)], 'EET DST\x00EET\x00'),
-'GB-Eire': ('GB-Eire', 241, 4,
-[ '-1697238000', '-1680476400', '-1664146800', '-1650150000', '-1633906800',
-'-1617490800', '-1601852400', '-1586041200', '-1570402800', '-1552172400',
-'-1538348400', '-1522537200', '-1507503600', '-1490569200', '-1473634800',
-'-1458342000', '-1441321200', '-1428879600', '-1410735600', '-1396220400',
-'-1379286000', '-1364770800', '-1347836400', '-1333321200', '-1316386800',
-'-1301266800', '-1284332400', '-1269817200', '-1252882800', '-1238367600',
-'-1221433200', '-1206918000', '-1189983600', '-1175468400', '-1158534000',
-'-1144018800', '-1127084400', '-1111964400', '-1095030000', '-1080514800',
-'-1063580400', '-1049065200', '-1032130800', '-1017615600', '-1000681200',
-'-986166000', '-969231600', '-950482800', '-942015600', '-904518000',
-'-896050800', '-875487600', '-864601200', '-844038000', '-832546800',
-'-812588400', '-798073200', '-781052400', '-772066800', '-764809200',
-'-748479600', '-733359600', '-719449200', '-717030000', '-706748400',
-'-699490800', '-687999600', '-668041200', '-654735600', '-636591600',
-'-622076400', '-605746800', '-590626800', '-574297200', '-558572400',
-'-542242800', '-527122800', '-512607600', '-496278000', '-481158000',
-'-464223600', '-449708400', '-432774000', '-417654000', '-401324400',
-'-386204400', '-369270000', '-354754800', '-337820400', '-323305200',
-'-306975600', '-291855600', '-276735600', '-257986800', '-245286000',
-'-226537200', '-213231600', '-195087600', '-182386800', '-163638000',
-'-150937200', '-132188400', '-119487600', '-100738800', '-88038000',
-'-68684400', '-59007600', '-37238400', '57715200', '69814800',
-'89168400', '101264400', '120618000', '132714000', '152067600',
-'164163600', '183517200', '196218000', '214966800', '227667600',
-'246416400', '259117200', '278470800', '290566800', '309920400',
-'322016400', '341370000', '354675600', '372819600', '386125200',
-'404269200', '417574800', '435718800', '449024400', '467773200',
-'481078800', '499222800', '512528400', '530672400', '543978000',
-'562122000', '575427600', '593571600', '606877200', '625626000',
-'638326800', '657075600', '670381200', '688525200', '701830800',
-'719974800', '733280400', '751424400', '764730000', '782874000',
-'796179600', '814928400', '828234000', '846378000', '859683600',
-'877827600', '891133200', '909277200', '922582800', '940726800',
-'954032400', '972781200', '985482000', '1004230800', '1017536400',
-'1035680400', '1048986000', '1067130000', '1080435600', '1098579600',
-'1111885200', '1130029200', '1143334800', '1162083600', '1174784400',
-'1193533200', '1206838800', '1224982800', '1238288400', '1256432400',
-'1269738000', '1287882000', '1301187600', '1319331600', '1332637200',
-'1351386000', '1364691600', '1382835600', '1396141200', '1414285200',
-'1427590800', '1445734800', '1459040400', '1477184400', '1490490000',
-'1509238800', '1521939600', '1540688400', '1553994000', '1572138000',
-'1585443600', '1603587600', '1616893200', '1635037200', '1648342800',
-'1666486800', '1679792400', '1698541200', '1711846800', '1729990800',
-'1743296400', '1761440400', '1774746000', '1792890000', '1806195600',
-'1824339600', '1837645200', '1856394000', '1869094800', '1887843600',
-'1901149200', '1919293200', '1932598800', '1950742800', '1964048400',
-'1982192400', '1995498000', '2013642000', '2026947600', '2045696400',
-'2058397200', '2077146000', '2090451600', '2108595600', '2121901200',
-'2140045200',
-],
-'\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\x01\x00\x01\x00\x02\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x03\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(3600, 1, 0), (0, 0, 4), (7200, 1, 8), (3600, 0, 0)], 'BST\x00GMT\x00DST\x00'),
-'GMT': ('GMT', 0, 1,
-[ ],
-'',
-[(0, 0, 0)], 'GMT\x00'),
-'GMT+0': ('GMT+0', 0, 1,
-[ ],
-'',
-[(0, 0, 0)], 'GMT+0000\x00'),
-'GMT+0130': ('GMT+0130', 0, 1,
-[ ],
-'',
-[(5400, 0, 0)], 'GMT+0130\x00'),
-'GMT+0230': ('GMT+0230', 0, 1,
-[ ],
-'',
-[(9000, 0, 0)], 'GMT+0230\x00'),
-'GMT+0330': ('GMT+0330', 0, 1,
-[ ],
-'',
-[(12600, 0, 0)], 'GMT+0330\x00'),
-'GMT+0430': ('GMT+0430', 0, 1,
-[ ],
-'',
-[(16200, 0, 0)], 'GMT+0430\x00'),
-'GMT+0530': ('GMT+0530', 0, 1,
-[ ],
-'',
-[(19800, 0, 0)], 'GMT+0530\x00'),
-'GMT+0630': ('GMT+0630', 0, 1,
-[ ],
-'',
-[(23400, 0, 0)], 'GMT+0630\x00'),
-'GMT+0730': ('GMT+0730', 0, 1,
-[ ],
-'',
-[(27000, 0, 0)], 'GMT+0730\x00'),
-'GMT+0830': ('GMT+0830', 0, 1,
-[ ],
-'',
-[(30600, 0, 0)], 'GMT+0830\x00'),
-'GMT+0930': ('GMT+0930', 0, 1,
-[ ],
-'',
-[(34200, 0, 0)], 'GMT+0930\x00'),
-'GMT+1': ('GMT+1', 0, 1,
-[ ],
-'',
-[(3600, 0, 0)], 'GMT+0100\x00'),
-'GMT+10': ('GMT+10', 0, 1,
-[ ],
-'',
-[(36000, 0, 0)], 'GMT+1000\x00'),
-'GMT+1030': ('GMT+1030', 0, 1,
-[ ],
-'',
-[(37800, 0, 0)], 'GMT+1030\x00'),
-'GMT+11': ('GMT+11', 0, 1,
-[ ],
-'',
-[(39600, 0, 0)], 'GMT+1100\x00'),
-'GMT+1130': ('GMT+1130', 0, 1,
-[ ],
-'',
-[(41400, 0, 0)], 'GMT+1130\x00'),
-'GMT+12': ('GMT+12', 0, 1,
-[ ],
-'',
-[(43200, 0, 0)], 'GMT+1200\x00'),
-'GMT+1230': ('GMT+1230', 0, 1,
-[ ],
-'',
-[(45000, 0, 0)], 'GMT+1230\x00'),
-'GMT+13': ('GMT+13', 0, 1,
-[ ],
-'',
-[(46800, 0, 0)], 'GMT+1300\x00'),
-'GMT+2': ('GMT+2', 0, 1,
-[ ],
-'',
-[(7200, 0, 0)], 'GMT+0200\x00'),
-'GMT+3': ('GMT+3', 0, 1,
-[ ],
-'',
-[(10800, 0, 0)], 'GMT+0300\x00'),
-'GMT+4': ('GMT+4', 0, 1,
-[ ],
-'',
-[(14400, 0, 0)], 'GMT+0400\x00'),
-'GMT+5': ('GMT+5', 0, 1,
-[ ],
-'',
-[(18000, 0, 0)], 'GMT+0500\x00'),
-'GMT+6': ('GMT+6', 0, 1,
-[ ],
-'',
-[(21600, 0, 0)], 'GMT+0600\x00'),
-'GMT+7': ('GMT+7', 0, 1,
-[ ],
-'',
-[(25200, 0, 0)], 'GMT+0700\x00'),
-'GMT+8': ('GMT+8', 0, 1,
-[ ],
-'',
-[(28800, 0, 0)], 'GMT+0800\x00'),
-'GMT+9': ('GMT+9', 0, 1,
-[ ],
-'',
-[(32400, 0, 0)], 'GMT+0900\x00'),
-'GMT-0130': ('GMT-0130', 0, 1,
-[ ],
-'',
-[(-5400, 0, 0)], 'GMT-0130\x00'),
-'GMT-0230': ('GMT-0230', 0, 1,
-[ ],
-'',
-[(-9000, 0, 0)], 'GMT-0230\x00'),
-'GMT-0330': ('GMT-0330', 0, 1,
-[ ],
-'',
-[(-12600, 0, 0)], 'GMT-0330\x00'),
-'GMT-0430': ('GMT-0430', 0, 1,
-[ ],
-'',
-[(-16200, 0, 0)], 'GMT-0430\x00'),
-'GMT-0530': ('GMT-0530', 0, 1,
-[ ],
-'',
-[(-19800, 0, 0)], 'GMT-0530\x00'),
-'GMT-0630': ('GMT-0630', 0, 1,
-[ ],
-'',
-[(-23400, 0, 0)], 'GMT-0630\x00'),
-'GMT-0730': ('GMT-0730', 0, 1,
-[ ],
-'',
-[(-27000, 0, 0)], 'GMT-0730\x00'),
-'GMT-0830': ('GMT-0830', 0, 1,
-[ ],
-'',
-[(-30600, 0, 0)], 'GMT-0830\x00'),
-'GMT-0930': ('GMT-0930', 0, 1,
-[ ],
-'',
-[(-34200, 0, 0)], 'GMT-0930\x00'),
-'GMT-1': ('GMT-1', 0, 1,
-[ ],
-'',
-[(-3600, 0, 0)], 'GMT-0100\x00'),
-'GMT-10': ('GMT-10', 0, 1,
-[ ],
-'',
-[(-36000, 0, 0)], 'GMT-1000\x00'),
-'GMT-1030': ('GMT-1030', 0, 1,
-[ ],
-'',
-[(-37800, 0, 0)], 'GMT-1030\x00'),
-'GMT-11': ('GMT-11', 0, 1,
-[ ],
-'',
-[(-39600, 0, 0)], 'GMT-1100\x00'),
-'GMT-1130': ('GMT-1130', 0, 1,
-[ ],
-'',
-[(-41400, 0, 0)], 'GMT-1130\x00'),
-'GMT-12': ('GMT-12', 0, 1,
-[ ],
-'',
-[(-43200, 0, 0)], 'GMT-1200\x00'),
-'GMT-1230': ('GMT-1230', 0, 1,
-[ ],
-'',
-[(-45000, 0, 0)], 'GMT-1230\x00'),
-'GMT-2': ('GMT-2', 0, 1,
-[ ],
-'',
-[(-7200, 0, 0)], 'GMT-0200\x00'),
-'GMT-3': ('GMT-3', 0, 1,
-[ ],
-'',
-[(-10800, 0, 0)], 'GMT-0300\x00'),
-'GMT-4': ('GMT-4', 0, 1,
-[ ],
-'',
-[(-14400, 0, 0)], 'GMT-0400\x00'),
-'GMT-5': ('GMT-5', 0, 1,
-[ ],
-'',
-[(-18000, 0, 0)], 'GMT-0500\x00'),
-'GMT-6': ('GMT-6', 0, 1,
-[ ],
-'',
-[(-21600, 0, 0)], 'GMT-0600\x00'),
-'GMT-7': ('GMT-7', 0, 1,
-[ ],
-'',
-[(-25200, 0, 0)], 'GMT-0700\x00'),
-'GMT-8': ('GMT-8', 0, 1,
-[ ],
-'',
-[(-28800, 0, 0)], 'GMT-0800\x00'),
-'GMT-9': ('GMT-9', 0, 1,
-[ ],
-'',
-[(-32400, 0, 0)], 'GMT-0900\x00'),
-'Greenwich': ('Greenwich', 0, 1,
-[ ],
-'',
-[(0, 0, 0)], 'GMT\x00'),
-'Hongkong': ('Hongkong', 0, 1,
-[ ],
-'',
-[(28800, 0, 0)], 'HKT\x00'),
-'Iceland': ('Iceland', 0, 1,
-[ ],
-'',
-[(0, 0, 0)], 'WET\x00'),
-'Iran': ('Iran', 100, 2,
-[ '575418600', '590535000', '606868200', '621984600', '638317800',
-'653434200', '670372200', '684883800', '701821800', '716938200',
-'733271400', '748387800', '764721000', '779837400', '796170600',
-'811287000', '828225000', '842736600', '859674600', '874791000',
-'891124200', '906240600', '922573800', '937690200', '954023400',
-'969139800', '985473000', '1000589400', '1017527400', '1032039000',
-'1048977000', '1064093400', '1080426600', '1095543000', '1111876200',
-'1126992600', '1143325800', '1158442200', '1174775400', '1189891800',
-'1206829800', '1221946200', '1238279400', '1253395800', '1269729000',
-'1284845400', '1301178600', '1316295000', '1332628200', '1347744600',
-'1364682600', '1379194200', '1396132200', '1411248600', '1427581800',
-'1442698200', '1459031400', '1474147800', '1490481000', '1505597400',
-'1521930600', '1537047000', '1553985000', '1568496600', '1585434600',
-'1600551000', '1616884200', '1632000600', '1648333800', '1663450200',
-'1679783400', '1694899800', '1711837800', '1726349400', '1743287400',
-'1758403800', '1774737000', '1789853400', '1806186600', '1821303000',
-'1837636200', '1852752600', '1869085800', '1884202200', '1901140200',
-'1915651800', '1932589800', '1947706200', '1964039400', '1979155800',
-'1995489000', '2010605400', '2026938600', '2042055000', '2058388200',
-'2073504600', '2090442600', '2105559000', '2121892200', '2137008600',
-],
-'\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(16200, 1, 0), (12600, 0, 4)], 'IDT\x00IST\x00'),
-'Israel': ('Israel', 42, 2,
-[ '609890400', '622587600', '640735200', '653432400', '670975200',
-'683672400', '704239200', '716936400', '735084000', '747781200',
-'765324000', '778021200', '798588000', '811285200', '829432800',
-'842130000', '862696800', '875394000', '892936800', '905634000',
-'923781600', '936478800', '957045600', '969742800', '987285600',
-'999982800', '1018130400', '1030827600', '1051394400', '1064091600',
-'1082239200', '1094936400', '1114898400', '1127595600', '1145743200',
-'1158440400', '1176588000', '1189285200', '1209247200', '1221944400',
-'1240092000', '1252789200',
-],
-'\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(10800, 1, 0), (7200, 0, 4)], 'IDT\x00IST\x00'),
-'Jamaica': ('Jamaica', 148, 3,
-[ '-1633280400', '-1615140000', '-1601830800', '-1583690400', '-880218000',
-'-765396000', '-84387600', '-68666400', '-52938000', '-37216800',
-'-21488400', '-5767200', '9961200', '25682400', '41410800',
-'57736800', '73465200', '89186400', '104914800', '120636000',
-'126687600', '152085600', '162370800', '183535200', '199263600',
-'215589600', '230713200', '247039200', '262767600', '278488800',
-'294217200', '309938400', '325666800', '341388000', '357116400',
-'372837600', '388566000', '404892000', '420015600', '436341600',
-'452070000', '467791200', '483519600', '499240800', '514969200',
-'530690400', '544604400', '562140000', '576054000', '594194400',
-'607503600', '625644000', '638953200', '657093600', '671007600',
-'688543200', '702457200', '719992800', '733906800', '752047200',
-'765356400', '783496800', '796806000', '814946400', '828860400',
-'846396000', '860310000', '877845600', '891759600', '909295200',
-'923209200', '941349600', '954658800', '972799200', '986108400',
-'1004248800', '1018162800', '1035698400', '1049612400', '1067148000',
-'1081062000', '1099202400', '1112511600', '1130652000', '1143961200',
-'1162101600', '1175410800', '1193551200', '1207465200', '1225000800',
-'1238914800', '1256450400', '1270364400', '1288504800', '1301814000',
-'1319954400', '1333263600', '1351404000', '1365318000', '1382853600',
-'1396767600', '1414303200', '1428217200', '1445752800', '1459666800',
-'1477807200', '1491116400', '1509256800', '1522566000', '1540706400',
-'1554620400', '1572156000', '1586070000', '1603605600', '1617519600',
-'1635660000', '1648969200', '1667109600', '1680418800', '1698559200',
-'1712473200', '1730008800', '1743922800', '1761458400', '1775372400',
-'1792908000', '1806822000', '1824962400', '1838271600', '1856412000',
-'1869721200', '1887861600', '1901775600', '1919311200', '1933225200',
-'1950760800', '1964674800', '1982815200', '1996124400', '2014264800',
-'2027574000', '2045714400', '2059023600', '2077164000', '2091078000',
-'2108613600', '2122527600', '2140063200',
-],
-'\x00\x01\x00\x01\x02\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-14400, 1, 0), (-18000, 0, 4), (-14400, 1, 8)], 'EDT\x00EST\x00EWT\x00'),
-'Japan': ('Japan', 0, 1,
-[ ],
-'',
-[(32400, 0, 0)], 'JST\x00'),
-'Mexico/BajaNorte': ('Mexico/BajaNorte', 102, 2,
-[ '544615200', '562150800', '576064800', '594205200', '607514400',
-'625654800', '638964000', '657104400', '671018400', '688554000',
-'702468000', '720003600', '733917600', '752058000', '765367200',
-'783507600', '796816800', '814957200', '828871200', '846406800',
-'860320800', '877856400', '891770400', '909306000', '923220000',
-'941360400', '954669600', '972810000', '986119200', '1004259600',
-'1018173600', '1035709200', '1049623200', '1067158800', '1081072800',
-'1099213200', '1112522400', '1130662800', '1143972000', '1162112400',
-'1175421600', '1193562000', '1207476000', '1225011600', '1238925600',
-'1256461200', '1270375200', '1288515600', '1301824800', '1319965200',
-'1333274400', '1351414800', '1365328800', '1382864400', '1396778400',
-'1414314000', '1428228000', '1445763600', '1459677600', '1477818000',
-'1491127200', '1509267600', '1522576800', '1540717200', '1554631200',
-'1572166800', '1586080800', '1603616400', '1617530400', '1635670800',
-'1648980000', '1667120400', '1680429600', '1698570000', '1712484000',
-'1730019600', '1743933600', '1761469200', '1775383200', '1792918800',
-'1806832800', '1824973200', '1838282400', '1856422800', '1869732000',
-'1887872400', '1901786400', '1919322000', '1933236000', '1950771600',
-'1964685600', '1982826000', '1996135200', '2014275600', '2027584800',
-'2045725200', '2059034400', '2077174800', '2091088800', '2108624400',
-'2122538400', '2140074000',
-],
-'\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-25200, 1, 0), (-28800, 0, 4)], 'PDT\x00PST\x00'),
-'Mexico/BajaSur': ('Mexico/BajaSur', 0, 1,
-[ ],
-'',
-[(-25200, 0, 0)], 'MST\x00'),
-'Mexico/General': ('Mexico/General', 0, 1,
-[ ],
-'',
-[(-21600, 0, 0)], 'CST\x00'),
-'Poland': ('Poland', 104, 2,
-[ '512524800', '528249600', '543974400', '559699200', '575424000',
-'591148800', '606873600', '622598400', '638323200', '654652800',
-'670377600', '686102400', '701827200', '717552000', '733276800',
-'749001600', '764726400', '780451200', '796176000', '811900800',
-'828230400', '843955200', '859680000', '875404800', '891129600',
-'906854400', '922579200', '938304000', '954028800', '969753600',
-'985478400', '1001808000', '1017532800', '1033257600', '1048982400',
-'1064707200', '1080432000', '1096156800', '1111881600', '1127606400',
-'1143331200', '1159056000', '1174780800', '1191110400', '1206835200',
-'1222560000', '1238284800', '1254009600', '1269734400', '1285459200',
-'1301184000', '1316908800', '1332633600', '1348963200', '1364688000',
-'1380412800', '1396137600', '1411862400', '1427587200', '1443312000',
-'1459036800', '1474761600', '1490486400', '1506211200', '1521936000',
-'1538265600', '1553990400', '1569715200', '1585440000', '1601164800',
-'1616889600', '1632614400', '1648339200', '1664064000', '1679788800',
-'1695513600', '1711843200', '1727568000', '1743292800', '1759017600',
-'1774742400', '1790467200', '1806192000', '1821916800', '1837641600',
-'1853366400', '1869091200', '1885420800', '1901145600', '1916870400',
-'1932595200', '1948320000', '1964044800', '1979769600', '1995494400',
-'2011219200', '2026944000', '2042668800', '2058393600', '2074723200',
-'2090448000', '2106172800', '2121897600', '2137622400',
-],
-'\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(7200, 1, 0), (3600, 0, 8)], 'MET DST\x00MET\x00'),
-'Singapore': ('Singapore', 0, 1,
-[ ],
-'',
-[(28800, 0, 0)], 'SST\x00'),
-'Turkey': ('Turkey', 104, 2,
-[ '512517600', '528238800', '543967200', '559688400', '575416800',
-'591138000', '606866400', '622587600', '638316000', '654642000',
-'670370400', '686091600', '701820000', '717541200', '733269600',
-'748990800', '764719200', '780440400', '796168800', '811890000',
-'828223200', '843944400', '859672800', '875394000', '891122400',
-'906843600', '922572000', '938293200', '954021600', '969742800',
-'985471200', '1001797200', '1017525600', '1033246800', '1048975200',
-'1064696400', '1080424800', '1096146000', '1111874400', '1127595600',
-'1143324000', '1159045200', '1174773600', '1191099600', '1206828000',
-'1222549200', '1238277600', '1253998800', '1269727200', '1285448400',
-'1301176800', '1316898000', '1332626400', '1348952400', '1364680800',
-'1380402000', '1396130400', '1411851600', '1427580000', '1443301200',
-'1459029600', '1474750800', '1490479200', '1506200400', '1521928800',
-'1538254800', '1553983200', '1569704400', '1585432800', '1601154000',
-'1616882400', '1632603600', '1648332000', '1664053200', '1679781600',
-'1695502800', '1711836000', '1727557200', '1743285600', '1759006800',
-'1774735200', '1790456400', '1806184800', '1821906000', '1837634400',
-'1853355600', '1869084000', '1885410000', '1901138400', '1916859600',
-'1932588000', '1948309200', '1964037600', '1979758800', '1995487200',
-'2011208400', '2026936800', '2042658000', '2058386400', '2074712400',
-'2090440800', '2106162000', '2121890400', '2137611600',
-],
-'\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(14400, 1, 0), (10800, 0, 8)], 'EET DST\x00EET\x00'),
-'US/Alaska': ('US/Alaska', 148, 3,
-[ '-1633266000', '-1615125600', '-1601816400', '-1583676000', '-880203600',
-'-765381600', '-84373200', '-68652000', '-52923600', '-37202400',
-'-21474000', '-5752800', '9975600', '25696800', '41425200',
-'57751200', '73479600', '89200800', '104929200', '120650400',
-'126702000', '152100000', '162385200', '183549600', '199278000',
-'215604000', '230727600', '247053600', '262782000', '278503200',
-'294231600', '309952800', '325681200', '341402400', '357130800',
-'372852000', '388580400', '404906400', '420030000', '436356000',
-'452084400', '467805600', '483534000', '499255200', '514983600',
-'530704800', '544618800', '562154400', '576068400', '594208800',
-'607518000', '625658400', '638967600', '657108000', '671022000',
-'688557600', '702471600', '720007200', '733921200', '752061600',
-'765370800', '783511200', '796820400', '814960800', '828874800',
-'846410400', '860324400', '877860000', '891774000', '909309600',
-'923223600', '941364000', '954673200', '972813600', '986122800',
-'1004263200', '1018177200', '1035712800', '1049626800', '1067162400',
-'1081076400', '1099216800', '1112526000', '1130666400', '1143975600',
-'1162116000', '1175425200', '1193565600', '1207479600', '1225015200',
-'1238929200', '1256464800', '1270378800', '1288519200', '1301828400',
-'1319968800', '1333278000', '1351418400', '1365332400', '1382868000',
-'1396782000', '1414317600', '1428231600', '1445767200', '1459681200',
-'1477821600', '1491130800', '1509271200', '1522580400', '1540720800',
-'1554634800', '1572170400', '1586084400', '1603620000', '1617534000',
-'1635674400', '1648983600', '1667124000', '1680433200', '1698573600',
-'1712487600', '1730023200', '1743937200', '1761472800', '1775386800',
-'1792922400', '1806836400', '1824976800', '1838286000', '1856426400',
-'1869735600', '1887876000', '1901790000', '1919325600', '1933239600',
-'1950775200', '1964689200', '1982829600', '1996138800', '2014279200',
-'2027588400', '2045728800', '2059038000', '2077178400', '2091092400',
-'2108628000', '2122542000', '2140077600',
-],
-'\x00\x01\x00\x01\x02\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-28800, 1, 0), (-32400, 0, 5), (-28800, 1, 10)], 'AKDT\x00AKST\x00AKWT\x00'),
-'US/Aleutian': ('US/Aleutian', 149, 5,
-[ '-1633262400', '-1615122000', '-1601812800', '-1583672400', '-880200000',
-'-765378000', '-84369600', '-68648400', '-52920000', '-37198800',
-'-21470400', '-5749200', '9979200', '25700400', '41428800',
-'57754800', '73483200', '89204400', '104932800', '120654000',
-'126705600', '152103600', '162388800', '183553200', '199281600',
-'215607600', '230731200', '247057200', '262785600', '278506800',
-'294235200', '309956400', '325684800', '341406000', '357134400',
-'372855600', '388584000', '404910000', '420033600', '436359600',
-'439034400', '452088000', '467809200', '483537600', '499258800',
-'514987200', '530708400', '544622400', '562158000', '576072000',
-'594212400', '607521600', '625662000', '638971200', '657111600',
-'671025600', '688561200', '702475200', '720010800', '733924800',
-'752065200', '765374400', '783514800', '796824000', '814964400',
-'828878400', '846414000', '860328000', '877863600', '891777600',
-'909313200', '923227200', '941367600', '954676800', '972817200',
-'986126400', '1004266800', '1018180800', '1035716400', '1049630400',
-'1067166000', '1081080000', '1099220400', '1112529600', '1130670000',
-'1143979200', '1162119600', '1175428800', '1193569200', '1207483200',
-'1225018800', '1238932800', '1256468400', '1270382400', '1288522800',
-'1301832000', '1319972400', '1333281600', '1351422000', '1365336000',
-'1382871600', '1396785600', '1414321200', '1428235200', '1445770800',
-'1459684800', '1477825200', '1491134400', '1509274800', '1522584000',
-'1540724400', '1554638400', '1572174000', '1586088000', '1603623600',
-'1617537600', '1635678000', '1648987200', '1667127600', '1680436800',
-'1698577200', '1712491200', '1730026800', '1743940800', '1761476400',
-'1775390400', '1792926000', '1806840000', '1824980400', '1838289600',
-'1856430000', '1869739200', '1887879600', '1901793600', '1919329200',
-'1933243200', '1950778800', '1964692800', '1982833200', '1996142400',
-'2014282800', '2027592000', '2045732400', '2059041600', '2077182000',
-'2091096000', '2108631600', '2122545600', '2140081200',
-],
-'\x00\x01\x00\x01\x02\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03',
-[(-32400, 1, 0), (-36000, 0, 5), (-32400, 1, 10), (-36000, 0, 15), (-32400, 1, 20)], 'AHDT\x00AHST\x00AHWT\x00HAST\x00HADT\x00'),
-'US/Arizona': ('US/Arizona', 6, 3,
-[ '-1633273200', '-1615132800', '-1601823600', '-1583683200', '-880210800',
-'-765388800',
-],
-'\x00\x01\x00\x01\x02\x01',
-[(-21600, 1, 0), (-25200, 0, 4), (-21600, 1, 8)], 'MDT\x00MST\x00MWT\x00'),
-'US/Central': ('US/Central', 148, 3,
-[ '-1633276800', '-1615136400', '-1601827200', '-1583686800', '-880214400',
-'-765392400', '-84384000', '-68662800', '-52934400', '-37213200',
-'-21484800', '-5763600', '9964800', '25686000', '41414400',
-'57740400', '73468800', '89190000', '104918400', '120639600',
-'126691200', '152089200', '162374400', '183538800', '199267200',
-'215593200', '230716800', '247042800', '262771200', '278492400',
-'294220800', '309942000', '325670400', '341391600', '357120000',
-'372841200', '388569600', '404895600', '420019200', '436345200',
-'452073600', '467794800', '483523200', '499244400', '514972800',
-'530694000', '544608000', '562143600', '576057600', '594198000',
-'607507200', '625647600', '638956800', '657097200', '671011200',
-'688546800', '702460800', '719996400', '733910400', '752050800',
-'765360000', '783500400', '796809600', '814950000', '828864000',
-'846399600', '860313600', '877849200', '891763200', '909298800',
-'923212800', '941353200', '954662400', '972802800', '986112000',
-'1004252400', '1018166400', '1035702000', '1049616000', '1067151600',
-'1081065600', '1099206000', '1112515200', '1130655600', '1143964800',
-'1162105200', '1175414400', '1193554800', '1207468800', '1225004400',
-'1238918400', '1256454000', '1270368000', '1288508400', '1301817600',
-'1319958000', '1333267200', '1351407600', '1365321600', '1382857200',
-'1396771200', '1414306800', '1428220800', '1445756400', '1459670400',
-'1477810800', '1491120000', '1509260400', '1522569600', '1540710000',
-'1554624000', '1572159600', '1586073600', '1603609200', '1617523200',
-'1635663600', '1648972800', '1667113200', '1680422400', '1698562800',
-'1712476800', '1730012400', '1743926400', '1761462000', '1775376000',
-'1792911600', '1806825600', '1824966000', '1838275200', '1856415600',
-'1869724800', '1887865200', '1901779200', '1919314800', '1933228800',
-'1950764400', '1964678400', '1982818800', '1996128000', '2014268400',
-'2027577600', '2045718000', '2059027200', '2077167600', '2091081600',
-'2108617200', '2122531200', '2140066800',
-],
-'\x00\x01\x00\x01\x02\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-18000, 1, 0), (-21600, 0, 4), (-18000, 1, 8)], 'CDT\x00CST\x00CWT\x00'),
-'US/East-Indiana': ('US/East-Indiana', 6, 3,
-[ '-1633280400', '-1615140000', '-1601830800', '-1583690400', '-880218000',
-'-765396000',
-],
-'\x00\x01\x00\x01\x02\x01',
-[(-14400, 1, 0), (-18000, 0, 4), (-14400, 1, 8)], 'EDT\x00EST\x00EWT\x00'),
-'US/Eastern': ('US/Eastern', 148, 3,
-[ '-1633280400', '-1615140000', '-1601830800', '-1583690400', '-880218000',
-'-765396000', '-84387600', '-68666400', '-52938000', '-37216800',
-'-21488400', '-5767200', '9961200', '25682400', '41410800',
-'57736800', '73465200', '89186400', '104914800', '120636000',
-'126687600', '152085600', '162370800', '183535200', '199263600',
-'215589600', '230713200', '247039200', '262767600', '278488800',
-'294217200', '309938400', '325666800', '341388000', '357116400',
-'372837600', '388566000', '404892000', '420015600', '436341600',
-'452070000', '467791200', '483519600', '499240800', '514969200',
-'530690400', '544604400', '562140000', '576054000', '594194400',
-'607503600', '625644000', '638953200', '657093600', '671007600',
-'688543200', '702457200', '719992800', '733906800', '752047200',
-'765356400', '783496800', '796806000', '814946400', '828860400',
-'846396000', '860310000', '877845600', '891759600', '909295200',
-'923209200', '941349600', '954658800', '972799200', '986108400',
-'1004248800', '1018162800', '1035698400', '1049612400', '1067148000',
-'1081062000', '1099202400', '1112511600', '1130652000', '1143961200',
-'1162101600', '1175410800', '1193551200', '1207465200', '1225000800',
-'1238914800', '1256450400', '1270364400', '1288504800', '1301814000',
-'1319954400', '1333263600', '1351404000', '1365318000', '1382853600',
-'1396767600', '1414303200', '1428217200', '1445752800', '1459666800',
-'1477807200', '1491116400', '1509256800', '1522566000', '1540706400',
-'1554620400', '1572156000', '1586070000', '1603605600', '1617519600',
-'1635660000', '1648969200', '1667109600', '1680418800', '1698559200',
-'1712473200', '1730008800', '1743922800', '1761458400', '1775372400',
-'1792908000', '1806822000', '1824962400', '1838271600', '1856412000',
-'1869721200', '1887861600', '1901775600', '1919311200', '1933225200',
-'1950760800', '1964674800', '1982815200', '1996124400', '2014264800',
-'2027574000', '2045714400', '2059023600', '2077164000', '2091078000',
-'2108613600', '2122527600', '2140063200',
-],
-'\x00\x01\x00\x01\x02\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-14400, 1, 0), (-18000, 0, 4), (-14400, 1, 8)], 'EDT\x00EST\x00EWT\x00'),
-'US/Hawaii': ('US/Hawaii', 9, 4,
-[ '-1633260600', '-1615120200', '-1601811000', '-1583670600', '-1157283000',
-'-1157200200', '-880198200', '-765376200', '-712150200',
-],
-'\x00\x01\x00\x01\x00\x01\x02\x01\x03',
-[(-34200, 1, 0), (-37800, 0, 4), (-34200, 1, 8), (-36000, 0, 4)], 'HDT\x00HST\x00HWT\x00'),
-'US/Indiana-Starke': ('US/Indiana-Starke', 56, 4,
-[ '-1633276800', '-1615136400', '-1601827200', '-1583686800', '-880214400',
-'-765392400', '-84384000', '-68662800', '-52934400', '-37213200',
-'-21484800', '-5763600', '9964800', '25686000', '41414400',
-'57740400', '73468800', '89190000', '104918400', '120639600',
-'126691200', '152089200', '162374400', '183538800', '199267200',
-'215593200', '230716800', '247042800', '262771200', '278492400',
-'294220800', '309942000', '325670400', '341391600', '357120000',
-'372841200', '388569600', '404895600', '420019200', '436345200',
-'452073600', '467794800', '483523200', '499244400', '514972800',
-'530694000', '544608000', '562143600', '576057600', '594198000',
-'607507200', '625647600', '638956800', '657097200', '671011200',
-'688546800',
-],
-'\x00\x01\x00\x01\x02\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x03',
-[(-18000, 1, 0), (-21600, 0, 4), (-18000, 1, 8), (-18000, 0, 12)], 'CDT\x00CST\x00CWT\x00EST\x00'),
-'US/Michigan': ('US/Michigan', 138, 3,
-[ '-1633280400', '-1615140000', '-1601830800', '-1583690400', '-880218000',
-'-765396000', '-84387600', '-68666400', '104914800', '120636000',
-'126687600', '152085600', '162370800', '183535200', '199263600',
-'215589600', '230713200', '247039200', '262767600', '278488800',
-'294217200', '309938400', '325666800', '341388000', '357116400',
-'372837600', '388566000', '404892000', '420015600', '436341600',
-'452070000', '467791200', '483519600', '499240800', '514969200',
-'530690400', '544604400', '562140000', '576054000', '594194400',
-'607503600', '625644000', '638953200', '657093600', '671007600',
-'688543200', '702457200', '719992800', '733906800', '752047200',
-'765356400', '783496800', '796806000', '814946400', '828860400',
-'846396000', '860310000', '877845600', '891759600', '909295200',
-'923209200', '941349600', '954658800', '972799200', '986108400',
-'1004248800', '1018162800', '1035698400', '1049612400', '1067148000',
-'1081062000', '1099202400', '1112511600', '1130652000', '1143961200',
-'1162101600', '1175410800', '1193551200', '1207465200', '1225000800',
-'1238914800', '1256450400', '1270364400', '1288504800', '1301814000',
-'1319954400', '1333263600', '1351404000', '1365318000', '1382853600',
-'1396767600', '1414303200', '1428217200', '1445752800', '1459666800',
-'1477807200', '1491116400', '1509256800', '1522566000', '1540706400',
-'1554620400', '1572156000', '1586070000', '1603605600', '1617519600',
-'1635660000', '1648969200', '1667109600', '1680418800', '1698559200',
-'1712473200', '1730008800', '1743922800', '1761458400', '1775372400',
-'1792908000', '1806822000', '1824962400', '1838271600', '1856412000',
-'1869721200', '1887861600', '1901775600', '1919311200', '1933225200',
-'1950760800', '1964674800', '1982815200', '1996124400', '2014264800',
-'2027574000', '2045714400', '2059023600', '2077164000', '2091078000',
-'2108613600', '2122527600', '2140063200',
-],
-'\x00\x01\x00\x01\x02\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-14400, 1, 0), (-18000, 0, 4), (-14400, 1, 8)], 'EDT\x00EST\x00EWT\x00'),
-'US/Mountain': ('US/Mountain', 148, 3,
-[ '-1633273200', '-1615132800', '-1601823600', '-1583683200', '-880210800',
-'-765388800', '-84380400', '-68659200', '-52930800', '-37209600',
-'-21481200', '-5760000', '9968400', '25689600', '41418000',
-'57744000', '73472400', '89193600', '104922000', '120643200',
-'126694800', '152092800', '162378000', '183542400', '199270800',
-'215596800', '230720400', '247046400', '262774800', '278496000',
-'294224400', '309945600', '325674000', '341395200', '357123600',
-'372844800', '388573200', '404899200', '420022800', '436348800',
-'452077200', '467798400', '483526800', '499248000', '514976400',
-'530697600', '544611600', '562147200', '576061200', '594201600',
-'607510800', '625651200', '638960400', '657100800', '671014800',
-'688550400', '702464400', '720000000', '733914000', '752054400',
-'765363600', '783504000', '796813200', '814953600', '828867600',
-'846403200', '860317200', '877852800', '891766800', '909302400',
-'923216400', '941356800', '954666000', '972806400', '986115600',
-'1004256000', '1018170000', '1035705600', '1049619600', '1067155200',
-'1081069200', '1099209600', '1112518800', '1130659200', '1143968400',
-'1162108800', '1175418000', '1193558400', '1207472400', '1225008000',
-'1238922000', '1256457600', '1270371600', '1288512000', '1301821200',
-'1319961600', '1333270800', '1351411200', '1365325200', '1382860800',
-'1396774800', '1414310400', '1428224400', '1445760000', '1459674000',
-'1477814400', '1491123600', '1509264000', '1522573200', '1540713600',
-'1554627600', '1572163200', '1586077200', '1603612800', '1617526800',
-'1635667200', '1648976400', '1667116800', '1680426000', '1698566400',
-'1712480400', '1730016000', '1743930000', '1761465600', '1775379600',
-'1792915200', '1806829200', '1824969600', '1838278800', '1856419200',
-'1869728400', '1887868800', '1901782800', '1919318400', '1933232400',
-'1950768000', '1964682000', '1982822400', '1996131600', '2014272000',
-'2027581200', '2045721600', '2059030800', '2077171200', '2091085200',
-'2108620800', '2122534800', '2140070400',
-],
-'\x00\x01\x00\x01\x02\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-21600, 1, 0), (-25200, 0, 4), (-21600, 1, 8)], 'MDT\x00MST\x00MWT\x00'),
-'US/Pacific': ('US/Pacific', 148, 3,
-[ '-1633269600', '-1615129200', '-1601820000', '-1583679600', '-880207200',
-'-765385200', '-84376800', '-68655600', '-52927200', '-37206000',
-'-21477600', '-5756400', '9972000', '25693200', '41421600',
-'57747600', '73476000', '89197200', '104925600', '120646800',
-'126698400', '152096400', '162381600', '183546000', '199274400',
-'215600400', '230724000', '247050000', '262778400', '278499600',
-'294228000', '309949200', '325677600', '341398800', '357127200',
-'372848400', '388576800', '404902800', '420026400', '436352400',
-'452080800', '467802000', '483530400', '499251600', '514980000',
-'530701200', '544615200', '562150800', '576064800', '594205200',
-'607514400', '625654800', '638964000', '657104400', '671018400',
-'688554000', '702468000', '720003600', '733917600', '752058000',
-'765367200', '783507600', '796816800', '814957200', '828871200',
-'846406800', '860320800', '877856400', '891770400', '909306000',
-'923220000', '941360400', '954669600', '972810000', '986119200',
-'1004259600', '1018173600', '1035709200', '1049623200', '1067158800',
-'1081072800', '1099213200', '1112522400', '1130662800', '1143972000',
-'1162112400', '1175421600', '1193562000', '1207476000', '1225011600',
-'1238925600', '1256461200', '1270375200', '1288515600', '1301824800',
-'1319965200', '1333274400', '1351414800', '1365328800', '1382864400',
-'1396778400', '1414314000', '1428228000', '1445763600', '1459677600',
-'1477818000', '1491127200', '1509267600', '1522576800', '1540717200',
-'1554631200', '1572166800', '1586080800', '1603616400', '1617530400',
-'1635670800', '1648980000', '1667120400', '1680429600', '1698570000',
-'1712484000', '1730019600', '1743933600', '1761469200', '1775383200',
-'1792918800', '1806832800', '1824973200', '1838282400', '1856422800',
-'1869732000', '1887872400', '1901786400', '1919322000', '1933236000',
-'1950771600', '1964685600', '1982826000', '1996135200', '2014275600',
-'2027584800', '2045725200', '2059034400', '2077174800', '2091088800',
-'2108624400', '2122538400', '2140074000',
-],
-'\x00\x01\x00\x01\x02\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01',
-[(-25200, 1, 0), (-28800, 0, 4), (-25200, 1, 8)], 'PDT\x00PST\x00PWT\x00'),
-'US/Samoa': ('US/Samoa', 2, 3,
-[ '-86878800', '439038000',
-],
-'\x01\x02',
-[(-39600, 0, 0), (-39600, 0, 4), (-39600, 0, 8)], 'NST\x00BST\x00SST\x00'),
-'Universal': ('Universal', 0, 1,
-[ ],
-'',
-[(0, 0, 0)], 'GMT\x00'),
-}
-
-def dumpTimezoneInfo(_data):
-
-    print "historical_zone_info = {"
-
-    items = _data.items()
-    items.sort()
-    for key, value in items:
-        v1, v2, v3, ilist, bitmap, two_by_three, two_nullterm = value
-        print "'%s': ('%s', %s, %s," % (key, v1, v2, v3)
-        print "[",
-        while ilist:
-            next_5, ilist = ilist[:5], ilist[5:]
-            line = ", ".join(["'%s'" % x for x in next_5])
-            print "%s," % line
-        print "], "
-        print "%s," % repr(bitmap)
-        print "%s, %s)," % (repr(two_by_three), repr(two_nullterm))
-
-    print "}"
-
-if __name__ == '__main__':
-    dumpTimezoneInfo(historical_zone_info)

Modified: Zope3/branches/jim-adapter/src/zope/app/traversing/adapters.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/traversing/adapters.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/traversing/adapters.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,13 +15,10 @@
 
 $Id$
 """
-import zope.deprecation
-
 from types import StringTypes, MethodType
-
-from zope.app.traversing.interfaces import TraversalError
 from zope.interface import implements
 
+from zope.app.traversing.interfaces import TraversalError
 from zope.app.traversing.interfaces import IPhysicallyLocatable
 from zope.app.traversing.interfaces import IContainmentRoot
 from zope.app.traversing.interfaces import ITraverser, ITraversable
@@ -30,13 +27,6 @@
 from zope.app.traversing.namespace import UnexpectedParameters
 from zope.app.traversing.namespace import nsParse
 
-# BBB Backward Compatibility (Can go away in 3.3)
-zope.deprecation.__show__.off()
-from zope.exceptions import NotFoundError
-zope.deprecation.__show__.on()
-
-import warnings
-
 _marker = object()  # opaque marker that doesn't get security proxied
 
 class DefaultTraversable(object):
@@ -182,18 +172,5 @@
             return default
         else:
             raise
-    except NotFoundError, v: # BBB Backward Compatibility
-        warnings.warn(
-            "A %s instance raised a NotFoundError in "
-            "traverse.  Raising NotFoundError in this "
-            "method is deprecated and will no-longer be supported "
-            "starting in Zope 3.3.  TraversalError should "
-            "be raised instead."
-            % traversable.__class__.__name__,
-            DeprecationWarning)
-        if default is not _marker:
-            return default
-        else:
-            raise
 
     return obj

Modified: Zope3/branches/jim-adapter/src/zope/app/traversing/api.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/traversing/api.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/traversing/api.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,19 +15,11 @@
 
 $Id$
 """
-import zope.deprecation
-
 from zope.interface import moduleProvides
-from interfaces import IContainmentRoot, ITraversalAPI
-from interfaces import ITraverser, IPhysicallyLocatable, TraversalError
+from zope.app.traversing.interfaces import IContainmentRoot, ITraversalAPI
+from zope.app.traversing.interfaces import ITraverser, IPhysicallyLocatable
+from zope.app.traversing.interfaces import TraversalError
 
-# BBB Backward Compatibility (Can go away in 3.3)
-zope.deprecation.__show__.off()
-from zope.exceptions import NotFoundError
-zope.deprecation.__show__.on()
-
-import warnings
-
 moduleProvides(ITraversalAPI)
 __all__ = tuple(ITraversalAPI)
 
@@ -91,29 +83,11 @@
           Consider using traverseName instead.
     """
     traverser = ITraverser(object)
-    try:
-        if default is _marker:
-            return traverser.traverse(path, request=request)
-        else:
-            return traverser.traverse(path, default=default, request=request)
+    if default is _marker:
+        return traverser.traverse(path, request=request)
+    else:
+        return traverser.traverse(path, default=default, request=request)
 
-    # BBB Backward Compatibility, can go away in 3.3
-    #
-    except TraversalError:
-        raise
-    except NotFoundError, v: 
-        warnings.warn(
-            "A %s instance raised a NotFoundError in "
-            "traverse.  Raising NotFoundError in this "
-            "method is deprecated and will no-longer be supported "
-            "staring in Zope 3.3.  TraversalError should "
-            "be raised instead."
-            % traverser.__class__.__name__,
-            DeprecationWarning)
-        raise TraversalError(*tuple(v))
-    #
-    ###############################################################
-
 def traverseName(obj, name, default=_marker, traversable=None, request=None):
     """Traverse a single step 'name' relative to the given object.
 

Modified: Zope3/branches/jim-adapter/src/zope/app/traversing/browser/configure.zcml
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/traversing/browser/configure.zcml	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/traversing/browser/configure.zcml	2006-04-04 15:56:58 UTC (rev 66397)
@@ -11,6 +11,12 @@
       allowed_interface="zope.publisher.interfaces.browser.IBrowserPublisher"
       />
 
+  <adapter
+      for="types.MethodType zope.publisher.interfaces.browser.IBrowserRequest"
+      provides="zope.publisher.interfaces.browser.IBrowserPublisher"
+      factory="zope.app.publication.traversers.NoTraverser"
+      />
+
   <view
       for="zope.app.container.interfaces.IItemContainer"
       type="zope.publisher.interfaces.browser.IBrowserRequest"

Modified: Zope3/branches/jim-adapter/src/zope/app/traversing/namespace.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/traversing/namespace.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/traversing/namespace.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,11 +17,10 @@
 """
 import re
 
-import zope.deprecation
 import zope.component
 import zope.interface
 from zope.i18n.interfaces import IModifiableUserPreferredLanguages
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 from zope.interface import providedBy, directlyProvides, directlyProvidedBy
 from zope.publisher.interfaces.browser import IBrowserSkinType
 from zope.security.proxy import removeSecurityProxy
@@ -30,14 +29,6 @@
 from zope.app.traversing.interfaces import ITraversable, IPathAdapter
 from zope.app.traversing.interfaces import TraversalError
 
-# BBB Backward Compatibility (Can go away in 3.3)
-zope.deprecation.__show__.off()
-from zope.exceptions import NotFoundError
-zope.deprecation.__show__.on()
-
-import warnings
-
-
 class UnexpectedParameters(TraversalError):
     "Unexpected namespace parameters were provided."
 
@@ -265,15 +256,6 @@
                 except TraversalError:
                     pass
 
-                except NotFoundError, v: # BBB Backward Compatibility
-                    warnings.warn(
-                        "A %s instance raised a NotFoundError in "
-                        "traverse.  Raising NotFoundError in this "
-                        "method is deprecated and will no-longer be supported "
-                        "staring in Zope 3.3.  TraversalError should "
-                        "be raised instead."
-                        % traversable.__class__.__name__,
-                        DeprecationWarning)
                 else:
                     return next
 

Modified: Zope3/branches/jim-adapter/src/zope/app/tree/adapters.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/tree/adapters.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/tree/adapters.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -21,7 +21,7 @@
 $Id$
 """
 from zope.interface import Interface, implements
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 from zope.security import canAccess
 from zope.security.interfaces import Unauthorized
 

Modified: Zope3/branches/jim-adapter/src/zope/app/tree/browser/cookie.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/tree/browser/cookie.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/tree/browser/cookie.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -19,7 +19,7 @@
 from zope.app.container.interfaces import IContainer
 from zope.app.folder.interfaces import IFolder
 from zope.app.component.interfaces import ISite
-from zope.component.interfaces import ISiteManager
+from zope.component.interfaces import IComponentLookup
 from zope.app.traversing.interfaces import IContainmentRoot
 
 from zope.app.tree.filters import OnlyInterfacesFilter

Modified: Zope3/branches/jim-adapter/src/zope/app/tree/tests/test_adapters.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/tree/tests/test_adapters.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/tree/tests/test_adapters.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -18,7 +18,7 @@
 import unittest
 
 from zope.interface import implements, directlyProvides
-from zope.component.exceptions import ComponentLookupError
+from zope.component.interfaces import ComponentLookupError
 from zope.security.checker import defineChecker
 from zope.security.checker import NamesChecker
 

Modified: Zope3/branches/jim-adapter/src/zope/app/undo/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/undo/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/undo/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -18,28 +18,19 @@
 from datetime import datetime
 
 import transaction
-
-import zope.deprecation
+import zope.component
 from zope.interface import implements
-from zope.app.security.interfaces import PrincipalLookupError
 
-from zope.app import zapi
 from zope.app.undo.interfaces import IUndoManager, UndoError
 from zope.app.traversing.interfaces import IPhysicallyLocatable
 from zope.app.security.principalregistry import principalRegistry
 from zope.app.security.interfaces import IPrincipal
+from zope.app.security.interfaces import PrincipalLookupError
 
-# BBB Backward Compatibility (Can go away in 3.3)
-zope.deprecation.__show__.off()
-from zope.exceptions import NotFoundError
-zope.deprecation.__show__.on()
-import warnings
-
-
 def undoSetup(event):
     # setup undo functionality
-    sm = zapi.getGlobalSiteManager()
-    sm.provideUtility(IUndoManager, ZODBUndoManager(event.database))
+    sm = zope.component.getGlobalSiteManager()
+    sm.registerUtility(ZODBUndoManager(event.database), IUndoManager)
 
 class Prefix(unicode):
     """A prefix is equal to any string it is a prefix of.
@@ -158,15 +149,6 @@
                 except PrincipalLookupError:
                     # principals might have passed away
                     pass
-                except NotFoundError: # BBB Backward Compatibility
-                    warnings.warn(
-                        "A %s instance raised a NotFoundError in "
-                        "getPrincipals.  Raising NotFoundError in this "
-                        "method is deprecated and will no-longer be supported "
-                        "staring in Zope 3.3.  PrincipalLookupError should "
-                        "be raised instead."
-                        % principalRegistry.__class__.__name__,
-                        DeprecationWarning)
         return entries
 
     def undoTransactions(self, ids):

Modified: Zope3/branches/jim-adapter/src/zope/app/versioncontrol/README.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/versioncontrol/README.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/versioncontrol/README.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -71,6 +71,10 @@
 
     >>> component.provideAdapter(
     ...     zope.app.annotation.attribute.AttributeAnnotations)
+    ... # doctest: +NORMALIZE_WHITESPACE
+    Registered event:
+    AdapterRegistration(<BaseGlobalComponents base>, 
+        [IAttributeAnnotatable], IAnnotations, '', AttributeAnnotations, u'')
 
 Now we need to create a database with an instance of our sample object to work
 with:
@@ -140,6 +144,10 @@
     >>> component.provideHandler(
     ...     (lambda ob, evt: showEvent("applied version control", ob, evt)),
     ...     (interface.Interface, interfaces.IVersionControlApplied))
+    ... # doctest: +NORMALIZE_WHITESPACE
+    Registered event:
+    HandlerRegistration(<BaseGlobalComponents base>, 
+                     [Interface, IVersionControlApplied], u'', <lambda>, u'')
 
 Now, let's put an object under version control and verify that we can
 determine that fact by checking against the interface:

Modified: Zope3/branches/jim-adapter/src/zope/app/versioncontrol/interfaces.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/versioncontrol/interfaces.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/versioncontrol/interfaces.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -16,18 +16,15 @@
 $Id$
 """
 import persistent.interfaces
-
 import zope.interface
 import zope.schema
+import zope.component.interfaces
 
 from zope.schema.vocabulary import SimpleVocabulary
-
-import zope.app.annotation.interfaces
-import zope.app.event.interfaces
-
 from zope.i18nmessageid import MessageFactory
 _ = MessageFactory('zope.app.versioncontrol')
 
+import zope.app.annotation.interfaces
 
 class VersionControlError(Exception):
     pass
@@ -326,7 +323,7 @@
 
 # Events that are raised for interesting occurances:
 
-class IVersionEvent(zope.app.event.interfaces.IObjectEvent):
+class IVersionEvent(zope.component.interfaces.IObjectEvent):
     """Base interface for all version-control events."""
 
     info = zope.interface.Attribute("Version info (IVersionInfo)")

Modified: Zope3/branches/jim-adapter/src/zope/app/versioncontrol/repository.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/versioncontrol/repository.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/versioncontrol/repository.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -25,10 +25,9 @@
 
 import zope.event
 import zope.interface
+import zope.datetime
 
-from zope.app import datetimeutils
 from zope.app import zapi
-
 from zope.app.annotation.interfaces import IAnnotations
 
 from zope.app.versioncontrol import event
@@ -500,8 +499,8 @@
                 sticky = ('B', selector)
             else:
                 try:
-                    timestamp = datetimeutils.time(selector)
-                except datetimeutils.DateTimeError:
+                    timestamp = zope.datetime.time(selector)
+                except zope.datetime.DateTimeError:
                     raise VersionControlError(
                         'Invalid version selector: %s' % selector
                         )

Modified: Zope3/branches/jim-adapter/src/zope/app/versioncontrol/tests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/versioncontrol/tests.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/versioncontrol/tests.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -20,7 +20,7 @@
 import persistent
 
 from zope import component, interface
-from zope.component.tests.placelesssetup import PlacelessSetup
+from zope.component.testing import PlacelessSetup
 from zope.testing import doctest, module
 from transaction import abort
 

Modified: Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/contentworkflow.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/contentworkflow.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/contentworkflow.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -22,7 +22,6 @@
 
 from zope.app import zapi
 from zope.app.event.interfaces import IObjectCreatedEvent
-from zope.app.servicenames import Utilities
 
 from zope.app.workflow.interfaces import IProcessInstanceContainer
 from zope.app.workflow.interfaces import IProcessInstanceContainerAdaptable

Modified: Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/definition.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/definition.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/definition.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -21,11 +21,12 @@
 from zope.interface import implements, classProvides
 from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
 from zope.security.checker import CheckerPublic
+from zope.event import notify
+from zope.component.interfaces import ObjectEvent
 
+from zope.app.event.objectevent import modified
 from zope.app.container.interfaces import IReadContainer
 from zope.app.container.contained import Contained, containedEvent
-from zope.event import notify
-from zope.app.event.objectevent import ObjectEvent, modified
 from zope.app.schema.interfaces import IVocabularyFactory
 from zope.app.workflow.definition import ProcessDefinition
 from zope.app.workflow.definition import ProcessDefinitionElementContainer

Modified: Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/instance.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/instance.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/instance.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -29,7 +29,6 @@
 from zope.app.workflow.stateful.interfaces import ITransitionEvent
 from zope.app.workflow.stateful.interfaces import IBeforeRelevantDataChangeEvent
 from zope.app.workflow.stateful.interfaces import IAfterRelevantDataChangeEvent
-from zope.app.servicenames import Utilities
 from zope.app.traversing.api import getParent
 from zope.app.workflow.instance import ProcessInstance
 from zope.app.container.contained import Contained

Modified: Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/tests/test_instance.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/tests/test_instance.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/tests/test_instance.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -21,7 +21,7 @@
 from zope.interface.verify import verifyClass
 from zope.schema import Text, Int
 
-from zope.component.service import serviceManager
+from zope import component
 from zope.app.event.tests.placelesssetup import events, clearEvents
 from zope.app.security.interfaces import IPermission
 from zope.app.security.permission import Permission
@@ -29,10 +29,6 @@
 from zope.security.management import newInteraction, endInteraction
 
 from zope.app.annotation.interfaces import IAttributeAnnotatable
-from zope.app.component.interfaces.registration import IRegisterable
-from zope.app.component.interfaces.registration import IRegistered
-from zope.app.component.interfaces.registration import ActiveStatus
-from zope.app.servicenames import Utilities
 
 from zope.app.workflow.tests.workflowsetup import WorkflowSetup
 from zope.app.workflow.interfaces import IProcessDefinition
@@ -49,7 +45,6 @@
 from zope.app.workflow.stateful.instance import StateChangeInfo
 
 from zope.app import zapi
-from zope.app.tests import ztapi
 from zope.app.container.contained import contained
 from zope.app.utility import UtilityRegistration
 from zope.app.testing import setup
@@ -348,7 +343,7 @@
     def setUp(self):
         WorkflowSetup.setUp(self)
 
-        ztapi.provideUtility(IPermission, Permission('deny', 'Deny'), 'deny')
+        component.provideUtility(Permission('deny', 'Deny'), IPermission, 'deny')
 
         endInteraction()
         newInteraction(ParticipationStub('test'))

Modified: Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/tests/test_xmlimportexport.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/tests/test_xmlimportexport.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/workflow/stateful/tests/test_xmlimportexport.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -34,7 +34,7 @@
 from zope.app.workflow.stateful.definition import State, Transition
 from zope.app.workflow.stateful.xmlimportexport import XMLExportHandler
 from zope.app.workflow.stateful.xmlimportexport import XMLImportHandler
-from zope.app.tests import ztapi
+from zope.app.testing import ztapi
 from zope.interface import implements, classImplements, Interface
 from zope.interface.verify import verifyClass
 from zope.schema import TextLine

Modified: Zope3/branches/jim-adapter/src/zope/app/workflow/tests/workflowsetup.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/workflow/tests/workflowsetup.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/workflow/tests/workflowsetup.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,4 +1,4 @@
- ##############################################################################
+##############################################################################
 #
 # Copyright (c) 2001, 2002 Zope Corporation and Contributors.
 # All Rights Reserved.
@@ -25,30 +25,24 @@
 from zope.app.servicenames import Authentication, Utilities
 from zope.app.site.tests.placefulsetup import PlacefulSetup
 from zope.app.utility import LocalUtilityService
-from zope.app.tests import setup
+from zope.app.testing import setup
 
 
 class WorkflowSetup(PlacefulSetup):
 
     def setUp(self):
-        #getGlobalServices has been moved 
-        #self.root_sm = zapi.getGlobalServices()
         self.root_sm = zapi.getGlobalSiteManager()
 
         self.sm = PlacefulSetup.setUp(self, site=True)
         setup.addService(self.sm, Utilities, LocalUtilityService())
 
         self.default = zapi.traverse(self.sm, "default")
-        #moved to registrationManager
-        #self.cm = self.default.getRegistrationManager()
         self.cm = self.default.registrationManager
 
         self.sm1 = self.makeSite('folder1')
         setup.addService(self.sm1, Utilities, LocalUtilityService())
 
         self.default1 = zapi.traverse(self.sm1, "default")
-        #moved to registrationManager
-        #self.cm1 = self.default1.getRegistrationManager()
         self.cm1 = self.default1.registrationManager
 
 

Modified: Zope3/branches/jim-adapter/src/zope/app/xmlrpcintrospection/xmlrpcintrospection.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/xmlrpcintrospection/xmlrpcintrospection.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/xmlrpcintrospection/xmlrpcintrospection.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -139,7 +139,7 @@
 
         for result in self._getRegistrationAdapters(interfaces):
             if result.name == method_name:
-                method = getattr(result.value, method_name)
+                method = getattr(result.factory, method_name)
                 return self._getFunctionSignature(method)
 
         return 'undef'
@@ -151,7 +151,7 @@
 
         for result in self._getRegistrationAdapters(interfaces):
             if result.name == method_name:
-                method = getattr(result.value, method_name)
+                method = getattr(result.factory, method_name)
                 return self._getFunctionHelp(method)
 
         return 'undef'

Modified: Zope3/branches/jim-adapter/src/zope/app/zapi/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/zapi/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/zapi/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -33,18 +33,10 @@
 from zope.app.publisher.browser import queryDefaultViewName
 from zope.app.traversing.api import *
 from zope.app.traversing.browser.absoluteurl import absoluteURL
-from zope.app.exception.interfaces import UserError
+from zope.exceptions.interfaces import UserError
 
 name = getName
 
 def principals():
     from zope.app.security.interfaces import IAuthentication
     return getUtility(IAuthentication)
-
-# BBB: Gone in 3.3.
-from zope.deprecation import deprecated
-from zope.app import servicenames
-
-deprecated('servicenames',
-           'The concept of services has been removed. Please use utilities '
-           'instead. This reference will be removed in Zope 3.3.')

Modified: Zope3/branches/jim-adapter/src/zope/app/zapi/interfaces.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/zapi/interfaces.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/zapi/interfaces.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -64,7 +64,4 @@
     def principals():
         """Return the authentication utility
         """
-        
-    # BBB: Deprecated. Gone in X3.3.
-    servicenames = Attribute("Service Names")
 

Modified: Zope3/branches/jim-adapter/src/zope/app/zptpage/configure.zcml
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/zptpage/configure.zcml	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/zptpage/configure.zcml	2006-04-04 15:56:58 UTC (rev 66397)
@@ -56,7 +56,7 @@
 
   <adapter
       for=".interfaces.IZPTPage"
-      provides="zope.app.size.interfaces.ISized"
+      provides="zope.size.interfaces.ISized"
       factory=".zptpage.Sized"
       trusted="y"
       permission="zope.ManageContent"

Modified: Zope3/branches/jim-adapter/src/zope/app/zptpage/tests/test_zptpage.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/zptpage/tests/test_zptpage.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/zptpage/tests/test_zptpage.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -168,7 +168,7 @@
 class SizedTests(unittest.TestCase):
 
     def testInterface(self):
-        from zope.app.size.interfaces import ISized
+        from zope.size.interfaces import ISized
         self.failUnless(ISized.implementedBy(Sized))
         self.failUnless(verifyClass(ISized, Sized))
 

Modified: Zope3/branches/jim-adapter/src/zope/app/zptpage/zptpage.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/zptpage/zptpage.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/app/zptpage/zptpage.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -20,10 +20,10 @@
 from zope.security.proxy import ProxyFactory
 from zope.interface import implements
 from zope.pagetemplate.pagetemplate import PageTemplate
+from zope.size.interfaces import ISized
 
 from zope.app.pagetemplate.engine import AppPT
 from zope.app.i18n import ZopeMessageFactory as _
-from zope.app.size.interfaces import ISized
 from zope.app.filerepresentation.interfaces import IReadFile, IWriteFile
 from zope.app.filerepresentation.interfaces import IFileFactory
 from zope.app.container.contained import Contained

Modified: Zope3/branches/jim-adapter/src/zope/component/DEPENDENCIES.cfg
===================================================================
--- Zope3/branches/jim-adapter/src/zope/component/DEPENDENCIES.cfg	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/component/DEPENDENCIES.cfg	2006-04-04 15:56:58 UTC (rev 66397)
@@ -2,3 +2,4 @@
 zope.interface
 zope.testing
 zope.deprecation
+zope.deferredimport

Modified: Zope3/branches/jim-adapter/src/zope/component/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/component/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/component/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -24,53 +24,19 @@
 from zope.component.interfaces import IComponentRegistrationConvenience
 from zope.component.interfaces import IDefaultViewName
 from zope.component.interfaces import IFactory
-from zope.component.interfaces import ISiteManager
 from zope.component.interfaces import ComponentLookupError
-from zope.component.site import globalSiteManager
+from zope.component.interfaces import IComponentLookup
+from zope.component.globalregistry import base as globalSiteManager
 
+import zope.deferredimport
+
 _class_types = type, ClassType
 
-##############################################################################
-# BBB: Import some backward-compatibility; 12/10/2004
-from zope.component.bbb import exceptions
-sys.modules['zope.component.exceptions'] = exceptions
-from zope.component.bbb import service
-sys.modules['zope.component.service'] = service
-from zope.component.bbb import adapter
-sys.modules['zope.component.adapter'] = adapter
-from zope.component.bbb import utility
-sys.modules['zope.component.utility'] = utility
-from zope.component.bbb import servicenames
-sys.modules['zope.component.servicenames'] = servicenames
-from zope.component.bbb import contextdependent
-sys.modules['zope.component.contextdependent'] = contextdependent
+zope.deferredimport.deprecated(
+    "Use IComponentLookup instead.  ISiteManager will be removed in Zope 3.5.",
+    ISiteManager = "zope.component.interfaces:IComponentLookup",
+    )
 
-from zope.component.bbb import tests as bbb_tests
-bbb_tests.__warn__ = False
-from zope.component.bbb.tests import placelesssetup
-sys.modules['zope.component.tests.placelesssetup'] = placelesssetup
-from zope.component.bbb.tests import request
-sys.modules['zope.component.tests.request'] = request
-from zope.component.bbb.tests import components
-sys.modules['zope.component.tests.components'] = components
-bbb_tests.__warn__ = True
-
-service.__warn__ = False
-service.serviceManager = service.GlobalServiceManager(
-    'serviceManager', __name__, globalSiteManager)
-service.__warn__ = True
-
-from zope.component.bbb import getGlobalServices, getGlobalService
-from zope.component.bbb import getServices, getService
-from zope.component.bbb import getServiceDefinitions
-from zope.component.bbb import getView, queryView
-from zope.component.bbb import getMultiView, queryMultiView
-from zope.component.bbb import getViewProviding, queryViewProviding
-from zope.component.bbb import getDefaultViewName, queryDefaultViewName
-from zope.component.bbb import getResource, queryResource
-##############################################################################
-
-
 # Try to be hookable. Do so in a try/except to avoid a hard dependency.
 try:
     from zope.hookable import hookable
@@ -90,10 +56,10 @@
     if context is None:
         return getGlobalSiteManager()
     else:
-        # Use the global site manager to adapt context to `ISiteManager`
+        # Use the global site manager to adapt context to `IComponentLookup`
         # to avoid the recursion implied by using a local `getAdapter()` call.
         try:
-            return ISiteManager(context)
+            return IComponentLookup(context)
         except TypeError, error:
             raise ComponentLookupError(*error.args)
 
@@ -270,19 +236,7 @@
 # Factories
 
 def createObject(__factory_name, *args, **kwargs):
-    # BBB: Goes away in 3.3
-    if not isinstance(__factory_name, basestring):
-        import warnings
-        warnings.warn(
-            "Passing a context as a first argument to createObject is "
-            "deprecated.  It will be unsupported in Zope X3.3.  Use a "
-            "context keyword argument instead.",
-            DeprecationWarning, 2)
-        context = __factory_name
-        __factory_name, args = args[0], args[1:]
-    else:
-        context = kwargs.pop('context', None)
-
+    context = kwargs.pop('context', None)
     return getUtility(IFactory, __factory_name, context)(*args, **kwargs)
 
 def getFactoryInterfaces(name, context=None):
@@ -312,7 +266,7 @@
         else:
             raise TypeError("Missing 'provides' argument")
 
-    getGlobalSiteManager().provideUtility(provides, component, name)
+    getGlobalSiteManager().registerUtility(component, provides, name)
 
 
 def provideAdapter(factory, adapts=None, provides=None, name=''):
@@ -329,7 +283,7 @@
         except AttributeError:
             raise TypeError("Missing 'adapts' argument")
 
-    getGlobalSiteManager().provideAdapter(adapts, provides, name, factory)
+    getGlobalSiteManager().registerAdapter(factory, adapts, provides, name)
 
 def provideSubscriptionAdapter(factory, adapts=None, provides=None):
     if provides is None:
@@ -345,7 +299,8 @@
         except AttributeError:
             raise TypeError("Missing 'adapts' argument")
 
-    getGlobalSiteManager().subscribe(adapts, provides, factory)
+    getGlobalSiteManager().registerSubscriptionAdapter(
+        factory, adapts, provides)
 
 def provideHandler(factory, adapts=None):
 
@@ -355,4 +310,4 @@
         except AttributeError:
             raise TypeError("Missing 'adapts' argument")
 
-    getGlobalSiteManager().subscribe(adapts, None, factory)
+    getGlobalSiteManager().registerHandler(factory, adapts)

Copied: Zope3/branches/jim-adapter/src/zope/component/adapter.py (from rev 66386, Zope3/branches/jim-adapter/src/zope/component/adapter.py)

Modified: Zope3/branches/jim-adapter/src/zope/component/bbb/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/component/bbb/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/component/bbb/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,218 +17,4 @@
 """
 __docformat__ = "reStructuredText"
 
-__warn__ = True
 
-import sys
-import warnings
-
-from zope.interface import Interface, providedBy
-from zope.component.bbb.interfaces import IServiceService, IDefaultViewName
-from zope.component.bbb.service import GlobalServiceManager
-
-# Try to be hookable. Do so in a try/except to avoid a hard dependency.
-try:
-    from zope.hookable import hookable
-except ImportError:
-    def hookable(ob):
-        return ob
-
-def warningLevel():
-    """Returns the number of the first stack frame outside of zope.component"""
-    try:
-        level = 2
-        while sys._getframe(level).f_globals['__name__']=='zope.component.bbb':
-            level += 1
-        return level
-    except ValueError:
-        return 2
-
-
-def getGlobalServices():
-    if __warn__:
-        warnings.warn(
-            "The concept of services has been deprecated. You probably want to "
-            "use `getGlobalSiteManager()`.",
-            DeprecationWarning, warningLevel())
-    from zope.component import getGlobalSiteManager
-    return GlobalServiceManager('servicemanager', 'zope.component.service',
-                                getGlobalSiteManager())
-
-def getGlobalService(name):
-    if __warn__:
-        warnings.warn(
-            "The concept of services has been deprecated. You probably want to "
-            "use `getGlobalSiteManager()` or `getUtility()`.",
-            DeprecationWarning, warningLevel())
-    return getGlobalServices().getService(name)
-
-def getServices(context=None):
-    if __warn__:
-        warnings.warn(
-            "The concept of services has been deprecated. You probably want to "
-            "use `getGlobalSiteManager()` or `getUtility()`.",
-            DeprecationWarning, warningLevel())
-    if context is None:
-        return getGlobalServices()
-    else:
-        # Use the global service manager to adapt context to IServiceService
-        # to avoid the recursion implied by using a local getAdapter call.
-        try:
-            return IServiceService(context)
-        except TypeError, error:
-            from zope.component.bbb.exceptions import ComponentLookupError
-            raise ComponentLookupError(*error.args)
-
-getServices = hookable(getServices)
-
-def getService(name, context=None):
-    if __warn__:
-        warnings.warn(
-            "The concept of services has been deprecated. You probably want to "
-            "use `getGlobalSiteManager()` or `getUtility()`.",
-            DeprecationWarning, warningLevel())
-    return getServices(context).getService(name)
-
-def getServiceDefinitions(context=None):
-    if __warn__:
-        warnings.warn(
-            "The concept of services has been deprecated.",
-            DeprecationWarning, warningLevel())
-    return getServices(context).getServiceDefinitions()
-
-# Presentation API
-
-def getView(object, name, request, providing=Interface, context=None):
-    if __warn__:
-        warnings.warn(
-            "The concrete concept of a view has been deprecated. You want to "
-            "use `getMultiAdapter((object, request), providing, name, "
-            "context)`.",
-            DeprecationWarning, warningLevel())
-    view = queryView(object, name, request, context=context,
-                     providing=providing)
-    if view is not None:
-        return view
-
-    from zope.component.bbb.exceptions import ComponentLookupError
-    raise ComponentLookupError("Couldn't find view",
-                               name, object, context, request, providing)
-
-def queryView(object, name, request,
-              default=None, providing=Interface, context=None):
-    if __warn__:
-        warnings.warn(
-            "The concrete concept of a view has been deprecated. You want to "
-            "use `queryMultiAdapter((object, request), providing, name, "
-            "default, context)`.",
-            DeprecationWarning, warningLevel())
-    from zope.component import queryMultiAdapter
-    return queryMultiAdapter((object, request), providing, name,
-                             default, context)
-
-queryView = hookable(queryView)
-
-def getMultiView(objects, request, providing=Interface, name='', context=None):
-    if __warn__:
-        warnings.warn(
-            "The concrete concept of a view has been deprecated. You want to "
-            "use `getMultiAdapter(objects+(request,), providing, name, "
-            "context)`.",
-            DeprecationWarning, warningLevel())
-    view = queryMultiView(objects, request, providing, name, context=context)
-    if view is not None:
-        return view
-
-    from zope.component.bbb.exceptions import ComponentLookupError
-    raise ComponentLookupError("Couldn't find view",
-                               name, objects, context, request)
-
-def queryMultiView(objects, request, providing=Interface, name='',
-                   default=None, context=None):
-    if __warn__:
-        warnings.warn(
-            "The concrete concept of a view has been deprecated. You want to "
-            "use `getMultiAdapter(objects+(request,), providing, name, "
-            "default, context)`.",
-            DeprecationWarning, warningLevel())
-    from zope.component import queryMultiAdapter
-    return queryMultiAdapter(objects+(request,), providing, name,
-                             default, context)
-
-def getViewProviding(object, providing, request, context=None):
-    if __warn__:
-        warnings.warn(
-            "The concrete concept of a view has been deprecated. You want to "
-            "use `getMultiAdapter((object, request), providing, name, "
-            "context)`.",
-            DeprecationWarning, warningLevel())
-    return getView(object, '', request, providing, context)
-
-def queryViewProviding(object, providing, request, default=None, 
-                       context=None):
-    if __warn__:
-        warnings.warn(
-            "The concrete concept of a view has been deprecated. You want to "
-            "use `queryMultiAdapter((object, request), providing, name, "
-            "default, context)`.",
-            DeprecationWarning, warningLevel())
-    return queryView(object, '', request, default, providing, context)
-
-def getDefaultViewName(object, request, context=None):
-    if __warn__:
-        warnings.warn(
-            "The concrete concept of a view has been deprecated. You want to "
-            "use `zapi.getDefaultViewName()` instead.",
-            DeprecationWarning, warningLevel())
-    view = queryDefaultViewName(object, request, context=context)
-    if view is not None:
-        return view
-
-    from zope.component.bbb.exceptions import ComponentLookupError
-    raise ComponentLookupError("Couldn't find default view name",
-                               context, request)
-
-def queryDefaultViewName(object, request, default=None, context=None):
-    if __warn__:
-        warnings.warn(
-            "The concrete concept of a view has been deprecated. You want to "
-            "use `zapi.queryDefaultViewName()` instead.",
-            DeprecationWarning, warningLevel())
-    from zope.component.bbb.exceptions import ComponentLookupError
-    from zope.component import getSiteManager
-    try:
-        adapters = getSiteManager(context)
-    except ComponentLookupError:
-        # Oh blast, no adapter service. We're probably just running from a test
-        return default
-
-    name = adapters.adapters.lookup(map(providedBy, (object, request)),
-                                    IDefaultViewName)
-    if name is not None:
-        return name
-    return default
-
-def getResource(name, request, providing=Interface, context=None):
-    if __warn__:
-        warnings.warn(
-            "The concrete concept of a resource has been deprecated. You want "
-            "to use `getAdapter(request, providing, name, context)`",
-            DeprecationWarning, warningLevel())
-    view = queryResource(name, request, providing=providing, context=context)
-    if view is not None:
-        return view
-
-    from zope.component.bbb.exceptions import ComponentLookupError
-    raise ComponentLookupError("Couldn't find resource", name, request)
-
-def queryResource(name, request, default=None, providing=Interface,
-                  context=None):
-    if __warn__:
-        warnings.warn(
-            "The concrete concept of a resource has been deprecated. You want "
-            "to use `queryAdapter(request, providing, name, default, context)`",
-            DeprecationWarning, warningLevel())
-    from zope.component import queryAdapter
-    return queryAdapter(request, providing, name, default, context)
-
-

Deleted: Zope3/branches/jim-adapter/src/zope/component/bbb/adapter.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/component/bbb/adapter.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/component/bbb/adapter.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,167 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Global Adapter Service
-
-$Id$
-"""
-__docformat__ = "reStructuredText"
-
-import sys
-import warnings
-from types import ClassType
-
-from zope.component.exceptions import ComponentLookupError
-from zope.component.interfaces import IAdapterService, IRegistry
-from zope.component.bbb.service import GlobalService
-from zope.component.site import AdapterRegistration, SubscriptionRegistration
-from zope.interface import implements, providedBy, Interface, implementedBy
-from zope.interface.interfaces import IInterface
-
-class IGlobalAdapterService(IAdapterService, IRegistry):
-
-    def register(required, provided, name, factory, info=''):
-        """Register an adapter factory
-
-        :Parameters:
-          - `required`: a sequence of specifications for objects to be
-             adapted.
-          - `provided`: The interface provided by the adapter
-          - `name`: The adapter name
-          - `factory`: The object used to compute the adapter
-          - `info`: Provide some info about this particular adapter.
-        """
-
-    def subscribe(required, provided, factory, info=''):
-        """Register a subscriber factory
-
-        :Parameters:
-          - `required`: a sequence of specifications for objects to be
-             adapted.
-          - `provided`: The interface provided by the adapter
-          - `name`: The adapter name
-          - `factory`: The object used to compute the subscriber
-          - `info`: Provide some info about this particular adapter.
-        """
-
-class AdapterService(object):
-    """Base implementation of an adapter service, implementing only the
-    `IAdapterService` interface.
-
-    No write-methods were implemented.
-    """
-
-    implements(IAdapterService)
-
-    def __init__(self, sitemanager=None):
-        if sitemanager is None:
-            from zope.component.site import GlobalSiteManager
-            sitemanager = GlobalSiteManager()
-        self.sm = sitemanager
-
-    def __getattr__(self, name):
-        attr = getattr(self.sm.adapters, name)
-        if attr is not None:
-            return attr
-        raise AttributeError(name)
-
-
-class GlobalAdapterService(AdapterService, GlobalService):
-    """Global Adapter Service implementation."""
-
-    implements(IGlobalAdapterService)
-
-    def __init__(self, sitemanager=None):
-        super(GlobalAdapterService, self).__init__(sitemanager)
-
-    def register(self, required, provided, name, factory, info=''):
-        """Register an adapter
-
-        >>> registry = GlobalAdapterService()
-        >>> class R1(Interface):
-        ...     pass
-        >>> class R2(R1):
-        ...     pass
-        >>> class P1(Interface):
-        ...     pass
-        >>> class P2(P1):
-        ...     pass
-
-        >>> registry.register((R1, ), P2, 'bob', 'c1', 'd1')
-        >>> registry.register((R1, ), P2,    '', 'c2', 'd2')
-        >>> registry.lookup((R2, ), P1, '')
-        'c2'
-
-        >>> registrations = map(repr, registry.registrations())
-        >>> registrations.sort()
-        >>> for registration in registrations:
-        ...    print registration
-        AdapterRegistration(('R1',), 'P2', '', 'c2', 'd2')
-        AdapterRegistration(('R1',), 'P2', 'bob', 'c1', 'd1')
-
-        Let's make sure that we can also register regular classes for
-        adaptation.
-
-        >>> class O1(object):
-        ...     pass
-        >>> class O2(object):
-        ...     pass
-        >>> class O3(object):
-        ...     def __init__(self, obj1, obj2=None):
-        ...         pass
-
-        >>> registry.register((O1, ), R1, '', O3)
-        >>> registry.queryAdapter(O1(), R1, '').__class__
-        <class 'zope.component.bbb.adapter.O3'>
-
-        >>> registry.register((O1, O2), R1, '', O3)
-        >>> registry.queryMultiAdapter((O1(), O2()), R1, '').__class__
-        <class 'zope.component.bbb.adapter.O3'>
-        """
-        self.sm.provideAdapter(required, provided, name, factory, info)
-
-    def subscribe(self, required, provided, factory, info=''):
-        """Register an subscriptions adapter
-
-        >>> registry = GlobalAdapterService()
-        >>> class R1(Interface):
-        ...     pass
-        >>> class R2(R1):
-        ...     pass
-        >>> class P1(Interface):
-        ...     pass
-        >>> class P2(P1):
-        ...     pass
-
-        >>> registry.subscribe((R1, ), P2, 'c1', 'd1')
-        >>> registry.subscribe((R1, ), P2, 'c2', 'd2')
-        >>> subscriptions = map(str, registry.subscriptions((R2, ), P1))
-        >>> subscriptions.sort()
-        >>> subscriptions
-        ['c1', 'c2']
-
-        >>> registrations = map(repr, registry.registrations())
-        >>> registrations.sort()
-        >>> for registration in registrations:
-        ...    print registration
-        SubscriptionRegistration(('R1',), 'P2', 'c1', 'd1')
-        SubscriptionRegistration(('R1',), 'P2', 'c2', 'd2')
-
-        """
-        self.sm.subscribe(required, provided, factory, info)
-
-    def registrations(self):
-        for registration in self.sm.registrations():
-            if isinstance(registration,
-                          (AdapterRegistration, SubscriptionRegistration)):
-                yield registration

Deleted: Zope3/branches/jim-adapter/src/zope/component/bbb/contextdependent.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/component/bbb/contextdependent.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/component/bbb/contextdependent.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,27 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""A simple mix-in class that implements IContextDependent. 
-
-$Id$
-"""
-from zope.component.interfaces import IContextDependent
-from zope.interface import implements
-
-class ContextDependent(object):
-    """standard boilerplate for context dependent objects"""
-
-    implements(IContextDependent)
-
-    def __init__(self, context):
-        self.context = context

Deleted: Zope3/branches/jim-adapter/src/zope/component/bbb/exceptions.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/component/bbb/exceptions.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/component/bbb/exceptions.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,24 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Exceptions used by the Component Architecture
-
-$Id$
-"""
-from zope.component.interfaces import ComponentLookupError
-from zope.component.interfaces import Invalid, Misused
-
-
-__all__ = ["ComponentLookupError",
-           "Invalid",
-           "Misused"]

Deleted: Zope3/branches/jim-adapter/src/zope/component/bbb/service.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/component/bbb/service.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/component/bbb/service.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,172 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Service Manager implementation
-
-$Id$
-"""
-__warn__ = True
-import warnings
-
-from zope.exceptions import DuplicationError
-from zope.component.bbb.interfaces import IServiceService
-from zope.interface import implements, Interface, directlyProvides
-
-
-class IGlobalServiceManager(IServiceService):
-
-    def defineService(name, interface):
-        """Define a new service of the given name implementing the given
-        interface.  If the name already exists, raises
-        DuplicationError"""
-
-    def provideService(name, component):
-        """Register a service component.
-
-        Provide a service component to do the work of the named
-        service.  If a service component has already been assigned to
-        this name, raise DuplicationError; if the name has not been
-        defined, raises UndefinedService; if the component does not
-        implement the registered interface for the service name,
-        raises InvalidService.
-
-        """
-
-class IService(Interface):
-    """Marker interface that is used as utility interface to simulate
-       services."""
-
-class IServiceDefinition(Interface):
-    """Marker interface that is used as utility interface to store service
-    defintions (name, interface)."""
-
-class UndefinedService(Exception):
-    """An attempt to register a service that has not been defined
-    """
-
-class InvalidService(Exception):
-    """An attempt to register a service that doesn't implement
-       the required interface
-    """
-
-class GlobalServiceManager(object):
-    """service manager"""
-
-    implements(IGlobalServiceManager)
-
-    def __init__(self, name=None, module=None, sitemanager=None):
-        if __warn__:
-            warnings.warn(
-                "The concept of services has been deprecated. You now have "
-                "only adapters and utilities, which are managed by the site "
-                "manager, which is probably the object you want.",
-                DeprecationWarning, 2)
-        if sitemanager is None:
-            from zope.component.site import GlobalSiteManager
-            sitemanager = GlobalSiteManager()
-        self.sm = sitemanager
-        self.__name__ = name
-        self.__module__ = module
-
-    def _clear(self):
-        pass
-
-    def __reduce__(self):
-        # Global service managers are pickled as global objects
-        return self.__name__
-
-    def defineService(self, name, interface):
-        """see IGlobalServiceManager interface"""
-
-        utils = self.sm.getAllUtilitiesRegisteredFor(IServiceDefinition)
-        names = [n for n, iface in utils]
-        if name in names:
-            raise DuplicationError(name)
-
-        self.sm.provideUtility(IServiceDefinition, (name, interface),
-                                name=name, strict=False)
-
-    def getServiceDefinitions(self):
-        """see IServiceService Interface"""
-        defs = list(self.sm.getAllUtilitiesRegisteredFor(IServiceDefinition))
-        return defs + [('Services', IServiceService)]
-
-    def provideService(self, name, component, force=False):
-        """see IGlobalServiceManager interface, above
-
-        The force keyword allows one to replace an existing
-        service.  This is mostly useful in testing scenarios.
-        """
-
-        if not force and self.sm.queryUtility(IService, name) is not None:
-            raise DuplicationError(name)
-
-        utils = self.sm.getAllUtilitiesRegisteredFor(IServiceDefinition)
-        if name not in [name for name, iface in utils]:
-            raise UndefinedService(name)
-
-        if not dict(self.getServiceDefinitions())[name].providedBy(component):
-            raise InvalidService(name, component,
-                                 dict(self.getServiceDefinitions())[name])
-
-        if isinstance(component, GlobalService):
-            component.__parent__ = self
-            component.__name__ = name
-
-        # Ignore the base services, since their functionality is provided by
-        # the SM.
-        if name in ('Adapters', 'Utilities', 'Services'):
-            return
-
-        directlyProvides(component, IService)
-        self.sm.provideUtility(IService, component, name)
-
-    def getService(self, name):
-        """see IServiceService interface"""
-        if name == 'Services':
-            return self
-
-        if name == 'Adapters':
-            from zope.component.bbb.adapter import GlobalAdapterService
-            return GlobalAdapterService(self.sm)
-
-        if name == 'Utilities':
-            from zope.component.bbb.utility import GlobalUtilityService
-            return GlobalUtilityService(self.sm)
-
-        service = self.sm.queryUtility(IService, name)
-        if service is None:
-            from zope.component.bbb.exceptions import ComponentLookupError
-            raise ComponentLookupError(name)
-
-        return service
-
-
-def GS(service_manager, service_name):
-    return service_manager.getService(service_name)
-
-class GlobalService(object):
-
-    def __reduce__(self):
-        return GS, (self.__parent__, self.__name__)
-
-
-def __getSM(sitemanager=None):
-    return GlobalServiceManager('serviceManager', __name__, sitemanager)
-
-def defineService(name, interface, sitemanager=None):
-    if sitemanager is None:
-        from zope.component.site import globalSiteManager
-        sitemanager = globalSiteManager
-    __getSM(sitemanager).defineService(name, interface)
-

Deleted: Zope3/branches/jim-adapter/src/zope/component/bbb/servicenames.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/component/bbb/servicenames.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/component/bbb/servicenames.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,20 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Default service names for CA core services
-
-$Id$
-"""
-Adapters = 'Adapters'
-Utilities = 'Utilities'
-Services = 'Services'

Deleted: Zope3/branches/jim-adapter/src/zope/component/bbb/utility.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/component/bbb/utility.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/component/bbb/utility.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,72 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""utility service
-
-$Id$
-"""
-from zope.component.exceptions import Invalid, ComponentLookupError
-from zope.component.interfaces import IUtilityService, IRegistry
-from zope.component.service import GlobalService, IService, IServiceDefinition
-from zope.component.site import UtilityRegistration
-import zope.interface
-
-class IGlobalUtilityService(IUtilityService, IRegistry):
-
-    def provideUtility(providedInterface, component, name='', info=''):
-        """Provide a utility
-
-        A utility is a component that provides an interface.
-        """
-
-class UtilityService(object):
-    """Provide IUtilityService
-
-    Mixin that superimposes utility management on adapter registery
-    implementation
-    """
-
-    def __init__(self, sitemanager=None):
-        self.__parent__ = None
-        if sitemanager is None:
-            from zope.component.site import GlobalSiteManager
-            sitemanager = GlobalSiteManager()
-        self.sm = sitemanager
-
-    def __getattr__(self, name):
-        attr = getattr(self.sm, name)
-        if attr is not None:
-            return attr
-
-        attr = getattr(self.sm.utilities, name)
-        if attr is not None:
-            return attr
-
-        raise AttributeError(name)
-
-
-class GlobalUtilityService(UtilityService, GlobalService):
-
-    zope.interface.implementsOnly(IGlobalUtilityService)
-
-    def __init__(self, sitemanager=None):
-        super(GlobalUtilityService, self).__init__(sitemanager)
-
-    def provideUtility(self, providedInterface, component, name='', info=''):
-        self.sm.provideUtility(providedInterface, component, name, info)
-
-    def registrations(self):
-        for reg in self.sm.registrations():
-            if isinstance(reg, UtilityRegistration):
-                if not reg.provided in (IService, IServiceDefinition): 
-                    yield reg

Copied: Zope3/branches/jim-adapter/src/zope/component/contextdependent.py (from rev 66386, Zope3/branches/jim-adapter/src/zope/component/contextdependent.py)

Copied: Zope3/branches/jim-adapter/src/zope/component/exceptions.py (from rev 66386, Zope3/branches/jim-adapter/src/zope/component/exceptions.py)

Modified: Zope3/branches/jim-adapter/src/zope/component/factory.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/component/factory.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/component/factory.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -101,7 +101,7 @@
   >>> gsm = zope.component.getGlobalSiteManager() 
 
   >>> from zope.component.interfaces import IFactory
-  >>> gsm.provideUtility(IFactory, factory, 'klass')
+  >>> gsm.registerUtility(factory, IFactory, 'klass')
 
 Creating an Object
 ++++++++++++++++++

Copied: Zope3/branches/jim-adapter/src/zope/component/globalregistry.py (from rev 66386, Zope3/branches/jim-adapter/src/zope/component/globalregistry.py)

Modified: Zope3/branches/jim-adapter/src/zope/component/interfaces.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/component/interfaces.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/component/interfaces.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,19 +15,14 @@
 
 $Id$
 """
-import zope.deprecation
 
-from zope.interface import Interface, Attribute
+import zope.deferredimport
+from zope import interface
 
-# BBB: Can be removed in 3.3
-zope.deprecation.__show__.off()
-from zope.exceptions import NotFoundError
-zope.deprecation.__show__.on()
-
 # BBB: Backward-compatibility; 12/05/2004
 from bbb.interfaces import *
 
-class ComponentLookupError(NotFoundError):
+class ComponentLookupError(LookupError):
     """A component could not be found."""
 
 class Invalid(Exception):
@@ -36,7 +31,27 @@
 class Misused(Exception):
     """A component is being used (registered) for the wrong interface."""
 
-class IComponentArchitecture(Interface, IBBBComponentArchitecture):
+
+class IObjectEvent(interface.Interface):
+    """An event related to an object.
+
+    The object that generated this event is not necessarily the object
+    refered to by location.
+    """
+
+    object = interface.Attribute("The subject of the event.")
+
+
+class ObjectEvent(object):
+    interface.implements(IObjectEvent)
+
+    def __init__(self, object):
+        self.object = object
+
+    def __repr__(self):
+        return "%s event:\n%r" % (self.__class__.__name__, self.object)
+
+class IComponentArchitecture(interface.Interface):
     """The Component Architecture is defined by two key components: Adapters
     and Utiltities. Both are managed by site managers. All other components
     build on top of them.
@@ -55,9 +70,10 @@
 
         If `context` is `None`, return the global site manager.
 
-        If the `context` is not `None`, it is expected that an adapter from
-        the `context` to `ISiteManager` can be found. If no adapter is found,
-        a `ComponentLookupError` is raised.
+        If the `context` is not `None`, it is expected that an adapter
+        from the `context` to `IComponentLookup` can be found. If no
+        adapter is found, a `ComponentLookupError` is raised.
+        
         """
 
     # Utility API
@@ -94,7 +110,9 @@
 
     # Adapter API
 
-    def getAdapter(object, interface=Interface, name=u'', context=None):
+    def getAdapter(object,
+                   interface=interface.Interface, name=u'',
+                   context=None):
         """Get a named adapter to an interface for an object
 
         Returns an adapter that can adapt object to interface.  If a matching
@@ -129,7 +147,9 @@
         returned.
         """
 
-    def getMultiAdapter(objects, interface=Interface, name='', context=None):
+    def getMultiAdapter(objects,
+                        interface=interface.Interface, name='',
+                        context=None):
         """Look for a multi-adapter to an interface for an objects
 
         Returns a multi-adapter that can adapt objects to interface.  If a
@@ -146,7 +166,7 @@
         named adapter methods with an empty string for a name.
         """
 
-    def queryAdapter(object, interface=Interface, name=u'', default=None,
+    def queryAdapter(object, interface=interface.Interface, name=u'', default=None,
                      context=None):
         """Look for a named adapter to an interface for an object
 
@@ -182,7 +202,9 @@
         returned.
         """
 
-    def queryMultiAdapter(objects, interface=Interface, name=u'', default=None,
+    def queryMultiAdapter(objects,
+                          interface=interface.Interface, name=u'',
+                          default=None,
                           context=None):
         """Look for a multi-adapter to an interface for objects
 
@@ -275,48 +297,53 @@
         create objects which implement the given interface.
         """
 
-
-class ISiteManager(Interface):
+class IComponentLookup(interface.Interface):
     """Component Manager for a Site
 
     This object manages the components registered at a particular site. The
     definition of a site is intentionally vague.
     """
 
-    adapters = Attribute("Adapter Registry to manage all registered "
-                         "adapters.")
+    adapters = interface.Attribute(
+        "Adapter Registry to manage all registered adapters.")
 
-    utilities = Attribute("Adapter Registry to manage all registered "
-                          "utilities.")
+    utilities = interface.Attribute(
+        "Adapter Registry to manage all registered utilities.")
 
-    def queryAdapter(object, interface, name, default=None):
+    def queryAdapter(object, interface, name=u'', default=None):
         """Look for a named adapter to an interface for an object
 
         If a matching adapter cannot be found, returns the default.
+        """
 
-        The name consisting of an empty string is reserved for unnamed
-        adapters. The unnamed adapter methods will often call the
-        named adapter methods with an empty string for a name.
+    def getAdapter(object, interface, name=u''):
+        """Look for a named adapter to an interface for an object
+
+        If a matching adapter cannot be found, a ComponentLookupError
+        is raised.
         """
 
-    def queryMultiAdapter(objects, interface, name, default=None):
-        """Look for a multi-adapter to an interface for an object
+    def queryMultiAdapter(objects, interface, name=u'', default=None):
+        """Look for a multi-adapter to an interface for multiple objects
 
         If a matching adapter cannot be found, returns the default.
+        """
 
-        The name consisting of an empty string is reserved for unnamed
-        adapters. The unnamed adapter methods will often call the
-        named adapter methods with an empty string for a name.
+    def queryMultiAdapter(objects, interface, name=u''):
+        """Look for a multi-adapter to an interface for multiple objects
+
+        If a matching adapter cannot be found, a ComponentLookupError
+        is raised.
         """
 
     def getAdapters(objects, provided):
         """Look for all matching adapters to a provided interface for objects
 
-        Return a list of adapters that match. If an adapter is named, only the
-        most specific adapter of a given name is returned.
+        Return an iterable of name-adapter pairs for adapters that
+        provide the given interface.
         """
 
-    def subscribers(required, provided):
+    def subscribers(objects, provided):
         """Get subscribers
 
         Subscribers are returned that provide the provided interface
@@ -324,6 +351,12 @@
         required objects.
         """
 
+    def handle(*objects):
+        """Call handlers for the given objects
+
+        Handlers registered for the given objects are called.
+        """
+
     def queryUtility(interface, name='', default=None):
         """Look up a utility that provides an interface.
 
@@ -345,8 +378,12 @@
         returned.
         """
 
+zope.deferredimport.deprecated(
+    "Use IComponentLookup instead.  ISiteManager will be removed in 2007.",
+    ISiteManager = "zope.component.interfaces:IComponentLookup",
+    )
         
-class IComponentRegistrationConvenience(Interface):
+class IComponentRegistrationConvenience(interface.Interface):
     """API for registering components.
 
     CAUTION: This API should only be used from test or
@@ -428,7 +465,7 @@
         activity. 
         """
 
-class IRegistry(Interface):
+class IRegistry(interface.Interface):
     """Object that supports component registry
     """
 
@@ -436,12 +473,12 @@
         """Return an iterable of component registrations
         """
 
-class IFactory(Interface):
+class IFactory(interface.Interface):
     """A factory is responsible for creating other components."""
 
-    title = Attribute("The factory title.")
+    title = interface.Attribute("The factory title.")
 
-    description = Attribute("A brief description of the factory.")
+    description = interface.Attribute("A brief description of the factory.")
 
     def __call__(*args, **kw):
         """Return an instance of the objects we're a factory for."""
@@ -454,3 +491,408 @@
         created by this factory will implement. If the callable's Implements
         instance cannot be created, an empty Implements instance is returned.
         """
+
+class IRegistration(interface.Interface):
+    """A registration-information object 
+    """
+
+    registry = interface.Attribute("The registry having the registration")
+
+    name = interface.Attribute("The registration name")
+
+    info = interface.Attribute("""Information about the registration
+
+    This is information deemed useful to people browsing the
+    configuration of a system. It could, for example, include
+    commentary or information about the source of the configuration.
+    """)
+
+class IUtilityRegistration(IRegistration):
+    """Information about the registration of a utility
+    """
+
+    component = interface.Attribute("The object registered")
+    provided = interface.Attribute("The interface provided by the component")
+
+class IAdapterRegistration(IRegistration):
+    """Information about the registration of an adapter
+    """
+
+    factory = interface.Attribute("The factory used to create adapters")
+
+    required = interface.Attribute("""The adapted interfaces
+
+    This is a sequence of interfaces adapters by the registered
+    factory.  The factory will be caled with a sequence of objects, as
+    positional arguments, that provide these interfaces. 
+    """)
+
+    provided = interface.Attribute("""The interface provided by the adapters.
+
+    This interface is implemented by the factory
+    """)
+
+class ISubscriptionAdapterRegistration(IAdapterRegistration):
+    """Information about the registration of a subscription adapter
+    """
+
+class IHandlerRegistration(IRegistration):
+
+    handler = interface.Attribute("An object called used to handle an event")
+
+    required = interface.Attribute("""The handled interfaces
+
+    This is a sequence of interfaces handled by the registered
+    handler.  The handler will be caled with a sequence of objects, as
+    positional arguments, that provide these interfaces. 
+    """)
+
+class IRegistrationEvent(IObjectEvent):
+    """An event that involves a registration"""
+
+class RegistrationEvent(ObjectEvent):
+    """There has been a change in a registration
+    """
+    interface.implements(IRegistrationEvent)
+
+class IRegistered(IRegistrationEvent):
+    """A component or factory was registered 
+    """
+    
+class Registered(RegistrationEvent):
+    interface.implements(IRegistered)
+
+class IUnregistered(IRegistrationEvent):
+    """A component or factory was registered 
+    """
+
+class Unregistered(RegistrationEvent):
+    """A component or factory was registered 
+    """
+    interface.implements(IUnregistered)
+
+class IComponentRegistry(interface.Interface):
+    """Register components
+    """
+
+    def registerUtility(component, provided=None, name=u'', comment=u''):
+        """Register a utility
+
+        component
+           The registered component
+
+        provided
+           This is the interface provided by the utility.  If the
+           component provides a single interface, then this
+           argument is optional and the component-implemented
+           interface will be used.
+
+        name
+           The utility name.
+
+        info
+           An object that can be converted to a string to provide
+           information about the registration.
+
+        A Registered event is generated with an IUtilityRegistration.
+        """
+
+    def unregisterUtility(component=None, provided=None, name=u''):
+        """Unregister a utility
+
+        A boolean is returned indicating whether the registry was
+        changed.  If the given component is None and there is no
+        component registered, or if the given component is not
+        None and is not registered, then the function returns
+        False, otherwise it returns True.
+
+        component
+           The registered component The given component can be
+           None, in which case any component registered to provide
+           the given provided interface with the given name is
+           unregistered.
+
+        provided
+           This is the interface provided by the utility.  If the
+           component is not None and provides a single interface,
+           then this argument is optional and the
+           component-implemented interface will be used.
+
+        name
+           The utility name.
+
+        An UnRegistered event is generated with an IUtilityRegistration.
+        """
+
+    def registeredUtilities():
+        """Return an iterable of IUtilityRegistrations.
+
+        These registrations describe the current utility registrations
+        in the object.
+        """
+
+    def registerAdapter(factory, required=None, provided=None, name=u'',
+                       info=u''):
+        """Register an adapter factory
+
+        Parameters:
+
+        factory
+            The object used to compute the adapter
+
+        required
+            This is a sequence of specifications for objects to be
+            adapted.  If omitted, then the value of the factory's
+            __component_adapts__ attribute will be used.  The
+            __component_adapts__ attribute is usually attribute is
+            normally set in class definitions using adapts
+            function, or for callables using the adapter
+            decorator.  If the factory doesn't have a
+            __component_adapts__ adapts attribute, then this
+            argument is required. 
+
+        provided
+            This is the interface provided by the adapter and
+            implemented by the factory.  If the factory
+            implements a single interface, then this argument is
+            optional and the factory-implemented interface will be
+            used. 
+
+        name
+            The adapter name.
+
+        info
+           An object that can be converted to a string to provide
+           information about the registration.
+           
+        A Registered event is generated with an IAdapterRegistration.
+        """
+
+    def unregisterAdapter(factory=None, required=None,
+                          provided=None, name=u''):
+        """Register an adapter factory
+
+        A boolean is returned indicating whether the registry was
+        changed.  If the given component is None and there is no
+        component registered, or if the given component is not
+        None and is not registered, then the function returns
+        False, otherwise it returns True.
+
+        Parameters:
+
+        factory
+            This is the object used to compute the adapter. The
+            factory can be None, in which case any factory
+            registered to implement the given provided interface
+            for the given required specifications with the given
+            name is unregistered.
+
+        required
+            This is a sequence of specifications for objects to be
+            adapted.  If the factory is not None and the required
+            arguments is omitted, then the value of the factory's
+            __component_adapts__ attribute will be used.  The
+            __component_adapts__ attribute attribute is normally
+            set in class definitions using adapts function, or for
+            callables using the adapter decorator.  If the factory
+            is None or doesn't have a __component_adapts__ adapts
+            attribute, then this argument is required.
+
+        provided
+            This is the interface provided by the adapter and
+            implemented by the factory.  If the factory is not
+            None and implements a single interface, then this
+            argument is optional and the factory-implemented
+            interface will be used.
+
+        name
+            The adapter name.
+
+        An Unregistered event is generated with an IAdapterRegistration.
+        """
+
+    def registeredAdapters():
+        """Return an iterable of IAdapterRegistrations.
+
+        These registrations describe the current adapter registrations
+        in the object.
+        """
+
+    def registerSubscriptionAdapter(factory, required=None, provides=None,
+                                    name=u'', info=''):
+        """Register a subscriber factory
+
+        Parameters:
+
+        factory
+            The object used to compute the adapter
+
+        required
+            This is a sequence of specifications for objects to be
+            adapted.  If omitted, then the value of the factory's
+            __component_adapts__ attribute will be used.  The
+            __component_adapts__ attribute is usually attribute is
+            normally set in class definitions using adapts
+            function, or for callables using the adapter
+            decorator.  If the factory doesn't have a
+            __component_adapts__ adapts attribute, then this
+            argument is required. 
+
+        provided
+            This is the interface provided by the adapter and
+            implemented by the factory.  If the factory implements
+            a single interface, then this argument is optional and
+            the factory-implemented interface will be used.
+
+        name
+            The adapter name.
+
+            Currently, only the empty string is accepted.  Other
+            strings will be accepted in the future when support for
+            named subscribers is added.
+
+        info
+           An object that can be converted to a string to provide
+           information about the registration.
+
+        A Registered event is generated with an
+        ISubscriptionAdapterRegistration.
+        """
+
+    def unregisterSubscriptionAdapter(factory=None, required=None, 
+                                      provides=None, name=u''):
+        """Register a subscriber factory
+
+        A boolean is returned indicating whether the registry was
+        changed.  If the given component is None and there is no
+        component registered, or if the given component is not
+        None and is not registered, then the function returns
+        False, otherwise it returns True.
+
+        Parameters:
+
+        factory
+            This is the object used to compute the adapter. The
+            factory can be None, in which case any factories
+            registered to implement the given provided interface
+            for the given required specifications with the given
+            name are unregistered.
+
+        required
+            This is a sequence of specifications for objects to be
+            adapted.  If the factory is not None and the required
+            arguments is omitted, then the value of the factory's
+            __component_adapts__ attribute will be used.  The
+            __component_adapts__ attribute attribute is normally
+            set in class definitions using adapts function, or for
+            callables using the adapter decorator.  If the factory
+            is None or doesn't have a __component_adapts__ adapts
+            attribute, then this argument is required.
+
+        provided
+            This is the interface provided by the adapter and
+            implemented by the factory.  If the factory is not
+            None implements a single interface, then this argument
+            is optional and the factory-implemented interface will
+            be used.
+
+        name
+            The adapter name.
+
+            Note that this parameter is ignored and is reserved
+            for future use when named subscribers are implemented.
+
+        An Unregistered event is generated with an
+        ISubscriptionAdapterRegistration.
+        """
+
+    def registeredSubscriptionAdapters():
+        """Return an iterable of ISubscriptionAdapterRegistrations.
+
+        These registrations describe the current subscription adapter
+        registrations in the object.
+        """
+
+    def registerHandler(handler, adapts=None, name=u'', info=''):
+        """Register a handler.
+
+        A handler is a subscriber that doesn't compute an adapter
+        but performs some function when called.
+
+        Parameters:
+
+        handler
+            The object used to handle some event represented by
+            the objects passed to it.
+
+        required
+            This is a sequence of specifications for objects to be
+            adapted.  If omitted, then the value of the factory's
+            __component_adapts__ attribute will be used.  The
+            __component_adapts__ attribute is usually attribute is
+            normally set in class definitions using adapts
+            function, or for callables using the adapter
+            decorator.  If the factory doesn't have a
+            __component_adapts__ adapts attribute, then this
+            argument is required. 
+
+        name
+            The handler name.
+
+            Note that this parameter is ignored and is reserved
+            for future use when named handlers are implemented.
+
+        info
+           An object that can be converted to a string to provide
+           information about the registration.
+
+
+        A Registered event is generated with an IHandlerRegistration.
+        """
+
+    def unregisterHandler(handler=None, adapts=None, name=u''):
+        """Register a handler.
+
+        A handler is a subscriber that doesn't compute an adapter
+        but performs some function when called.
+
+        Parameters:
+
+        handler
+            This is the object used to handle some event
+            represented by the objects passed to it. The handler
+            can be None, in which case any handlers registered for
+            the given required specifications with the given are
+            unregistered.
+
+        required
+            This is a sequence of specifications for objects to be
+            adapted.  If omitted, then the value of the factory's
+            __component_adapts__ attribute will be used.  The
+            __component_adapts__ attribute is usually attribute is
+            normally set in class definitions using adapts
+            function, or for callables using the adapter
+            decorator.  If the factory doesn't have a
+            __component_adapts__ adapts attribute, then this
+            argument is required. 
+
+        name
+            The handler name.
+
+            Note that this parameter is ignored and is reserved
+            for future use when named handlers are implemented.
+
+        An Unregistered event is generated with an IHandlerRegistration.
+        """
+
+    def registeredHandlers():
+        """Return an iterable of IHandlerRegistrations.
+
+        These registrations describe the current handler registrations
+        in the object.
+        """
+
+
+class IComponents(IComponentLookup, IComponentRegistry):
+    """Component registration and access
+    """

Copied: Zope3/branches/jim-adapter/src/zope/component/persistentregistry.py (from rev 66386, Zope3/branches/jim-adapter/src/zope/component/persistentregistry.py)

Copied: Zope3/branches/jim-adapter/src/zope/component/persistentregistry.txt (from rev 66386, Zope3/branches/jim-adapter/src/zope/component/persistentregistry.txt)

Copied: Zope3/branches/jim-adapter/src/zope/component/registry.py (from rev 66386, Zope3/branches/jim-adapter/src/zope/component/registry.py)

Copied: Zope3/branches/jim-adapter/src/zope/component/registry.txt (from rev 66386, Zope3/branches/jim-adapter/src/zope/component/registry.txt)

Copied: Zope3/branches/jim-adapter/src/zope/component/service.py (from rev 66386, Zope3/branches/jim-adapter/src/zope/component/service.py)

Copied: Zope3/branches/jim-adapter/src/zope/component/servicenames.py (from rev 66386, Zope3/branches/jim-adapter/src/zope/component/servicenames.py)

Modified: Zope3/branches/jim-adapter/src/zope/component/site.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/component/site.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/component/site.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -13,334 +13,25 @@
 ##############################################################################
 """Global Site Manager
 
+This module has been deprecated and will be removed.  Most of the
+functionality now resides in the zope.component.globalregistry module.
+
 $Id$
 """
 __docformat__ = "reStructuredText"
-import types
 
-from zope.interface import implements, providedBy, implementedBy, declarations
-from zope.interface.adapter import AdapterRegistry
-from zope.interface.interfaces import IInterface
+import warnings
+warnings.warn("The zope.component.site module has been deprecated and "
+              "will be removed.  Most of the functionality now resides "
+              "in the zope.component.globalregistry module.",
+              DeprecationWarning, stacklevel=2)
 
-from zope.component.interfaces import ISiteManager, IRegistry
-from zope.component.interfaces import ComponentLookupError, Invalid
-
-
-class IGlobalSiteManager(ISiteManager, IRegistry):
-
-    def provideAdapter(required, provided, name, factory, info=''):
-        """Register an adapter factory
-
-        :Parameters:
-          - `required`: a sequence of specifications for objects to be
-             adapted.
-          - `provided`: The interface provided by the adapter
-          - `name`: The adapter name
-          - `factory`: The object used to compute the adapter
-          - `info`: Provide some info about this particular adapter.
-        """
-
-    def subscribe(required, provided, factory, info=''):
-        """Register a subscriber factory
-
-        :Parameters:
-          - `required`: a sequence of specifications for objects to be
-             adapted.
-          - `provided`: The interface provided by the adapter
-          - `name`: The adapter name
-          - `factory`: The object used to compute the subscriber
-          - `info`: Provide some info about this particular adapter.
-        """
-
-    def provideUtility(providedInterface, component, name='', info='',
-                       strict=True):
-        """Register a utility
-
-        If strict is true, then the specified component *must* implement the
-        `providedInterface`. Turning strict off is particularly useful for
-        tests.
-        """
-
-
-class SiteManager(object):
-    """Site Manager implementation"""
-
-    def queryAdapter(self, object, interface, name, default=None):
-        """See ISiteManager interface"""
-        return self.adapters.queryAdapter(object, interface, name, default)
-
-    def queryMultiAdapter(self, objects, interface, name='', default=None):
-        """See ISiteManager interface"""
-        return self.adapters.queryMultiAdapter(objects, interface, name,
-                                               default)
-
-    def getAdapters(self, objects, provided):
-        """See ISiteManager interface"""
-        result = []
-        for name, factory in self.adapters.lookupAll(map(providedBy, objects),
-                                                     provided):
-            adapter = factory(*objects)
-            if adapter is not None:
-                result.append((name, adapter))
-        return result
-
-    def subscribers(self, required, provided):
-        """See ISiteManager interface"""
-        return self.adapters.subscribers(required, provided)
-
-    def queryUtility(self, interface, name='', default=None):
-        """See ISiteManager interface"""
-
-        byname = self.utilities._null.get(interface)
-        if byname:
-            return byname.get(name, default)
-        else:
-            return default
-
-    def getUtilitiesFor(self, interface):
-        byname = self.utilities._null.get(interface)
-        if byname:
-            for item in byname.iteritems():
-                yield item
-
-    def getAllUtilitiesRegisteredFor(self, interface):
-        return iter(self.utilities._null.get(('s', interface)) or ())
-
-
-class GlobalSiteManager(SiteManager):
-    """Global Site Manager implementation."""
-
-    implements(IGlobalSiteManager)
-
-    def __init__(self, name=None):
-        self.__name__ = name
-        self._registrations = {}
-        self.adapters = GlobalAdapterRegistry(self, 'adapters')
-        self.utilities = GlobalAdapterRegistry(self, 'utilities')
-
-
-    def provideAdapter(self, required, provided, name, factory, info=''):
-        """Register an adapter
-
-        >>> from zope.interface import Interface
-        >>> registry = GlobalSiteManager()
-        >>> class R1(Interface):
-        ...     pass
-        >>> class R2(R1):
-        ...     pass
-        >>> class P1(Interface):
-        ...     pass
-        >>> class P2(P1):
-        ...     pass
-
-        >>> registry.provideAdapter((R1, ), P2, 'bob', 'c1', 'd1')
-        >>> registry.provideAdapter((R1, ), P2,    '', 'c2', 'd2')
-        >>> registry.adapters.lookup((R2, ), P1, '')
-        'c2'
-
-        >>> registrations = map(repr, registry.registrations())
-        >>> registrations.sort()
-        >>> for registration in registrations:
-        ...    print registration
-        AdapterRegistration(('R1',), 'P2', '', 'c2', 'd2')
-        AdapterRegistration(('R1',), 'P2', 'bob', 'c1', 'd1')
-
-        Let's make sure that we can also register regular classes for
-        adaptation.
-
-        >>> class O1(object):
-        ...     pass
-        >>> class O2(object):
-        ...     pass
-        >>> class O3(object):
-        ...     def __init__(self, obj1, obj2=None):
-        ...         pass
-
-        >>> registry.provideAdapter((O1, ), R1, '', O3)
-        >>> registry.queryAdapter(O1(), R1, '').__class__
-        <class 'zope.component.site.O3'>
-
-        >>> registry.provideAdapter((O1, O2), R1, '', O3)
-        >>> registry.queryMultiAdapter((O1(), O2()), R1, '').__class__
-        <class 'zope.component.site.O3'>
-        """
-        if IInterface.providedBy(required):
-            raise TypeError('the required argument should be a list of'
-                            ' interfaces, not a single interface')
-        ifaces = []
-        for iface in required:
-            if not IInterface.providedBy(iface) and iface is not None:
-                if not isinstance(iface, (type, types.ClassType)):
-                    raise TypeError(iface, IInterface)
-                iface = implementedBy(iface)
-
-            ifaces.append(iface)
-        required = tuple(ifaces)
-
-        self._registrations[(required, provided, name)] = AdapterRegistration(
-            required, provided, name, factory, info)
-
-        self.adapters.register(required, provided, name, factory)
-
-    def subscribe(self, required, provided, factory, info=''):
-        """Register an subscriptions adapter
-
-        >>> from zope.interface import Interface
-        >>> registry = GlobalSiteManager()
-        >>> class R1(Interface):
-        ...     pass
-        >>> class R2(R1):
-        ...     pass
-        >>> class P1(Interface):
-        ...     pass
-        >>> class P2(P1):
-        ...     pass
-
-        >>> registry.subscribe((R1, ), P2, 'c1', 'd1')
-        >>> registry.subscribe((R1, ), P2, 'c2', 'd2')
-        >>> subscriptions = map(str,
-        ...                     registry.adapters.subscriptions((R2, ), P1))
-        >>> subscriptions.sort()
-        >>> subscriptions
-        ['c1', 'c2']
-
-        >>> registrations = map(repr, registry.registrations())
-        >>> registrations.sort()
-        >>> for registration in registrations:
-        ...    print registration
-        SubscriptionRegistration(('R1',), 'P2', 'c1', 'd1')
-        SubscriptionRegistration(('R1',), 'P2', 'c2', 'd2')
-        """
-        ifaces = []
-        for iface in required:
-            if not IInterface.providedBy(iface) and \
-                   not isinstance(iface, declarations.Implements) and \
-                   iface is not None:
-                if not isinstance(iface, (type, types.ClassType)):
-                    raise TypeError(iface, IInterface)
-                iface = implementedBy(iface)
-
-            ifaces.append(iface)
-        required = tuple(ifaces)
-
-        registration = SubscriptionRegistration(
-            required, provided, factory, info)
-
-        self._registrations[(required, provided)] = (
-            self._registrations.get((required, provided), ())
-            +
-            (registration, )
-            )
-
-        self.adapters.subscribe(required, provided, factory)
-
-    def provideUtility(self, providedInterface, component, name='', info='',
-                        strict=True):
-
-        if strict and not providedInterface.providedBy(component):
-            raise Invalid("The registered component doesn't provide "
-                          "the promised interface.")
-
-        self.utilities.register((), providedInterface, name, component)
-
-        # Also subscribe to support getAllUtilitiesRegisteredFor:
-        self.utilities.subscribe((), providedInterface, component)
-
-        self._registrations[(providedInterface, name)] = UtilityRegistration(
-            providedInterface, name, component, info)
-
-    def registrations(self):
-        for registration in self._registrations.itervalues():
-            if isinstance(registration, tuple):
-                for r in registration:
-                    yield r
-            else:
-                yield registration
-
-    def __reduce__(self):
-        # Global site managers are pickled as global objects
-        return self.__name__
-
-
-def GAR(siteManager, registryName):
-    return getattr(siteManager, registryName)
-
-class GlobalAdapterRegistry(AdapterRegistry):
-    """A global adapter registry
-
-    This adapter registry's main purpose is to be picklable in combination
-    with a site manager.
-    """
-    def __init__(self, parent=None, name=None):
-       self.__parent__ = parent
-       self.__name__ = name
-       super(GlobalAdapterRegistry, self).__init__()
-
-    def __reduce__(self):
-        return GAR, (self.__parent__, self.__name__)
-
-
-# Global Site Manager Instance
-globalSiteManager = GlobalSiteManager('globalSiteManager')
-
-# Register our cleanup with zope.testing.cleanup to make writing unit tests
-# simpler.
-from zope.testing.cleanup import addCleanUp
-addCleanUp(lambda : globalSiteManager.__init__(globalSiteManager.__name__))
-del addCleanUp
-
-
-
-class AdapterRegistration(object):
-    """Registration for a simple adapter."""
-
-    def __init__(self, required, provided, name, value, doc=''):
-        (self.required, self.provided, self.name, self.value, self.doc
-         ) = required, provided, name, value, doc
-
-    def __repr__(self):
-        return '%s(%r, %r, %r, %r, %r)' % (
-            self.__class__.__name__,
-            tuple([getattr(r, '__name__', None) for r in self.required]),
-            getattr(self.provided, '__name__', None), self.name,
-            self.value, self.doc,
-            )
-
-    def __cmp__(self, other):
-        return cmp(self.__repr__(), other.__repr__())
-
-
-class SubscriptionRegistration(object):
-    """Registration for a subscription adapter."""
-
-    def __init__(self, required, provided, value, doc):
-        (self.required, self.provided, self.value, self.doc
-         ) = required, provided, value, doc
-
-    def __repr__(self):
-        return '%s(%r, %r, %r, %r)' % (
-            self.__class__.__name__,
-            tuple([getattr(r, '__name__', None) for r in self.required]),
-            getattr(self.provided, '__name__', None), self.value, self.doc,
-            )
-
-    def __cmp__(self, other):
-        return cmp(self.__repr__(), other.__repr__())
-
-
-class UtilityRegistration(object):
-
-    def __init__(self, provided, name, component, doc):
-        (self.provided, self.name, self.component, self.doc
-         ) = provided, name, component, doc
-
-    def __repr__(self):
-        return '%s(%r, %r, %r, %r)' % (
-            self.__class__.__name__,
-            getattr(self.provided, '__name__', None), self.name,
-            getattr(self.component, '__name__', self.component), self.doc,
-            )
-
-    def __cmp__(self, other):
-        return cmp(self.__repr__(), other.__repr__())
-
+from zope.component.registry import Components as SiteManager
+from zope.component.registry import AdapterRegistration
+from zope.component.registry import SubscriptionRegistration
+from zope.component.registry import UtilityRegistration
+from zope.component.globalregistry import BaseGlobalComponents \
+     as GlobalSiteManager
+from zope.component.globalregistry import base as globalSiteManager
+from zope.component.globalregistry \
+     import _IGlobalSiteManager as IGlobalSiteManager


Property changes on: Zope3/branches/jim-adapter/src/zope/component/site.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: Zope3/branches/jim-adapter/src/zope/component/socketexample.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/component/socketexample.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/component/socketexample.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -83,9 +83,7 @@
 
   >>> import zope.component
   >>> gsm = zope.component.getGlobalSiteManager()
-  
-  >>> gsm.provideAdapter((IGermanSocket,), IUSSocket, '',
-  ...                    GermanToUSSocketAdapter)
+  >>> gsm.registerAdapter(GermanToUSSocketAdapter, (IGermanSocket,), IUSSocket)
 
 `zope.component` is the component architecture API that is being
 presented by this file. You registered an adapter from `IGermanSocket`
@@ -162,10 +160,10 @@
 Now, we need a way to keep the two adapters apart. Thus we register them with
 a name:
 
-  >>> gsm.provideAdapter((IGermanSocket,), IUSSocket, 'shaver',
-  ...                    GermanToUSSocketAdapter)
-  >>> gsm.provideAdapter((IGermanSocket,), IUSSocket, 'dvd',
-  ...                    GermanToUSSocketAdapterAndTransformer)
+  >>> gsm.registerAdapter(GermanToUSSocketAdapter,
+  ...                     (IGermanSocket,), IUSSocket, 'shaver',)
+  >>> gsm.registerAdapter(GermanToUSSocketAdapterAndTransformer,
+  ...                     (IGermanSocket,), IUSSocket, 'dvd')
 
 Now we simply look up the adapters using their labels (called *name*):
 
@@ -192,7 +190,7 @@
 Sometimes you want to know all adapters that are available. Let's say you want
 to know about all the adapters that convert a German to a US socket type:
 
-  >>> sockets = zope.component.getAdapters((bathroomDE,), IUSSocket)
+  >>> sockets = list(zope.component.getAdapters((bathroomDE,), IUSSocket))
   >>> len(sockets)
   3
   >>> names = [name for name, socket in sockets]
@@ -239,8 +237,8 @@
 You now register the combination, so that you know you can create a
 `IUSGroundedSocket`:
 
-  >>> gsm.provideAdapter((IGermanSocket, IGrounder), IUSGroundedSocket, 'mp3',
-  ...                    GroundedGermanToUSSocketAdapter)
+  >>> gsm.registerAdapter(GroundedGermanToUSSocketAdapter,
+  ...                 (IGermanSocket, IGrounder), IUSGroundedSocket, 'mp3')
 
 Given the grounder
 
@@ -318,15 +316,17 @@
 
   >>> class PowderExtinguisher(FireExtinguisher):
   ...     pass
-  >>> gsm.subscribe((IFire,), IFireExtinguisher, PowderExtinguisher)
+  >>> gsm.registerSubscriptionAdapter(PowderExtinguisher, 
+  ...                                 (IFire,), IFireExtinguisher)
 
   >>> class Blanket(FireExtinguisher):
   ...     pass
-  >>> gsm.subscribe((IFire,), IFireExtinguisher, Blanket)
+  >>> gsm.registerSubscriptionAdapter(Blanket, (IFire,), IFireExtinguisher)
 
   >>> class SprinklerSystem(FireExtinguisher):
   ...     pass
-  >>> gsm.subscribe((IFire,), IFireExtinguisher, SprinklerSystem)
+  >>> gsm.registerSubscriptionAdapter(SprinklerSystem,
+  ...                                 (IFire,), IFireExtinguisher)
 
 Now let use all these things to put out the fire:
 
@@ -378,7 +378,7 @@
 Like for adapters, we now have to add the newly-acquired generator to our
 inventory by registering it as a utility:
 
-  >>> gsm.provideUtility(IUSSocket, generator)
+  >>> gsm.registerUtility(generator, IUSSocket)
 
 We can now get the utility using
 
@@ -430,7 +430,7 @@
 
 Once it arrives, we add it to our inventory:
 
-  >>> gsm.provideUtility(IUSSocket, panel, 'Solar Panel')
+  >>> gsm.registerUtility(panel, IUSSocket, 'Solar Panel')
 
 You can now access the solar panel using
 
@@ -501,7 +501,7 @@
 implemented interface from the class. We now register the factory:
 
   >>> from zope.component.interfaces import IFactory
-  >>> gsm.provideUtility(IFactory, factory, 'SolarPanel')
+  >>> gsm.registerUtility(factory, IFactory, 'SolarPanel')
 
 We can now get a list of interfaces the produced object will provide:
 
@@ -528,7 +528,7 @@
 
 Once you register several factories
 
-  >>> gsm.provideUtility(IFactory, Factory(Generator), 'Generator')
+  >>> gsm.registerUtility(Factory(Generator), IFactory, 'Generator')
 
 you can also determine, which available factories will create objects
 providing a certian interface:
@@ -555,22 +555,22 @@
 
   >>> gsm = zope.component.getGlobalSiteManager()
 
-  >>> from zope.component.site import globalSiteManager
+  >>> from zope.component import globalSiteManager
   >>> gsm is globalSiteManager
   True
-  >>> from zope.component.interfaces import ISiteManager
-  >>> ISiteManager.providedBy(gsm)
+  >>> from zope.component.interfaces import IComponentLookup
+  >>> IComponentLookup.providedBy(gsm)
   True
-  >>> from zope.component.site import IGlobalSiteManager
-  >>> IGlobalSiteManager.providedBy(gsm)
+  >>> from zope.component.interfaces import IComponents
+  >>> IComponents.providedBy(gsm)
   True
 
 You can also lookup at site manager in a given context. The only requirement
 is that the context can be adapted to a site manager. So let's create a
 special site manager:
 
-  >>> from zope.component.site import SiteManager
-  >>> sm = SiteManager()
+  >>> from zope.component.globalregistry import BaseGlobalComponents
+  >>> sm = BaseGlobalComponents()
 
 Now we create a context that adapts to the site manager via the `__conform__`
 method as specied in PEP 246.
@@ -579,7 +579,7 @@
   ...     def __init__(self, sm):
   ...         self.sm = sm
   ...     def __conform__(self, interface):
-  ...         if interface.isOrExtends(ISiteManager):
+  ...         if interface.isOrExtends(IComponentLookup):
   ...             return self.sm
 
 We now instantiate the `Context` with our special site manager:

Modified: Zope3/branches/jim-adapter/src/zope/component/tests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/component/tests.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/component/tests.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,27 +15,101 @@
 
 $Id: test_api.py 28632 2004-12-16 17:42:59Z srichter $
 """
+import re
 import unittest
-
-from zope.interface import Interface, implements
+from zope import interface, component
 from zope.interface.verify import verifyObject
-from zope.testing import doctest
+from zope.testing import doctest, renormalizing
 
-import zope.component
 from zope.component.interfaces import ComponentLookupError
 from zope.component.interfaces import IComponentArchitecture
-from zope.component.interfaces import ISiteManager
+from zope.component.interfaces import IComponentLookup
 from zope.component.testing import setUp, tearDown
 
-class I1(Interface):
+class I1(interface.Interface):
     pass
-class I2(Interface):
+class I2(interface.Interface):
     pass
-class I3(Interface):
+class I3(interface.Interface):
     pass
 
+
+class U:
+
+    def __init__(self, name):
+        self.__name__ = name
+
+    def __repr__(self):
+        return "%s(%s)" % (self.__class__.__name__, self.__name__)
+
+class U1(U):
+    interface.implements(I1)
+
+class U12(U):
+    interface.implements(I1, I2)
+
+class IA1(interface.Interface):
+    pass
+
+class IA2(interface.Interface):
+    pass
+
+class IA3(interface.Interface):
+    pass
+
+class A:
+
+    def __init__(self, *context):
+        self.context = context
+
+    def __repr__(self):
+        return "%s%r" % (self.__class__.__name__, self.context)
+    
+class A12_1(A):
+    component.adapts(I1, I2)
+    interface.implements(IA1)
+    
+class A12_(A):
+    component.adapts(I1, I2)
+
+class A_2(A):
+    interface.implements(IA2)
+
+class A_3(A):
+    interface.implements(IA3)
+
+class A1_12(U):
+    component.adapts(I1)
+    interface.implements(IA1, IA2)
+
+class A1_2(U):
+    component.adapts(I1)
+    interface.implements(IA2)
+
+class A1_23(U):
+    component.adapts(I1)
+    interface.implements(IA1, IA3)
+
+def noop(*args):
+    pass
+
+ at component.adapter(I1)
+def handle1(x):
+    print 'handle1', x
+
+def handle(*objects):
+    print 'handle', objects
+
+ at component.adapter(I1)
+def handle3(x):
+    print 'handle3', x
+
+ at component.adapter(I1)
+def handle4(x):
+    print 'handle4', x
+
 class Ob(object):
-    implements(I1)
+    interface.implements(I1)
     def __repr__(self):
         return '<instance Ob>'
 
@@ -43,33 +117,33 @@
 ob = Ob()
 
 class Ob2(object):
-    implements(I2)
+    interface.implements(I2)
     def __repr__(self):
         return '<instance Ob2>'
 
 class Comp(object):
-    implements(I2)
+    interface.implements(I2)
     def __init__(self, context):
         self.context = context
 
 comp = Comp(1)
 
 class Comp2(object):
-    implements(I3)
+    interface.implements(I3)
     def __init__(self, context):
         self.context = context
 
 
-class ConformsToISiteManager(object):
-    """This object allows the sitemanager to conform/adapt to `ISiteManager`
-    and thus to itself."""
+class ConformsToIComponentLookup(object):
+    """This object allows the sitemanager to conform/adapt to
+    `IComponentLookup` and thus to itself."""
 
     def __init__(self, sitemanager):
         self.sitemanager = sitemanager
 
     def __conform__(self, interface):
         """This method is specified by the adapter PEP to do the adaptation."""
-        if interface is ISiteManager:
+        if interface is IComponentLookup:
             return self.sitemanager
 
 
@@ -77,32 +151,32 @@
     """Ensure that the component architecture API is provided by
     `zope.component`.
 
-    >>> import zope.component
-    >>> verifyObject(IComponentArchitecture, zope.component)
+    >>> verifyObject(IComponentArchitecture, component)
     True
     """
 
 def test_getGlobalSiteManager():
     """One of the most important functions is to get the global site manager.
 
-      >>> from zope.component.site import IGlobalSiteManager, globalSiteManager
+      >>> from zope.component.interfaces import IComponentLookup
+      >>> from zope.component.globalregistry import base
 
     Get the global site manager via the CA API function:
 
-      >>> gsm = zope.component.getGlobalSiteManager()
+      >>> gsm = component.getGlobalSiteManager()
 
     Make sure that the global site manager implements the correct interface
     and is the global site manager instance we expect to get.
 
-      >>> IGlobalSiteManager.providedBy(gsm)
+      >>> IComponentLookup.providedBy(gsm)
       True
-      >>> globalSiteManager is gsm
+      >>> base is gsm
       True
 
     Finally, ensure that we always get the same global site manager, otherwise
     our component registry will always be reset.
 
-      >>> zope.component.getGlobalSiteManager() is gsm
+      >>> component.getGlobalSiteManager() is gsm
       True
     """
 
@@ -111,20 +185,21 @@
     manager instance.
 
     We don't know anything about the default service manager, except that it
-    is an `ISiteManager`.
+    is an `IComponentLookup`.
 
-      >>> ISiteManager.providedBy(zope.component.getSiteManager())
+      >>> IComponentLookup.providedBy(component.getSiteManager())
       True
 
     Calling `getSiteManager()` with no args is equivalent to calling it with a
     context of `None`.
 
-      >>> zope.component.getSiteManager() is zope.component.getSiteManager(None)
+      >>> component.getSiteManager() is component.getSiteManager(None)
       True
 
-    If the context passed to `getSiteManager()` is not `None`, it is adapted
-    to `ISiteManager` and this adapter returned.  So, we create a context that
-    can be adapted to `ISiteManager` using the `__conform__` API.
+    If the context passed to `getSiteManager()` is not `None`, it is
+    adapted to `IComponentLookup` and this adapter returned.  So, we
+    create a context that can be adapted to `IComponentLookup` using
+    the `__conform__` API.
 
     Let's create the simplest stub-implementation of a site manager possible:
 
@@ -133,21 +208,21 @@
     Now create a context that knows how to adapt to our newly created site
     manager.
 
-      >>> context = ConformsToISiteManager(sitemanager)
+      >>> context = ConformsToIComponentLookup(sitemanager)
 
     Now make sure that the `getSiteManager()` API call returns the correct
     site manager.
 
-      >>> zope.component.getSiteManager(context) is sitemanager
+      >>> component.getSiteManager(context) is sitemanager
       True
 
-    Using a context that is not adaptable to `ISiteManager` should fail.
+    Using a context that is not adaptable to `IComponentLookup` should fail.
 
-      >>> zope.component.getSiteManager(ob) #doctest: +NORMALIZE_WHITESPACE
+      >>> component.getSiteManager(ob) #doctest: +NORMALIZE_WHITESPACE
       Traceback (most recent call last):
       ...
       ComponentLookupError: ('Could not adapt', <instance Ob>,
-      <InterfaceClass zope.component.interfaces.ISiteManager>)
+      <InterfaceClass zope.component.interfaces.IComponentLookup>)
     """
 
 def testAdapterInContext(self):
@@ -160,7 +235,7 @@
     `__conform__()` method:
 
       >>> class Component(object):
-      ...     implements(I1)
+      ...     interface.implements(I1)
       ...     def __conform__(self, iface, default=None):
       ...         if iface == I2:
       ...             return 42
@@ -175,41 +250,41 @@
     We now have to create a site manager (other than the default global one)
     with which we can register adapters for `I1`.
 
-      >>> from zope.component.site import GlobalSiteManager
-      >>> sitemanager = GlobalSiteManager()
+      >>> from zope.component.globalregistry import BaseGlobalComponents
+      >>> sitemanager = BaseGlobalComponents()
 
     Now we create a new `context` that knows how to get to our custom site
     manager.
 
-      >>> context = ConformsToISiteManager(sitemanager)
+      >>> context = ConformsToIComponentLookup(sitemanager)
 
     We now register an adapter from `I1` to `I3`:
 
-      >>> sitemanager.provideAdapter((I1,), I3, '', lambda x: 43)
+      >>> sitemanager.registerAdapter(lambda x: 43, (I1,), I3, '')
 
     If an object implements the interface you want to adapt to,
     `getAdapterInContext()` should simply return the object.
 
-      >>> zope.component.getAdapterInContext(ob, I1, context)
+      >>> component.getAdapterInContext(ob, I1, context)
       <Component implementing 'I1'>
-      >>> zope.component.queryAdapterInContext(ob, I1, context)
+      >>> component.queryAdapterInContext(ob, I1, context)
       <Component implementing 'I1'>
 
     If an object conforms to the interface you want to adapt to,
     `getAdapterInContext()` should simply return the conformed object.
 
-      >>> zope.component.getAdapterInContext(ob, I2, context)
+      >>> component.getAdapterInContext(ob, I2, context)
       42
-      >>> zope.component.queryAdapterInContext(ob, I2, context)
+      >>> component.queryAdapterInContext(ob, I2, context)
       42
 
     If an adapter isn't registered for the given object and interface, and you
     provide no default, raise ComponentLookupError...
 
-      >>> class I4(Interface):
+      >>> class I4(interface.Interface):
       ...     pass
 
-      >>> zope.component.getAdapterInContext(ob, I4, context) \\
+      >>> component.getAdapterInContext(ob, I4, context) \\
       ... #doctest: +NORMALIZE_WHITESPACE
       Traceback (most recent call last):
       ...
@@ -218,15 +293,15 @@
 
     ...otherwise, you get the default:
 
-      >>> zope.component.queryAdapterInContext(ob, I4, context, 44)
+      >>> component.queryAdapterInContext(ob, I4, context, 44)
       44
 
     If you ask for an adapter for which something's registered you get the
     registered adapter
 
-      >>> zope.component.getAdapterInContext(ob, I3, context)
+      >>> component.getAdapterInContext(ob, I3, context)
       43
-      >>> zope.component.queryAdapterInContext(ob, I3, context)
+      >>> component.queryAdapterInContext(ob, I3, context)
       43
     """
 
@@ -239,7 +314,7 @@
     If an adapter isn't registered for the given object and interface, and you
     provide no default, raise `ComponentLookupError`...
 
-      >>> zope.component.getAdapter(ob, I2, '') #doctest: +NORMALIZE_WHITESPACE
+      >>> component.getAdapter(ob, I2, '') #doctest: +NORMALIZE_WHITESPACE
       Traceback (most recent call last):
       ...
       ComponentLookupError: (<instance Ob>,
@@ -248,20 +323,20 @@
 
     ...otherwise, you get the default
 
-      >>> zope.component.queryAdapter(ob, I2, '', '<default>')
+      >>> component.queryAdapter(ob, I2, '', '<default>')
       '<default>'
 
     Now get the global site manager and register an adapter from `I1` to `I2`
     without a name:
 
-      >>> zope.component.getGlobalSiteManager().provideAdapter(
-      ...     (I1,), I2, '', Comp)
+      >>> component.getGlobalSiteManager().registerAdapter(
+      ...     Comp, (I1,), I2, '')
 
     You should get a sensible error message if you forget that the 'requires'
     argument is supposed to be a sequence
 
-      >>> zope.component.getGlobalSiteManager().provideAdapter(
-      ...     I1, I2, '', Comp)
+      >>> component.getGlobalSiteManager().registerAdapter(
+      ...     Comp, I1, I2, '')
       Traceback (most recent call last):
         ...
       TypeError: the required argument should be a list of interfaces, not a single interface
@@ -269,7 +344,7 @@
     You can now simply access the adapter using the `getAdapter()` API
     function:
 
-      >>> adapter = zope.component.getAdapter(ob, I2, '')
+      >>> adapter = component.getAdapter(ob, I2, '')
       >>> adapter.__class__ is Comp
       True
       >>> adapter.context is ob
@@ -283,8 +358,8 @@
 
     First, we need to register an adapter:
 
-      >>> zope.component.getGlobalSiteManager().provideAdapter(
-      ...     [I1], I2, '', Comp)
+      >>> component.getGlobalSiteManager().registerAdapter(
+      ...     Comp, [I1], I2, '')
 
     Then we try to adapt `ob` to provide an `I2` interface by calling the `I2`
     interface with the obejct as first argument:
@@ -316,13 +391,13 @@
 
     First we register some named adapter:
 
-      >>> zope.component.getGlobalSiteManager().provideAdapter(
-      ...     [I1], I2, 'foo', lambda x: 0)
+      >>> component.getGlobalSiteManager().registerAdapter(
+      ...     lambda x: 0, [I1], I2, 'foo')
 
     If an adapter isn't registered for the given object and interface,
     and you provide no default, raise `ComponentLookupError`...
 
-      >>> zope.component.getAdapter(ob, I2, 'bar') \\
+      >>> component.getAdapter(ob, I2, 'bar') \\
       ... #doctest: +NORMALIZE_WHITESPACE
       Traceback (most recent call last):
       ...
@@ -331,17 +406,17 @@
 
     ...otherwise, you get the default
 
-      >>> zope.component.queryAdapter(ob, I2, 'bar', '<default>')
+      >>> component.queryAdapter(ob, I2, 'bar', '<default>')
       '<default>'
 
     But now we register an adapter for the object having the correct name
 
-      >>> zope.component.getGlobalSiteManager().provideAdapter(
-      ...     [I1], I2, 'bar', Comp)
+      >>> component.getGlobalSiteManager().registerAdapter(
+      ...     Comp, [I1], I2, 'bar')
 
     so that the lookup succeeds:
 
-      >>> adapter = zope.component.getAdapter(ob, I2, 'bar')
+      >>> adapter = component.getAdapter(ob, I2, 'bar')
       >>> adapter.__class__ is Comp
       True
       >>> adapter.context is ob
@@ -361,7 +436,7 @@
     objects and interface, and you provide no default, raise
     `ComponentLookupError`...
 
-      >>> zope.component.getMultiAdapter((ob, ob2), I3) \\
+      >>> component.getMultiAdapter((ob, ob2), I3) \\
       ... #doctest: +NORMALIZE_WHITESPACE
       Traceback (most recent call last):
       ...
@@ -372,7 +447,7 @@
 
     ...otherwise, you get the default
 
-      >>> zope.component.queryMultiAdapter((ob, ob2), I3, default='<default>')
+      >>> component.queryMultiAdapter((ob, ob2), I3, default='<default>')
       '<default>'
 
     Note that the name is not a required attribute here.
@@ -381,20 +456,20 @@
     handles to context objects:
 
       >>> class DoubleAdapter(object):
-      ...     implements(I3)
+      ...     interface.implements(I3)
       ...     def __init__(self, first, second):
       ...         self.first = first
       ...         self.second = second
 
     Now we can register the multi-adapter using
 
-      >>> zope.component.getGlobalSiteManager().provideAdapter(
-      ...     (I1, I2), I3, '', DoubleAdapter)
+      >>> component.getGlobalSiteManager().registerAdapter(
+      ...     DoubleAdapter, (I1, I2), I3, '')
 
     Notice how the required interfaces are simply provided by a tuple. Now we
     can get the adapter:
 
-      >>> adapter = zope.component.getMultiAdapter((ob, ob2), I3)
+      >>> adapter = component.getMultiAdapter((ob, ob2), I3)
       >>> adapter.__class__ is DoubleAdapter
       True
       >>> adapter.first is ob
@@ -407,8 +482,8 @@
     """Providing an adapter for None says that your adapter can adapt anything
     to `I2`.
 
-      >>> zope.component.getGlobalSiteManager().provideAdapter(
-      ...     (None,), I2, '', Comp)
+      >>> component.getGlobalSiteManager().registerAdapter(
+      ...     Comp, (None,), I2, '')
 
       >>> adapter = I2(ob)
       >>> adapter.__class__ is Comp
@@ -433,26 +508,24 @@
 
     Let's register some adapters first:
 
-      >>> zope.component.getGlobalSiteManager().provideAdapter(
-      ...     [I1], I2, '', Comp)
-      >>> zope.component.getGlobalSiteManager().provideAdapter(
-      ...     [None], I2, 'foo', Comp)
+      >>> component.getGlobalSiteManager().registerAdapter(
+      ...     Comp, [I1], I2, '')
+      >>> component.getGlobalSiteManager().registerAdapter(
+      ...     Comp, [None], I2, 'foo')
 
     Now we get all the adapters that are registered for `ob` that provide
     `I2`:
 
-      >>> adapters = zope.component.getAdapters((ob,), I2)
-      >>> adapters.sort()
+      >>> adapters = sorted(component.getAdapters((ob,), I2))
       >>> [(name, adapter.__class__.__name__) for name, adapter in adapters]
       [(u'', 'Comp'), (u'foo', 'Comp')]
 
     Note that the output doesn't include None values. If an adapter
     factory returns None, it is as if it wasn't present.
 
-      >>> zope.component.getGlobalSiteManager().provideAdapter(
-      ...     [I1], I2, 'nah', lambda context: None)
-      >>> adapters = zope.component.getAdapters((ob,), I2)
-      >>> adapters.sort()
+      >>> component.getGlobalSiteManager().registerAdapter(
+      ...     lambda context: None, [I1], I2, 'nah')
+      >>> adapters = sorted(component.getAdapters((ob,), I2))
       >>> [(name, adapter.__class__.__name__) for name, adapter in adapters]
       [(u'', 'Comp'), (u'foo', 'Comp')]
 
@@ -467,7 +540,7 @@
     course. The pure instatiation of an object does not make it a utility. If
     you do not specify a default, you get a `ComponentLookupError`...
 
-      >>> zope.component.getUtility(I1) #doctest: +NORMALIZE_WHITESPACE
+      >>> component.getUtility(I1) #doctest: +NORMALIZE_WHITESPACE
       Traceback (most recent call last):
       ...
       ComponentLookupError: \
@@ -475,18 +548,18 @@
 
     ...otherwise, you get the default
 
-      >>> zope.component.queryUtility(I1, default='<default>')
+      >>> component.queryUtility(I1, default='<default>')
       '<default>'
-      >>> zope.component.queryUtility(I2, default='<default>')
+      >>> component.queryUtility(I2, default='<default>')
       '<default>'
 
     Now we declare `ob` to be the utility providing `I1`
 
-      >>> zope.component.getGlobalSiteManager().provideUtility(I1, ob)
+      >>> component.getGlobalSiteManager().registerUtility(ob, I1)
 
     so that the component is now available:
 
-      >>> zope.component.getUtility(I1) is ob
+      >>> component.getUtility(I1) is ob
       True
     """
 
@@ -495,11 +568,11 @@
 
     Just because you register an utility having no name
 
-      >>> zope.component.getGlobalSiteManager().provideUtility(I1, ob)
+      >>> component.getGlobalSiteManager().registerUtility(ob, I1)
 
     does not mean that they are available when you specify a name:
 
-      >>> zope.component.getUtility(I1, name='foo') \\
+      >>> component.getUtility(I1, name='foo') \\
       ... #doctest: +NORMALIZE_WHITESPACE
       Traceback (most recent call last):
       ...
@@ -509,17 +582,17 @@
 
     ...otherwise, you get the default
 
-      >>> zope.component.queryUtility(I1, name='foo', default='<default>')
+      >>> component.queryUtility(I1, name='foo', default='<default>')
       '<default>'
 
     Registering the utility under the correct name
 
-      >>> zope.component.getGlobalSiteManager().provideUtility(
-      ...     I1, ob, name='foo')
+      >>> component.getGlobalSiteManager().registerUtility(
+      ...     ob, I1, name='foo')
 
     really helps:
 
-      >>> zope.component.getUtility(I1, 'foo') is ob
+      >>> component.getUtility(I1, 'foo') is ob
       True
     """
 
@@ -534,24 +607,23 @@
       ...     pass
 
       >>> class Ob11(Ob):
-      ...     implements(I11)
+      ...     interface.implements(I11)
 
       >>> ob11 = Ob11()
       >>> ob_bob = Ob()
 
     Now we register the new utilities:
 
-      >>> gsm = zope.component.getGlobalSiteManager()
-      >>> gsm.provideUtility(I1, ob)
-      >>> gsm.provideUtility(I11, ob11)
-      >>> gsm.provideUtility(I1, ob_bob, name='bob')
-      >>> gsm.provideUtility(I2, Comp(2))
+      >>> gsm = component.getGlobalSiteManager()
+      >>> gsm.registerUtility(ob, I1)
+      >>> gsm.registerUtility(ob11, I11)
+      >>> gsm.registerUtility(ob_bob, I1, name='bob')
+      >>> gsm.registerUtility(Comp(2), I2)
 
     We can now get all the utilities that provide interface `I1`:
 
-      >>> uts = list(zope.component.getAllUtilitiesRegisteredFor(I1))
-      >>> uts = [util.__class__.__name__ for util in uts]
-      >>> uts.sort()
+      >>> uts = list(component.getAllUtilitiesRegisteredFor(I1))
+      >>> uts = sorted([util.__class__.__name__ for util in uts])
       >>> uts
       ['Ob', 'Ob', 'Ob11']
 
@@ -583,9 +655,8 @@
     We want to make sure that an `adapts()` call in a class definition
     doesn't affect instances.
 
-      >>> import zope.component
       >>> class C:
-      ...     zope.component.adapts()
+      ...     component.adapts()
 
       >>> C.__component_adapts__
       ()
@@ -600,35 +671,145 @@
     We need to make sure that it is possible to pickle the global site manager
     and its two global adapter registries.
 
-      >>> from zope.component import site
+      >>> from zope.component import globalSiteManager
       >>> import cPickle
-      >>> pickle = cPickle.dumps(site.globalSiteManager)
+      >>> pickle = cPickle.dumps(globalSiteManager)
       >>> sm = cPickle.loads(pickle)
-      >>> sm is site.globalSiteManager
+      >>> sm is globalSiteManager
       True
 
     Now let's ensure that the registries themselves can be pickled as well:
 
-      >>> pickle = cPickle.dumps(site.globalSiteManager.adapters)
+      >>> pickle = cPickle.dumps(globalSiteManager.adapters)
       >>> adapters = cPickle.loads(pickle)
-      >>> adapters is site.globalSiteManager.adapters
+      >>> adapters is globalSiteManager.adapters
       True
     """
 
+def test_persistent_component_managers():
+    """
+Here, we'll demonstrate that changes work even when data are stored in 
+a database and when accessed from multiple connections.
+
+Start by setting up a database and creating two transaction
+managers and database connections to work with.
+
+    >>> import ZODB.tests.util
+    >>> db = ZODB.tests.util.DB()
+    >>> import transaction
+    >>> t1 = transaction.TransactionManager()
+    >>> c1 = db.open(transaction_manager=t1)
+    >>> r1 = c1.root()
+    >>> t2 = transaction.TransactionManager()
+    >>> c2 = db.open(transaction_manager=t2)
+    >>> r2 = c2.root()
+
+Create a set of components registries in the database, alternating
+connections. 
+
+    >>> from zope.component.persistentregistry import PersistentComponents
+
+    >>> _ = t1.begin()
+    >>> r1[1] = PersistentComponents('1')
+    >>> t1.commit()
+
+    >>> _ = t2.begin()
+    >>> r2[2] = PersistentComponents('2', (r2[1], ))
+    >>> t2.commit()
+
+    >>> _ = t1.begin()
+    >>> r1[3] = PersistentComponents('3', (r1[1], ))
+    >>> t1.commit()
+
+    >>> _ = t2.begin()
+    >>> r2[4] = PersistentComponents('4', (r2[2], r2[3]))
+    >>> t2.commit()
+
+    >>> _ = t1.begin()
+    >>> r1[1].__bases__
+    ()
+    >>> r1[2].__bases__ == (r1[1], )
+    True
+
+    >>> r1[1].registerUtility(U1(1))
+    >>> r1[1].queryUtility(I1)
+    U1(1)
+    >>> r1[2].queryUtility(I1)
+    U1(1)
+    >>> t1.commit()
+    
+    >>> _ = t2.begin()
+    >>> r2[1].registerUtility(U1(2))
+    >>> r2[2].queryUtility(I1)
+    U1(2)
+
+    >>> r2[4].queryUtility(I1)
+    U1(2)
+    >>> t2.commit()
+
+    
+    >>> _ = t1.begin()
+    >>> r1[1].registerUtility(U12(1), I2)
+    >>> r1[4].queryUtility(I2)
+    U12(1)
+    >>> t1.commit()
+
+
+    >>> _ = t2.begin()
+    >>> r2[3].registerUtility(U12(3), I2)
+    >>> r2[4].queryUtility(I2)
+    U12(3)
+    >>> t2.commit()
+
+    >>> _ = t1.begin()
+
+    >>> r1[1].registerHandler(handle1, info="First handler")
+    >>> r1[2].registerHandler(handle, required=[U])
+    
+    >>> r1[3].registerHandler(handle3)
+    
+    >>> r1[4].registerHandler(handle4)
+
+    >>> r1[4].handle(U1(1))
+    handle1 U1(1)
+    handle3 U1(1)
+    handle (U1(1),)
+    handle4 U1(1)
+
+    >>> t1.commit()
+
+    >>> _ = t2.begin()
+    >>> r2[4].handle(U1(1))
+    handle1 U1(1)
+    handle3 U1(1)
+    handle (U1(1),)
+    handle4 U1(1)
+    >>> t2.abort()
+
+    >>> db.close()
+    """
+
+def tearDownRegistryTests(tests):
+    import zope.event
+    zope.event.subscribers.pop()
+
 def test_suite():
+    checker = renormalizing.RENormalizing([
+        (re.compile('at 0x[0-9a-f]+'), 'at <SOME ADDRESS>'),
+        ])
+
+
     return unittest.TestSuite((
         doctest.DocTestSuite(setUp=setUp, tearDown=tearDown),
-        doctest.DocTestSuite('zope.component.site'),
         doctest.DocFileSuite('README.txt',
                              setUp=setUp, tearDown=tearDown),
         doctest.DocFileSuite('socketexample.txt',
                              setUp=setUp, tearDown=tearDown),
         doctest.DocFileSuite('factory.txt',
                              setUp=setUp, tearDown=tearDown),
+        doctest.DocFileSuite('registry.txt', checker=checker,
+                             tearDown=tearDownRegistryTests),
         ))
 
 if __name__ == "__main__":
     unittest.main(defaultTest='test_suite')
-
-# BBB: Import some backward-compatibility; 12/10/2004
-from zope.component.bbb.tests import placelesssetup

Copied: Zope3/branches/jim-adapter/src/zope/component/utility.py (from rev 66386, Zope3/branches/jim-adapter/src/zope/component/utility.py)

Modified: Zope3/branches/jim-adapter/src/zope/contentprovider/README.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/contentprovider/README.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/contentprovider/README.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -391,7 +391,7 @@
   >>> print errorview()
   Traceback (most recent call last):
   ...
-  ContentProviderLookupError: u'mypage.UnknownName'
+  ContentProviderLookupError: mypage.UnknownName
 
 
 Additional Data from TAL

Copied: Zope3/branches/jim-adapter/src/zope/datetime (from rev 66386, Zope3/branches/jim-adapter/src/zope/datetime)

Copied: Zope3/branches/jim-adapter/src/zope/decorator (from rev 66386, Zope3/branches/jim-adapter/src/zope/decorator)

Copied: Zope3/branches/jim-adapter/src/zope/deferredimport (from rev 66386, Zope3/branches/jim-adapter/src/zope/deferredimport)

Modified: Zope3/branches/jim-adapter/src/zope/deprecation/README.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/deprecation/README.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/deprecation/README.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -8,6 +8,9 @@
 provides a simple function called `deprecated(names, reason)` to deprecate the
 previously mentioned Python objects.
 
+Deprecating objects inside a module
+-----------------------------------
+
 Let's start with a demonstration of deprecating any name inside a module. To
 demonstrate the functionality, I have placed the following code inside the
 `tests.py` file of this package:
@@ -74,6 +77,9 @@
   ...
   4
 
+Deprecating methods and properties
+----------------------------------
+
 New let's see how properties and methods can be deprecated. We are going to
 use the same function as before, except that this time, we do not pass in names
 as first argument, but the method or attribute itself. The function then
@@ -93,6 +99,10 @@
   ...
   ...     def splat(self):
   ...         return 4
+  ...
+  ...     @deprecation.deprecate("clap() is no more.")
+  ...     def clap(self):
+  ...         return 5
 
 And here is the result:
 
@@ -111,9 +121,39 @@
   3
   >>> my.splat()
   4
+  >>> my.clap()
+  From tests.py's showwarning():
+  ...README.txt:1: DeprecationWarning: clap() is no more.
+  ...
+  5
 
+Deprecating modules
+-------------------
 
-Temporarily Turning Off Deprecation Warnings
+It is also possible to deprecate whole modules.  This is useful when
+creating module aliases for backward compatibility.  Let's imagine,
+the ``zope.deprecation`` module used to be called ``zope.wanda`` and
+we'd like to retain backward compatibility:
+
+  >>> import zope.deprecation
+  >>> import sys
+  >>> sys.modules['zope.wanda'] = deprecation.deprecated(
+  ...     zope.deprecation, 'A module called Wanda is now zope.deprecation.')
+
+Now we can import ``wanda``, but when accessing things from it, we get
+our deprecation message as expected:
+
+  >>> from zope.wanda import deprecated
+  From tests.py's showwarning():
+  ...README.txt:1: DeprecationWarning: A module called Wanda is now zope.deprecation.
+  ...
+
+Before we move on, we should clean up:
+
+  >>> del deprecated
+  >>> del sys.modules['zope.wanda']
+
+Temporarily turning off deprecation warnings
 --------------------------------------------
 
 In some cases it is desireable to turn off the deprecation warnings for a

Modified: Zope3/branches/jim-adapter/src/zope/deprecation/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/deprecation/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/deprecation/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,7 +17,7 @@
 """
 __docformat__ = "reStructuredText"
 
-from zope.deprecation.deprecation import deprecated, ShowSwitch
+from zope.deprecation.deprecation import deprecated, deprecate, ShowSwitch
 
 # This attribute can be used to temporarly deactivate deprecation
 # warnings, so that backward-compatibility code can import other

Modified: Zope3/branches/jim-adapter/src/zope/deprecation/deprecation.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/deprecation/deprecation.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/deprecation/deprecation.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -90,7 +90,35 @@
 
         delattr(self.__original_module, name)
         
+class DeprecatedModule(object):
 
+    def __init__(self, module, msg):
+        self.__original_module = module
+        self.__msg = msg
+
+    def __getattribute__(self, name):
+        if name.startswith('_DeprecatedModule__'):
+            return ogetattr(self, name)
+
+        if name == '__class__':
+            return types.ModuleType
+        
+        if zope.deprecation.__show__():
+            warnings.warn(self.__msg, DeprecationWarning, 2)
+
+        return getattr(ogetattr(self, '_DeprecatedModule__original_module'),
+                       name)
+
+    def __setattr__(self, name, value):
+        if name.startswith('_DeprecatedModule__'):
+            return object.__setattr__(self, name, value)
+        setattr(self.__original_module, name, value)
+
+    def __delattr__(self, name):
+        if name.startswith('_DeprecatedModule__'):
+            return object.__delattr__(self, name)
+        delattr(self.__original_module, name)
+
 class DeprecatedGetProperty(object):
 
     def __init__(self, prop, message):
@@ -129,7 +157,9 @@
 def deprecated(specifier, message):
     """Deprecate the given names."""
 
-    # We are inside a module
+    # A string specifier (or list of strings) means we're called
+    # top-level in a module and are to deprecate things inside this
+    # module
     if isinstance(specifier, (str, unicode, list, tuple)):
         globals = sys._getframe(1).f_globals
         modname = globals['__name__']
@@ -139,9 +169,12 @@
         sys.modules[modname].deprecate(specifier, message)
 
 
-    # ... that means the specifier is a method or attribute of the class
-    if isinstance(specifier, types.FunctionType):
+    # Anything else can mean the specifier is a function/method,
+    # module, or just an attribute of a class
+    elif isinstance(specifier, types.FunctionType):
         return DeprecatedMethod(specifier, message)
+    elif isinstance(specifier, types.ModuleType):
+        return DeprecatedModule(specifier, message)
     else:
         prop = specifier
         if hasattr(prop, '__get__') and hasattr(prop, '__set__') and \
@@ -151,3 +184,12 @@
             return DeprecatedGetSetProperty(prop, message)
         elif hasattr(prop, '__get__'):
             return DeprecatedGetProperty(prop, message)
+
+class deprecate(object):
+    """Deprecation decorator"""
+
+    def __init__(self, msg):
+        self.msg = msg
+
+    def __call__(self, func):
+        return DeprecatedMethod(func, self.msg)

Modified: Zope3/branches/jim-adapter/src/zope/exceptions/DEPENDENCIES.cfg
===================================================================
--- Zope3/branches/jim-adapter/src/zope/exceptions/DEPENDENCIES.cfg	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/exceptions/DEPENDENCIES.cfg	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,3 +1,2 @@
 zope.interface
 zope.testing
-zope.deprecation

Modified: Zope3/branches/jim-adapter/src/zope/exceptions/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/exceptions/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/exceptions/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -18,29 +18,9 @@
 
 $Id$
 """
+from zope.exceptions.interfaces import DuplicationError, IDuplicationError
+from zope.exceptions.interfaces import UserError, IUserError
 
-import zope.deprecation
-
-zope.deprecation.deprecated('INotFoundError',
-                            'This interface has been deprecated. '
-                            'Use standard interface instead '
-                            'The reference will be gone in 3.3')
-
-zope.deprecation.deprecated('NotFoundError',
-                            'This class has been deprecated. '
-                            'Use standard exceptions instead '
-                            'The reference will be gone in 3.3')
-
-# Turn of deprecation warning here for the above import that are here for BBB
-# The depreaction above and within the _notfounderror module will do the job.
-zope.deprecation.__show__.off()
-from zope.exceptions._notfounderror import NotFoundError, INotFoundError
-zope.deprecation.__show__.on()
-
-from zope.exceptions._duplicate import DuplicationError, IDuplicationError
-
-# Importing these interfaces from here is deprecated!
-
 # avoid depency on zope.security:
 try:
     import zope.security

Deleted: Zope3/branches/jim-adapter/src/zope/exceptions/_duplicate.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/exceptions/_duplicate.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/exceptions/_duplicate.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,25 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Duplication Error
-
-$Id$
-"""
-from zope.interface import implements, Interface
-
-class IDuplicationError(Interface):
-    pass
-
-class DuplicationError(Exception):
-    """A duplicate registration was attempted"""
-    implements(IDuplicationError)

Deleted: Zope3/branches/jim-adapter/src/zope/exceptions/_notfounderror.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/exceptions/_notfounderror.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/exceptions/_notfounderror.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,48 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Not Found Error
-
-$Id$
-"""
-
-from zope.deprecation import deprecated
-
-from zope.interface.common.interfaces import IKeyError
-from zope.interface import implements
-
-deprecated('INotFoundError',
-           'This interface has been deprecated. '
-           'Use standard interface instead '
-           'The reference will be gone in 3.3')
-
-deprecated('NotFoundError',
-           'This class has been deprecated. '
-           'Use standard exceptions instead '
-           'The reference will be gone in 3.3')
-
-class INotFoundError(IKeyError):
-    pass
-
-class NotFoundError(KeyError, LookupError):
-    """A resource could not be found.
-
-    This exception is deprecated.  It will, over time, be replaced
-    with more specific exception types.
-
-    Eventually, when this exception type is used as a base class, it
-    will become an alias for LookupError.  Client code should not depend
-    on it extnding KeyError.
-
-    """
-    implements(INotFoundError)

Modified: Zope3/branches/jim-adapter/src/zope/exceptions/interfaces.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/exceptions/interfaces.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/exceptions/interfaces.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -30,10 +30,27 @@
 effort to clearly present the information provided by the
 ITracebackSupplement.
 """
+from zope.interface import Interface, Attribute, implements
 
+class IDuplicationError(Interface):
+    pass
 
-from zope.interface import Interface, Attribute
+class DuplicationError(Exception):
+    """A duplicate registration was attempted"""
+    implements(IDuplicationError)
 
+class IUserError(Interface):
+    """User error exceptions
+    """
+
+class UserError(Exception):
+    """User errors
+
+    These exceptions should generally be displayed to users unless
+    they are handled.
+    """
+    implements(IUserError)
+
 class ITracebackSupplement(Interface):
     """Provides valuable information to supplement an exception traceback.
 

Modified: Zope3/branches/jim-adapter/src/zope/formlib/form.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/formlib/form.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/formlib/form.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -14,7 +14,6 @@
 
 $Id$
 """
-
 import datetime
 import re
 import sys
@@ -22,6 +21,7 @@
 
 import zope.event
 import zope.i18n
+import zope.i18nmessageid
 import zope.publisher.interfaces.browser
 
 from zope import component, interface, schema
@@ -590,7 +590,7 @@
     if not self.available():
         return ''
     label = self.label
-    if isinstance(label, (zope.i18n.Message, zope.i18n.MessageID)):
+    if isinstance(label, zope.i18nmessageid.Message):
         label = zope.i18n.translate(self.label, context=self.form.request)
     return ('<input type="submit" id="%s" name="%s" value="%s"'
             ' class="button" />' %

Modified: Zope3/branches/jim-adapter/src/zope/i18n/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/i18n/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/i18n/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -18,12 +18,6 @@
 import re
 import warnings
 
-# BBB 2005/10/10 -- MessageIDs are to be removed for Zope 3.3
-import zope.deprecation
-zope.deprecation.__show__.off()
-from zope.i18nmessageid import MessageIDFactory, MessageID
-zope.deprecation.__show__.on()
-
 from zope.i18nmessageid import MessageFactory, Message
 from zope.i18n.interfaces import ITranslationDomain
 from zope.i18n.interfaces import IFallbackTranslationDomainFactory
@@ -41,7 +35,7 @@
 def _translate(msgid, domain=None, mapping=None, context=None,
                target_language=None, default=None):
 
-    if isinstance(msgid, (MessageID, Message)):
+    if isinstance(msgid, Message):
         domain = msgid.domain
         default = msgid.default
         mapping = msgid.mapping

Deleted: Zope3/branches/jim-adapter/src/zope/i18n/messageid.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/i18n/messageid.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/i18n/messageid.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,36 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2004 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Provide a backwards compatible import location for i18n message
-ids.  This module will be removed from Zope 3.3.
-
-$Id$
-"""
-##############################################################################
-# BBB 2005/10/10 -- remove the whole module for Zope 3.3
-#
-import zope.deprecation
-zope.deprecation.__show__.off()
-from zope.i18nmessageid import MessageID, MessageIDFactory
-from zope.i18nmessageid import Message, MessageFactory
-zope.deprecation.__show__.on()
-
-zope.deprecation.deprecated(
-    ('MessageID', 'MessageIDFactory' 'Message', 'MessageFactory'),
-    "The zope.i18n.messageid module as a backwards-compatible import "
-    "location for i18n message ids has been deprecated and will be "
-    "removed from Zope 3.3.  Please use Message and MessageFactory "
-    "from the zope.i18nmessageid package instead."
-    )
-#
-##############################################################################

Modified: Zope3/branches/jim-adapter/src/zope/i18n/tests/test_itranslationdomain.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/i18n/tests/test_itranslationdomain.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/i18n/tests/test_itranslationdomain.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -20,7 +20,7 @@
 from zope.interface import implements
 
 import zope.component
-from zope.component.tests.placelesssetup import PlacelessSetup
+from zope.component.testing import PlacelessSetup
 
 from zope.i18n.negotiator import negotiator
 from zope.i18n.interfaces import INegotiator, IUserPreferredLanguages

Modified: Zope3/branches/jim-adapter/src/zope/i18n/tests/test_negotiator.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/i18n/tests/test_negotiator.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/i18n/tests/test_negotiator.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -19,7 +19,7 @@
 
 from zope.i18n.negotiator import Negotiator
 from zope.i18n.interfaces import IUserPreferredLanguages
-from zope.component.tests.placelesssetup import PlacelessSetup
+from zope.component.testing import PlacelessSetup
 from zope.interface import implements
 
 class Env(object):

Modified: Zope3/branches/jim-adapter/src/zope/i18n/tests/test_translationdomain.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/i18n/tests/test_translationdomain.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/i18n/tests/test_translationdomain.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -20,7 +20,7 @@
 from zope.i18n.gettextmessagecatalog import GettextMessageCatalog
 from zope.i18n.tests.test_itranslationdomain import \
      TestITranslationDomain, Environment
-from zope.i18n import MessageIDFactory
+from zope.i18nmessageid import MessageFactory
 from zope.i18n.interfaces import ITranslationDomain
 import zope.component
 
@@ -80,13 +80,13 @@
             u'Hello!')
 
     def testMessageIDTranslate(self):
-        factory = MessageIDFactory('default')
+        factory = MessageFactory('default')
         translate = self._domain.translate
         msgid = factory(u'short_greeting', 'default')
         self.assertEqual(translate(msgid, target_language='en'), u'Hello!')
         # MessageID attributes override arguments
-        msgid = factory('43-not-there', 'this ${that} the other')
-        msgid.mapping["that"] = "THAT"
+        msgid = factory('43-not-there', 'this ${that} the other',
+                        mapping={'that': 'THAT'})
         self.assertEqual(
             translate(msgid, target_language='en', default="default",
                          mapping={"that": "that"}), "this THAT the other")
@@ -100,7 +100,7 @@
 
         zope.component.provideUtility(domain, ITranslationDomain, 'other')
 
-        factory = MessageIDFactory('other')
+        factory = MessageFactory('other')
         msgid = factory(u'short_greeting', 'default')
         self.assertEqual(
             self._domain.translate(msgid, target_language='en'), u'Hello!')

Modified: Zope3/branches/jim-adapter/src/zope/i18n/translationdomain.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/i18n/translationdomain.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/i18n/translationdomain.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,17 +15,11 @@
 
 $Id$
 """
-# BBB 2005/10/10 -- MessageIDs are to be removed for Zope 3.3
-import zope.deprecation
-zope.deprecation.__show__.off()
-from zope.i18nmessageid import MessageID, Message
-zope.deprecation.__show__.on()
-
+from zope.component import getUtility
+from zope.i18nmessageid import Message
 from zope.i18n import interpolate
 from zope.i18n.simpletranslationdomain import SimpleTranslationDomain
-from zope.component import getUtility
-from zope.i18n.interfaces import ITranslationDomain
-from zope.i18n.interfaces import INegotiator
+from zope.i18n.interfaces import ITranslationDomain, INegotiator
 
 # The configuration should specify a list of fallback languages for the
 # site.  If a particular catalog for a negotiated language is not available,
@@ -84,7 +78,7 @@
             target_language = negotiator.getLanguage(langs, context)
 
         # MessageID attributes override arguments
-        if isinstance(msgid, (Message, MessageID)):
+        if isinstance(msgid, Message):
             if msgid.domain != self.domain:
                 util = getUtility(ITranslationDomain, msgid.domain)
             mapping = msgid.mapping

Modified: Zope3/branches/jim-adapter/src/zope/i18nmessageid/DEPENDENCIES.cfg
===================================================================
--- Zope3/branches/jim-adapter/src/zope/i18nmessageid/DEPENDENCIES.cfg	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/i18nmessageid/DEPENDENCIES.cfg	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,2 +1 @@
 zope.testing
-zope.deprecation

Modified: Zope3/branches/jim-adapter/src/zope/i18nmessageid/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/i18nmessageid/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/i18nmessageid/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,24 +15,4 @@
 
 $Id$
 """
-##############################################################################
-# BBB 2005/10/10 -- MessageIDs are to be removed for Zope 3.3
-#
-import zope.deprecation
-zope.deprecation.__show__.off()
-from zope.i18nmessageid.messageid import MessageID, MessageIDFactory
-zope.deprecation.__show__.on()
-zope.deprecation.deprecated('MessageID',
-                            'Mutable i18n messages ("message ids") have been '
-                            'deprecated in favour of immutable ones and will '
-                            'be removed in Zope 3.3.  Please use '
-                            'zope.i18nmessageid.Message instead.')
-zope.deprecation.deprecated('MessageIDFactory',
-                            'Mutable i18n messages ("message ids") have been '
-                            'deprecated in favour of immutable ones and will '
-                            'be removed in Zope 3.3.  Please use '
-                            'use zope.i18nmessageid.MessageFactory instead.')
-#
-##############################################################################
-
 from zope.i18nmessageid.message import Message, MessageFactory

Deleted: Zope3/branches/jim-adapter/src/zope/i18nmessageid/messageid.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/i18nmessageid/messageid.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/i18nmessageid/messageid.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,114 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2003 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Message IDs.
-
-$Id$
-"""
-import zope.deprecation
-zope.deprecation.deprecated('MessageID',
-                            'Mutable i18n messages ("message ids") have been '
-                            'deprecated in favour of immutable ones and will '
-                            'be removed in Zope 3.3.  Please use '
-                            'zope.i18nmessageid.Message instead.')
-zope.deprecation.deprecated('MessageIDFactory',
-                            'Mutable i18n messages ("message ids") have been '
-                            'deprecated in favour of immutable ones and will '
-                            'be removed in Zope 3.3.  Please use '
-                            'use zope.i18nmessageid.MessageFactory instead.')
-
-class MessageID(unicode):
-    """Message ID.
-
-    This is a string used as a message ID.  It has a domain attribute that is
-    its source domain, and a default attribute that is its default text to
-    display when there is no translation.  domain may be None meaning there is
-    no translation domain.  default may also be None, in which case the
-    message id itself implicitly serves as the default text.
-
-    MessageID objects also have a mapping attribute which must be set after
-    construction of the object.  This is used when translating and
-    substituting variables.
-
-    To instanciate MessageIDs, it is recommended to use MessageIDFactory:
-
-    >>> fact = MessageIDFactory('test')
-
-    Now we can use the factory to make MessageIDs. Note that MessageID
-    is a subclass of unicode:
-
-    >>> id = fact(u'this is a test')
-    >>> isinstance(id, MessageID)
-    True
-    >>> isinstance(id, unicode)
-    True
-
-    Additional parameters, such as the i18n domain and the default
-    text are available through attributes:
-
-    >>> id.domain
-    'test'
-    >>> id.default
-    u'this is a test'
-
-    You can also reset the default text:
-
-    >>> id.default = u'blah'
-    >>> id.default
-    u'blah'
-
-    It is quite common to pass an abstract identifier as message id
-    and then a default text:
-
-    >>> id = fact(u'test-id', 'default test')
-    >>> id
-    u'test-id'
-    >>> id.default
-    u'default test'
-    >>> id.domain
-    'test'
-    """
-
-    __slots__ = ('domain', 'default', 'mapping')
-
-    def __new__(cls, ustr, domain=None, default=None):
-        self = unicode.__new__(cls, ustr)
-        self.domain = domain
-        if default is None:
-            self.default = ustr
-        else:
-            self.default = unicode(default)
-        self.mapping = {}
-        return self
-
-    def __getstate__(self):
-        return unicode(self), self.domain, self.default, self.mapping
-
-    def __setstate__(self, (ustr, domain, default, mapping)):
-        super(MessageID, self).__init__(ustr)
-        self.domain = domain
-        if default is None:
-            self.default = ustr
-        else:
-            self.default = default
-        self.mapping = mapping
-
-
-class MessageIDFactory(object):
-    """Factory for creating MessageIDs."""
-
-    def __init__(self, domain):
-        self._domain = domain
-
-    def __call__(self, ustr, default=None):
-        return MessageID(ustr, self._domain, default)

Modified: Zope3/branches/jim-adapter/src/zope/i18nmessageid/tests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/i18nmessageid/tests.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/i18nmessageid/tests.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -20,7 +20,6 @@
 
 def test_suite():
     return unittest.TestSuite((
-	    DocTestSuite('zope.i18nmessageid.messageid'),
 	    DocTestSuite('zope.i18nmessageid.message'),
 	    DocFileSuite('messages.txt', package='zope.i18nmessageid'),
 	    ))

Modified: Zope3/branches/jim-adapter/src/zope/interface/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/interface/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/interface/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -66,7 +66,7 @@
 from zope.interface.declarations import alsoProvides, implementer
 from zope.interface.declarations import implements, implementsOnly
 from zope.interface.declarations import classProvides, moduleProvides
-from zope.interface.declarations import Declaration
+from zope.interface.declarations import noLongerProvides, Declaration
 from zope.interface.exceptions import Invalid
 
 # The following are to make spec pickles cleaner

Modified: Zope3/branches/jim-adapter/src/zope/interface/adapter.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/interface/adapter.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/interface/adapter.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -1,744 +1,503 @@
-############################################################################
+##############################################################################
 #
-# Copyright (c) 2002 Zope Corporation and Contributors.
+# Copyright (c) 2004 Zope Corporation and Contributors.
 # All Rights Reserved.
 #
 # This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
 #
-############################################################################
-"""Adapter-style interface registry
+##############################################################################
+"""Adapter management
 
-This implementation is based on a notion of "surrogate" interfaces.
-
 $Id$
 """
 
-# Implementation notes
-
-# We keep a collection of surrogates.
-
-# A surrogate is a surrogate for a specification (interface or
-# declaration).  We use weak references in order to remove surrogates
-# if the corresponding specification goes away.
-
-# Each surrogate keeps track of:
-
-# - The adapters registered directly for that surrogate, and
-
-# - The "implied" adapters, which is the adapters that can be computed
-#   from instances of that surrogate.
-
-# The later data structure takes into account adapters registered for
-# specifications that the registered surrogate extends.
-
-# The registrations are of the form:
-
-#   {(subscription, with, name, specification) -> factories}
-
-# where:
-
-#   'subscription' is a flag indicating if this registration is for
-#   subscription adapters.
-
-#   'with' is a tuple of specs that is non-empty only in the case
-#   of multi-adapters.
-
-#   'name' is a unicode adapter name.  Unnamed adapters have an empty
-#   name.
-
-#   'specification' is the interface being adapted to, the provided interface.
-
-#   'factories' is normally a tuple of factories, but can be anything.
-#   (See the "raw" option to the query-adapter calls.)  For subscription
-#   adapters, it is a tuple of tuples of factories.
-
-# The implied adapters are held in a single dictionary. The items in the
-# dictionary are of several forms:
-
-# For single adapters:
-#
-# {specification -> {name -> object}
-#
-# where object is usually a sequence of factories
-
-# For multiple adapters:
-#
-# {(specification, order) -> {name -> {with -> object}}}
-
-# For single subscription adapters:
-#
-# {('s', specification) -> tuple([object])}
-
-# For multiple-subscription adapters:
-#
-# {('s', specification, order) -> {with -> tuple([object])}}
-
-
-from __future__ import generators
-
 import weakref
-from zope.interface.ro import ro
-from zope.interface.declarations import providedBy
-from zope.interface.interface import InterfaceClass, Interface
+from zope.interface import providedBy, Interface, ro
 
-Default = InterfaceClass("Default", (), {})
-Null = InterfaceClass("Null", (), {})
+class readproperty(object):
 
-# 2.2 backwards compatability
-try:
-    enumerate
-except NameError:
-    def enumerate(l):
-        i = 0
-        for o in l:
-            yield i, o
-            i += 1
-try:
-    basestring
-except NameError:
-    basestring = (str, unicode)
-
-
-class ReadProperty(object):
-
     def __init__(self, func):
         self.func = func
 
     def __get__(self, inst, class_):
         if inst is None:
             return self
-        return self.func(inst)
 
-class Surrogate(object):
-    """Specification surrogate
+        func = self.func
+        return func(inst)
+    
 
-    A specification surrogate is used to hold adapter registrations on
-    behalf of a specification.
-    """
+_delegated = ('lookup', 'queryMultiAdapter', 'lookup1', 'queryAdapter',
+              'adapter_hook', 'lookupAll', 'names',
+              'subscriptions', 'subscribers')
 
-    def __init__(self, spec, registry):
-        self.spec = spec.weakref()
-        self.registry = registry
-        spec.subscribe(self)
-        self.adapters = {}
-        self.dependents = weakref.WeakKeyDictionary()
+_marker = object
+class AdapterRegistry(object):
 
-        self.registry = registry
-        self.__bases__ = [registry.get(base) for base in spec.__bases__]
-        for base in self.__bases__:
-            base.subscribe(self)
+    def __init__(self, bases=()):
+        self._adapters = []
+        self._subscribers = []
+        self._provided = {}
+        self._init_non_persistent()
+        self.__bases__ = bases
 
-    def dirty(self):
-        if 'get' in self.__dict__:
-            # Not already dirty
-            del self.selfImplied
-            del self.multImplied
-            del self.get
+    def _init_non_persistent(self):
+        self._v_subregistries = weakref.WeakKeyDictionary()
+        self._v_lookup = lookup = AdapterLookup(self)
+        for name in _delegated:
+            self.__dict__[name] = getattr(lookup, name)
 
-        bases = [self.registry.get(base) for base in self.spec().__bases__]
-        if bases != self.__bases__:
-            # Our bases changed. unsubscribe from the old ones
-            # and subscribe to the new ones
-            for base in self.__bases__:
-                base.unsubscribe(self)
+    def __getstate__(self):
+        state = super(AdapterRegistry, self).__getstate__().copy()
+        for name in _delegated:
+            state.pop(name, 0)
+        return state
 
-            self.__bases__ = bases
-            for base in bases:
-                base.subscribe(self)
+    def __setstate__(self, state):
+        super(AdapterRegistry, self).__setstate__(state)
+        self._init_non_persistent()
 
-        for dependent in self.dependents.keys():
-            dependent.dirty()
+    @apply
+    def __bases__():
+        
+        def get(self):
+            return self.__dict__['__bases__']
 
-    def clean(self):
-        for base in self.__bases__:
-            base.unsubscribe(self)
-        self.__bases__ = [self.registry.get(base)
-                          for base in self.spec().__bases__]
-        for base in self.__bases__:
-            base.subscribe(self)
+        def set(self, v):
+            old = self.__dict__.get('__bases__', ())
+            for r in old:
+                if r not in v:
+                    r._removeSubregistry(self)
+            for r in v:
+                if r not in old:
+                    r._addSubregistry(self)
+            
+            self.__dict__['__bases__'] = v
+            self.ro = ro.ro(self)
+            self.changed()
+            
+        return property(get, set)
 
-        self.selfImplied, self.multImplied = adapterImplied(self.adapters)
+    def _addSubregistry(self, r):
+        self._v_subregistries[r] = 1
 
-        implied = {}
+    def _removeSubregistry(self, r):
+        if r in self._v_subregistries:
+            del self._v_subregistries[r]
 
-        ancestors = ro(self)
+    def changed(self):
+        try:
+            lookup = self._v_lookup
+        except AttributeError:
+            pass
+        else:
+            lookup.changed()
 
-        # Collect implied data in reverse order to have more specific data
-        # override less-specific data.
-        ancestors.reverse()
-        for ancestor in ancestors:
-            ancestor_spec = ancestor.spec()
+        for sub in self._v_subregistries.keys():
+            sub.changed()
+       
+    @readproperty
+    def _v_extendors(self):
+        _v_extendors = {}
+        for provided in self._provided:
+            for i in provided.__iro__:
+                extendors = _v_extendors.get(i, ())
+                if provided not in extendors:
+                    _v_extendors[i] = (
+                        [e for e in extendors if provided.isOrExtends(e)]
+                        +
+                        [provided]
+                        + 
+                        [e for e in extendors if not provided.isOrExtends(e)]
+                        )
+        self._v_extendors = _v_extendors
+        return self._v_extendors
 
-            for key, v in ancestor.selfImplied.iteritems():
+    def register(self, required, provided, name, value):
+        if value is None:
+            self.unregister(required, provided, name, value)
+            return
 
-                # key is specification or ('s', specification)
-                subscription = isinstance(key, tuple) and key[0] == 's'
-                if subscription:
-                    # v is tuple of subs
-                    implied[key] = implied.get(key, ()) + v
-                else:
-                    oldbyname = implied.get(key)
-                    if not oldbyname:
-                        implied[key] = oldbyname = {}
+        required = tuple(map(_convert_None_to_Interface, required))
+        name = _normalize_name(name)
+        order = len(required)
+        byorder = self._adapters
+        while len(byorder) <= order:
+            byorder.append({})
+        components = byorder[order]
+        key = required + (provided,)
+        
+        for k in key:
+            d = components.get(k)
+            if d is None:
+                d = {}
+                components[k] = d
+            components = d
 
-                    # v is name -> object
-                    oldbyname.update(v)
+        if components.get(name) == value:
+            return
+        
+        components[name] = value
 
-            for key, v in ancestor.multImplied.iteritems():
-                # key is (specification, order)
-                #     or ('s', specification, order)
-                subscription = key[0] == 's'
-                if subscription:
-                    oldwithobs = implied.get(key)
-                    if not oldwithobs:
-                        oldwithobs = implied[key] = {}
+        n = self._provided.get(provided, 0) + 1
+        self._provided[provided] = n
+        if n == 1 and '_v_extendors' in self.__dict__:
+            del self.__dict__['_v_extendors']
 
-                    # v is {with -> tuple([object])}
-                    for with, objects in v.iteritems():
-                        oldwithobs[with] = oldwithobs.get(with, ()) + objects
+        self.changed()
+        
+    def unregister(self, required, provided, name, value=None):
+        required = tuple(map(_convert_None_to_Interface, required))
+        order = len(required)
+        byorder = self._adapters
+        if order >= len(byorder):
+            return False
+        components = byorder[order]
+        key = required + (provided,)
+        
+        for k in key:
+            d = components.get(k)
+            if d is None:
+                return
+            components = d
 
-                else:
-                    oldbyname = implied.get(key)
-                    if not oldbyname:
-                        implied[key] = oldbyname = {}
+        old = components.get(name)
+        if old is None:
+            return
+        if (value is not None) and (old != value):
+            return
 
+        del components[name]
+        n = self._provided[provided] - 1
+        if n == 0:
+            del self._provided[provided]
+            if '_v_extendors' in self.__dict__:
+                del self.__dict__['_v_extendors']
+        else:
+            self._provided[provided] = n
 
-                    # v is {name -> {with -> ?}}
-                    for name, withobs in v.iteritems():
+        self.changed()
 
-                        # withobs is {with -> value}
+        return
 
-                        # If ancestor is not the default,
-                        # add in ancestor so we can get ordering right
-                        if ancestor_spec is not Default:
-                            withobs = dict([
-                                (((ancestor_spec,) + with), value)
-                                for (with, value) in withobs.iteritems()
-                                ])
 
-                        oldwithobs = oldbyname.get(name)
-                        if not oldwithobs:
-                            oldwithobs = oldbyname[name] = {}
+    def subscribe(self, required, provided, value):
+        required = tuple(map(_convert_None_to_Interface, required))
+        name = u''
+        order = len(required)
+        byorder = self._subscribers
+        while len(byorder) <= order:
+            byorder.append({})
+        components = byorder[order]
+        key = required + (provided,)
+        
+        for k in key:
+            d = components.get(k)
+            if d is None:
+                d = {}
+                components[k] = d
+            components = d
 
-                        # withobs is {with -> object}
-                        oldwithobs.update(withobs)
+        components[name] = components.get(name, ()) + (value, )
 
-        # Now flatten with mappings to tuples
-        for key, v in implied.iteritems():
-            if isinstance(key, tuple):
-                if key[0] == 's':
-                    # subscriptions
-                    if isinstance(v, dict):
-                        implied[key] = v.items()
-                else:
-                    byname = v
-                    for name, value in byname.iteritems():
-                        if isinstance(value, dict):
-                            # We have {with -> value}
-                            # convert it to [(with, value]
-                            byname[name] = value.items()
+        if provided is not None:
+            n = self._provided.get(provided, 0) + 1
+            self._provided[provided] = n
+            if n == 1 and '_v_extendors' in self.__dict__:
+                del self.__dict__['_v_extendors']
 
-        self.get = implied.get
+        self.changed()
 
-    def get(self, key):
-        """Get an implied value
+    def unsubscribe(self, required, provided, value=None):
+        required = tuple(map(_convert_None_to_Interface, required))
+        order = len(required)
+        byorder = self._subscribers
+        if order >= len(byorder):
+            return False
+        components = byorder[order]
+        key = required + (provided,)
+        
+        for k in key:
+            d = components.get(k)
+            if d is None:
+                return
+            components = d
 
-        This is only called when the surrogate is dirty
-        """
-        self.clean()
-        return self.__dict__['get'](key)
+        components[u''] = tuple([
+            v for v in components.get(u'', ())
+            if (v != value) or (value is None)
+            ])
 
-    def selfImplied(self):
-        """Return selfImplied when dirty
-        """
-        self.clean()
-        return self.__dict__['selfImplied']
-    selfImplied = ReadProperty(selfImplied)
+        if provided is not None:
+            n = self._provided[provided] - 1
+            if n == 0:
+                del self._provided[provided]
+                if '_v_extendors' in self.__dict__:
+                    del self.__dict__['_v_extendors']
 
-    def multiImplied(self):
-        """Return _multiImplied when dirty
-        """
-        self.clean()
-        return self.__dict__['multiImplied']
-    multiImplied = ReadProperty(multiImplied)
+        self.changed()
 
-    def subscribe(self, dependent):
-        self.dependents[dependent] = self.dependents.get(dependent, 0) + 1
+        return
 
-    def unsubscribe(self, dependent):
-        n = self.dependents.get(dependent, 0) - 1
-        if not n:
-            del self.dependents[dependent]
-        elif n > 0:
-            self.dependents[dependent] = n
-        else:
-            raise KeyError(dependent)
+    # XXX hack to fake out twisted's use of a private api.  We'll need
+    # to add a public api to mean twisted's needs and get them to use
+    # it.
+    def get(self, _):
+        class XXXTwistedFakeOut:
+            selfImplied = {}
+        return XXXTwistedFakeOut
 
-    def _adaptTo(self, specification, object, name='', with=()):
-        if object is None:
-            try:
-                del self.adapters[False, tuple(with), name, specification]
-            except KeyError:
-                pass
-        else:
-            self.adapters[False, tuple(with), name, specification
-                          ] = object
 
-        self.dirty()
 
-    def _subscriptionAdaptTo(self, specification, object, with=()):
-        if object is None:
-            raise TypeError("Unregistering subscription adapters isn't "
-                            "implemented")
 
-        key = (True, tuple(with), '', specification)
-        self.adapters[key] = self.adapters.get(key, ()) + (object, )
-        self.dirty()
-
-    def changed(self, which=None):
-        self.dirty()
-
-    def __repr__(self):
-        return '<%s(%s)>' % (self.__class__.__name__, self.spec())
-
-
+_not_in_mapping = object()
 class AdapterLookup(object):
-    # Adapter lookup support
-    # We have a class here because we want to provide very
-    # fast lookup support in C and making this part of the adapter
-    # registry itself would provide problems if someone wanted
-    # persistent adapter registries, because we want C slots for fast
-    # lookup that would clash with persistence-supplied slots.
-    # so this class acts a little bit like a lookup adapter for the adapter
-    # registry.
 
-    def __init__(self, registry, surrogates, _remove):
+    def __init__(self, registry):
         self._registry = registry
-        self._surrogateClass = registry._surrogateClass
-        self._default = registry._default
-        self._null = registry._null
-        self._surrogates = surrogates
-        self._remove = _remove
+        self._cache = {}
+        self._mcache = {}
+        self._scache = {}
+        self._required = {}
 
-    def lookup(self, required, provided, name='', default=None):
-        order = len(required)
-        if order == 1:
-            # Simple adapter:
-            s = self.get(required[0])
-            byname = s.get(provided)
-            if byname:
-                value = byname.get(name)
-            else:
-                value = None
+    def changed(self):
+        self._cache.clear()
+        self._mcache.clear()
+        self._scache.clear()
+        for r in self._required.keys():
+            r = r()
+            if r is not None:
+                r.unsubscribe(self)
+        self._required.clear()
+        
+    def _getcache(self, provided, name):
+        cache = self._cache.get(provided)
+        if cache is None:
+            cache = {}
+            self._cache[provided] = cache
+        if name:
+            c = cache.get(name)
+            if c is None:
+                c = {}
+                cache[name] = c
+            cache = c
+        return cache
 
-            if value is None:
-                byname = self._default.get(provided)
-                if byname:
-                    value = byname.get(name, default)
-                else:
-                    return default
+    def _subscribe(self, *required):
+        _refs = self._required
+        for r in required:
+            ref = r.weakref()
+            if ref not in _refs:
+                r.subscribe(self)
+                _refs[ref] = 1
 
-            return value
+    def lookup(self, required, provided, name=u'', default=None):
+        cache = self._getcache(provided, name)
+        if len(required) == 1:
+            result = cache.get(required[0], _not_in_mapping)
+        else:
+            result = cache.get(tuple(required), _not_in_mapping)
 
-        elif order == 0:
-            # null adapter
-            byname = self._null.get(provided)
-            if byname:
-                return byname.get(name, default)
-            else:
-                return default
+        if result is _not_in_mapping:
+            result = None
+            order = len(required)
+            for registry in self._registry.ro:
+                byorder = registry._adapters
+                if order >= len(byorder):
+                    continue
 
-        # Multi adapter
+                extendors = registry._v_extendors.get(provided)
+                if not extendors:
+                    continue
 
-        with = required
-        key = provided, order
+                components = byorder[order]
+                result = _lookup(components, required, extendors, name, 0,
+                                 order)
+                if result is not None:
+                    break
 
-        for surrogate in self.get(required[0]), self._default:
-            byname = surrogate.get(key)
-            if byname:
-                bywith = byname.get(name)
-                if bywith:
-                    # Selecting multi-adapters is not just a matter of
-                    # matching the required interfaces of the adapter
-                    # to the ones passed. Several adapters might
-                    # match, but we only want the best one. We use a
-                    # ranking algorithm to determine the best match.
-                    # `best` carries the rank and value of the best
-                    # found adapter.
-                    best = None
-                    for rwith, value in bywith:
-                        # the `rank` describes how well the found
-                        # adapter matches.
-                        rank = []
-                        for rspec, spec in zip(rwith, with):
-                            if not spec.isOrExtends(rspec):
-                                break # This one is no good
-
-                            # Determine the rank of this particular
-                            # specification.
-                            rank.append(list(spec.__sro__).index(rspec))
-                        else:
-                            # If the new rank is better than the best
-                            # previously recorded one, make the new
-                            # adapter the best one found.
-                            rank = tuple(rank)
-                            if best is None or rank < best[0]:
-                                best = rank, value
-                    # If any match was found, return the best one.
-                    if best:
-                        return best[1]
-
-            with = with[1:] # on second pass through, don't use first spec
-
-        return default
-
-    def lookup1(self, required, provided, name='', default=None):
-        return self.lookup((required,), provided, name, default)
-
-    def adapter_hook(self, interface, object, name='', default=None):
-        """Hook function used when calling interfaces.
-
-        When called from Interface.__adapt__, only the interface and
-        object parameters will be passed.
-
-        If the factory produces `None`, then the default is returned. This
-        allows us to prevent adaptation (if desired) and make the factory
-        decide whether an adapter will be available.
-        """
-        factory = self.lookup1(providedBy(object), interface, name)
-        if factory is not None:
-            adapter = factory(object)
-            if adapter is not None:
-                return adapter
-        return default
-
-    def queryAdapter(self, object, interface, name='', default=None):
-        # Note that we rarely call queryAdapter directly
-        # We usually end up calling adapter_hook
-        return self.adapter_hook(interface, object, name, default)
-
-    def subscriptions(self, required, provided):
-        if provided is None:
-            provided = Null
-
-        order = len(required)
-        if order == 1:
-            # Simple subscriptions:
-            s = self.get(required[0])
-            result = s.get(('s', provided))
-            if result:
-                result = list(result)
+            self._subscribe(*required)
+            if len(required) == 1:
+                cache[required[0]] = result
             else:
-                result = []
+                cache[tuple(required)] = result
 
-            default = self._default.get(('s', provided))
-            if default:
-                result.extend(default)
+        if result is None:
+            return default
 
-            return result
+        return result
 
-        elif order == 0:
-            result = self._null.get(('s', provided))
-            if result:
-                return list(result)
-            else:
-                return []
+    def queryMultiAdapter(self, objects, provided, name=u'', default=None):
+        factory = self.lookup(map(providedBy, objects), provided, name)
+        if factory is None:
+            return default
 
-        # Multi
-        key = 's', provided, order
-        with = required[1:]
-        result = []
+        result = factory(*objects)
+        if result is None:
+            return default
 
-        for surrogate in self.get(required[0]), self._default:
-            bywith = surrogate.get(key)
-            if not bywith:
-                continue
+        return result        
+    
+    def lookup1(self, required, provided, name=u'', default=None):
+        cache = self._getcache(provided, name)
+        result = cache.get(required, _not_in_mapping)
+        if result is _not_in_mapping:
+            return self.lookup((required, ), provided, name, default)
 
-            for rwith, values in bywith:
-                for rspec, spec in zip(rwith, with):
-                    if not spec.isOrExtends(rspec):
-                        break # This one is no good
-                else:
-                    # we didn't break, so we have a match
-                    result.extend(values)
+        if result is None:
+            return default
 
         return result
 
-    def queryMultiAdapter(self, objects, interface, name='', default=None):
-        factory = self.lookup(map(providedBy, objects), interface, name)
+    
+    def queryAdapter(self, object, provided, name=u'', default=None):
+        return self.adapter_hook(provided, object, name, default)
+
+    def adapter_hook(self, provided, object, name=u'', default=None):
+        required = providedBy(object)
+        cache = self._getcache(provided, name)
+        factory = cache.get(required, _not_in_mapping)
+        if factory is _not_in_mapping:
+            factory = self.lookup((required, ), provided, name)
+
         if factory is not None:
-            return factory(*objects)
+            result = factory(object)
+            if result is not None:
+                return result
 
         return default
 
-    def subscribers(self, objects, interface):
-        subscriptions = self.subscriptions(map(providedBy, objects), interface)
-        subscribers = [subscription(*objects)
-                       for subscription in subscriptions]
-        # Filter None values
-        return [x for x in subscribers if x is not None]
-
-    def get(self, declaration):
-        if declaration is None:
-            return self._default
-
-        ref = declaration.weakref(self._remove)
-        surrogate = self._surrogates.get(ref)
-        if surrogate is None:
-            surrogate = self._surrogateClass(declaration, self._registry)
-            self._surrogates[ref] = surrogate
-
-        return surrogate
-
-
-class AdapterRegistry(object):
-    """Adapter registry
-    """
-
-    # Implementation note:
-    # We are like a weakref dict ourselves. We can't use a weakref
-    # dict because we have to use spec.weakref() rather than
-    # weakref.ref(spec) to get weak refs to specs.
-
-    _surrogateClass = Surrogate
-
-    def __init__(self):
-        default = self._surrogateClass(Default, self)
-        self._default = default
-        null = self._surrogateClass(Null, self)
-        self._null = null
-
-        # Create separate lookup object and copy it's methods
-        surrogates = {Default.weakref(): default, Null.weakref(): null}
-        def _remove(k):
-            try:
-                del surrogates[k]
-            except KeyError:
-                pass
-        lookup = AdapterLookup(self, surrogates, _remove)
-
-        for name in ('lookup', 'lookup1', 'queryAdapter', 'get',
-                     'adapter_hook', 'subscriptions',
-                     'queryMultiAdapter', 'subscribers',
-                     ):
-            setattr(self, name, getattr(lookup, name))
-
-    def register(self, required, provided, name, value):
-        if required:
-            with = []
-            for iface in required[1:]:
-                if iface is None:
-                    iface = Interface
-                with.append(iface)
-            with = tuple(with)
-            required = self.get(required[0])
-        else:
-            with = ()
-            required = self._null
-
-        if not isinstance(name, basestring):
-            raise TypeError("The name provided to provideAdapter "
-                            "must be a string or unicode")
-
-        required._adaptTo(provided, value, unicode(name), with)
-
     def lookupAll(self, required, provided):
-        order = len(required)
-        if order == 1:
-            # Simple adapter:
-            s = self.get(required[0])
-            byname = s.get(provided)
-            if byname:
-                for item in byname.iteritems():
-                    yield item
+        cache = self._mcache.get(provided)
+        if cache is None:
+            cache = {}
+            self._mcache[provided] = cache
 
-            defbyname = self._default.get(provided)
-            if defbyname:
-                for name, value in defbyname.iteritems():
-                    if name in byname:
-                        continue
-                    yield name, value
+        required = tuple(required)
+        result = cache.get(required, _not_in_mapping)
+        if result is _not_in_mapping:
+            order = len(required)
+            result = {}
+            for registry in reversed(self._registry.ro):
+                byorder = registry._adapters
+                if order >= len(byorder):
+                    continue
+                extendors = registry._v_extendors.get(provided)
+                if not extendors:
+                    continue
+                components = byorder[order]
+                _lookupAll(components, required, extendors, result, 0, order)
 
-            return
+            self._subscribe(*required)
+            cache[required] = result
 
-        elif order == 0:
-            # null adapter
-            byname = self._null.get(provided)
-            if byname:
-                for item in byname.iteritems():
-                    yield item
+        return result.iteritems()
 
-            return
+    def names(self, required, provided):
+        return [c[0] for c in self.lookupAll(required, provided)]
 
+    def subscriptions(self, required, provided):
+        cache = self._scache.get(provided)
+        if cache is None:
+            cache = {}
+            self._scache[provided] = cache
 
-        # Multi adapter
+        required = tuple(required)
+        result = cache.get(required, _not_in_mapping)
+        if result is _not_in_mapping:
+            order = len(required)
+            result = []
+            for registry in reversed(self._registry.ro):
+                byorder = registry._subscribers
+                if order >= len(byorder):
+                    continue
 
-        with = required
-        key = provided, order
-        first = ()
-
-        for surrogate in self.get(required[0]), self._default:
-            byname = surrogate.get(key)
-            if byname:
-                for name, bywith in byname.iteritems():
-                    if not bywith or name in first:
+                if provided is None:
+                    extendors = (provided, )
+                else:
+                    extendors = registry._v_extendors.get(provided)
+                    if extendors is None:
                         continue
 
-                    # See comments on lookup() above
-                    best  = None
-                    for rwith, value in bywith:
-                        # the `rank` describes how well the found
-                        # adapter matches.
-                        rank = []
-                        for rspec, spec in zip(rwith, with):
-                            if not spec.isOrExtends(rspec):
-                                break # This one is no good
+                _subscriptions(byorder[order], required, extendors, u'',
+                               result, 0, order)
 
-                            # Determine the rank of this particular
-                            # specification.
-                            rank.append(list(spec.__sro__).index(rspec))
-                        else:
-                            # If the new rank is better than the best
-                            # previously recorded one, make the new
-                            # adapter the best one found.
-                            rank = tuple(rank)
-                            if best is None or rank < best[0]:
-                                best = rank, value
+            self._subscribe(*required)
+            cache[required] = result
 
-                    # If any match was found, return the best one.
-                    if best:
-                        yield name, best[1]
+        return result
 
-                first = byname
-
-            with = with[1:] # on second pass through, don't use first spec
-
-    def subscribe(self, required, provided, value):
-        if required:
-            required, with = self.get(required[0]), tuple(required[1:])
-        else:
-            required = self._null
-            with = ()
-
+    def subscribers(self, objects, provided):
+        subscriptions = self.subscriptions(map(providedBy, objects), provided)
         if provided is None:
-            provided = Null
-
-        required._subscriptionAdaptTo(provided, value, with)
-
-def mextends(with, rwith):
-    if len(with) == len(rwith):
-        for w, r in zip(with, rwith):
-            if not w.isOrExtends(r):
-                break
+            result = ()
+            for subscription in subscriptions:
+                subscription(*objects)
         else:
-            return True
-    return False
+            result = []
+            for subscription in subscriptions:
+                subscriber = subscription(*objects)
+                if subscriber is not None:
+                    result.append(subscriber)
+        return result
+    
+def _convert_None_to_Interface(x):
+    if x is None:
+        return Interface
+    else:
+        return x
 
-def adapterImplied(adapters):
-    implied = {}
-    multi = {}
+def _normalize_name(name):
+    if isinstance(name, basestring):
+        return unicode(name)
 
-    # This dictionary is used to catch situations specific adapters
-    # override less specific adapters.
-    # Because subscriptions are cumulative, registered doesn't apply.
-    registered = {}
+    raise TypeError("name must be a regular or unicode string")
 
-    # Add adapters and interfaces directly implied by same:
+def _lookup(components, specs, provided, name, i, l):
+    if i < l:
+        for spec in specs[i].__sro__:
+            comps = components.get(spec)
+            if comps:
+                r = _lookup(comps, specs, provided, name, i+1, l)
+                if r is not None:
+                    return r
+    else:
+        for iface in provided:
+            comps = components.get(iface)
+            if comps:
+                r = comps.get(name)
+                if r is not None:
+                    return r
+                
+    return None
 
-    for key, value in adapters.iteritems():
+def _lookupAll(components, specs, provided, result, i, l):
+    if i < l:
+        for spec in reversed(specs[i].__sro__):
+            comps = components.get(spec)
+            if comps:
+                _lookupAll(comps, specs, provided, result, i+1, l)
+    else:
+        for iface in reversed(provided):
+            comps = components.get(iface)
+            if comps:
+                result.update(comps)
 
-        # TODO: Backward compatibility
-        # BBB ? Don't need to handle 3-tuples some day
-        try:
-            (subscription, with, name, target) = key
-        except ValueError:
-            (with, name, target) = key
-            subscription = False
-
-        if subscription:
-            if with:
-                _add_multi_sub_adapter(with, target, multi, value)
-            else:
-                _add_named_sub_adapter(target, implied, value)
-        else:
-            if with:
-                _add_multi_adapter(with, name, target, target, multi,
-                                   registered, value)
-            else:
-                _add_named_adapter(target, target, name, implied,
-                                   registered, value)
-
-    return implied, multi
-
-def _add_named_adapter(target, provided, name, implied,
-                       registered, value):
-
-    ikey = target
-    rkey = target, name
-
-    byname = implied.get(ikey)
-    if not byname:
-        byname = implied[ikey] = {}
-
-    if (name not in byname
-        or
-        (rkey in registered and registered[rkey].extends(provided))
-        ):
-
-        registered[rkey] = provided
-        byname[name] = value
-
-        for b in target.__bases__:
-            _add_named_adapter(b, provided, name, implied,
-                               registered, value)
-
-def _add_multi_adapter(with, name, target, provided, implied,
-                       registered, object):
-
-    ikey = target, (len(with) + 1)
-    byname = implied.get(ikey)
-    if not byname:
-        byname = implied[ikey] = {}
-
-    bywith = byname.get(name)
-    if not bywith:
-        bywith = byname[name] = {}
-
-
-    rkey = ikey, name, with # The full key has all 4
-    if (with not in bywith
-        or
-        (rkey not in registered or registered[rkey].extends(provided))
-        ):
-        # This is either a new entry or it is an entry for a more
-        # general interface that is closer provided than what we had
-        # before
-        registered[rkey] = provided
-        bywith[with] = object
-
-    for b in target.__bases__:
-        _add_multi_adapter(with, name, b, provided, implied,
-                           registered, object)
-
-def _add_named_sub_adapter(target, implied, objects):
-    key = ('s', target)
-    implied[key] = implied.get(key, ()) + objects
-
-    for b in target.__bases__:
-        _add_named_sub_adapter(b, implied, objects)
-
-def _add_multi_sub_adapter(with, target, implied, objects):
-    key = 's', target, (len(with) + 1)
-    bywith = implied.get(key)
-    if not bywith:
-        bywith = implied[key] = {}
-
-    bywith[with] = bywith.get(with, ()) + objects
-
-    for b in target.__bases__:
-        _add_multi_sub_adapter(with, b, implied, objects)
+def _subscriptions(components, specs, provided, name, result, i, l):
+    if i < l:
+        for spec in reversed(specs[i].__sro__):
+            comps = components.get(spec)
+            if comps:
+                _subscriptions(comps, specs, provided, name, result, i+1, l)
+    else:
+        for iface in reversed(provided):
+            comps = components.get(iface)
+            if comps:
+                comps = comps.get(name)
+                if comps:
+                    result.extend(comps)

Modified: Zope3/branches/jim-adapter/src/zope/interface/adapter.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/interface/adapter.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/interface/adapter.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -382,6 +382,11 @@
 Subscriptions
 =============
 
+XXX need tests that demonstrate that more general subscribers are
+    called before more specific subscribers
+
+XXX Need unscription tests
+
 Normally, we want to look up an object that most-closely matches a
 specification.  Sometimes, we want to get all of the objects that
 match some specification.  We use subscriptions for this.  We
@@ -452,7 +457,7 @@
 
 You can have subscriptions that are indepenent of any specifications::
   
-  >>> registry.subscriptions([], IP1)
+  >>> list(registry.subscriptions([], IP1))
   []
 
   >>> registry.subscribe([], IP2, 'sub2')

Modified: Zope3/branches/jim-adapter/src/zope/interface/declarations.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/interface/declarations.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/interface/declarations.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -236,22 +236,7 @@
 
     __radd__ = __add__
 
-    def __nonzero__(self):
-        """Test whether there are any interfaces in a specification.
 
-        >>> from zope.interface import Interface
-        >>> class I1(Interface): pass
-        ...
-        >>> spec = Declaration(I1)
-        >>> int(bool(spec))
-        1
-        >>> spec = Declaration()
-        >>> int(bool(spec))
-        0
-        """
-        return bool(self.__iro__)
-
-
 ##############################################################################
 #
 # Implementation specifications
@@ -271,6 +256,8 @@
     def __repr__(self):
         return '<implementedBy %s>' % (self.__name__)
 
+    def __reduce__(self):
+        return implementedBy, (self.inherit, )
 
 def implementedByFallback(cls):
     """Return the interfaces implemented for a class' instances
@@ -942,6 +929,45 @@
     """
     directlyProvides(object, directlyProvidedBy(object), *interfaces)
 
+def noLongerProvides(object, interface):
+    """
+    This removes a directly provided interface from an object.
+    Consider the following two interfaces:
+
+      >>> from zope.interface import Interface
+      >>> class I1(Interface): pass
+      ...
+      >>> class I2(Interface): pass
+      ...
+
+    ``I1`` is provided through the class, ``I2`` is directly provided
+    by the object:
+    
+      >>> class C(object):
+      ...    implements(I1)
+      >>> c = C()
+      >>> alsoProvides(c, I2)
+      >>> I2.providedBy(c)
+      True
+
+    Remove I2 from c again:
+      
+      >>> noLongerProvides(c, I2)
+      >>> I2.providedBy(c)
+      False
+
+    Removing an interface that is provided through the class is not possible:
+
+      >>> noLongerProvides(c, I1)
+      Traceback (most recent call last):
+      ...
+      ValueError: Can only remove directly provided interfaces.
+
+    """
+    directlyProvides(object, directlyProvidedBy(object)-interface)
+    if interface.providedBy(object):
+        raise ValueError("Can only remove directly provided interfaces.")
+
 class ClassProvidesBasePy(object):
 
     def __get__(self, inst, cls):
@@ -1209,30 +1235,6 @@
       1
       >>> int(providedBy(c).extends(I5))
       1
-
-      nonzero:
-
-      >>> from zope.interface import Interface
-      >>> class I1(Interface):
-      ...     pass
-      >>> class I2(Interface):
-      ...     pass
-      >>> class C(object):
-      ...     implements(I1)
-      >>> c = C()
-      >>> int(bool(providedBy(c)))
-      1
-      >>> directlyProvides(c, I2)
-      >>> int(bool(providedBy(c)))
-      1
-      >>> class C(object):
-      ...     pass
-      >>> c = C()
-      >>> int(bool(providedBy(c)))
-      0
-      >>> directlyProvides(c, I2)
-      >>> int(bool(providedBy(c)))
-      1
     """
 
     return Provides(cls, direct)

Modified: Zope3/branches/jim-adapter/src/zope/interface/interface.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/interface/interface.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/interface/interface.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -134,7 +134,7 @@
           ...
           >>> spec = Declaration()
           >>> int(spec.extends(Interface))
-          0
+          1
           >>> spec = Declaration(I2)
           >>> int(spec.extends(Interface))
           1
@@ -157,6 +157,8 @@
 except ImportError:
     pass
 
+
+
 class Specification(SpecificationBase):
     """Specifications
 
@@ -265,10 +267,17 @@
         implied.clear()
 
         ancestors = ro(self)
+
+        try:
+            if Interface not in ancestors:
+                ancestors.append(Interface)
+        except NameError:
+            pass # defining Interface itself
+
         self.__sro__ = tuple(ancestors)
         self.__iro__ = tuple([ancestor for ancestor in ancestors
                               if isinstance(ancestor, InterfaceClass)
-                             ])
+                              ])
 
         for ancestor in ancestors:
             # We directly imply our ancestors:
@@ -333,7 +342,7 @@
           ...
           >>> spec = Declaration()
           >>> int(spec.extends(Interface))
-          0
+          1
           >>> spec = Declaration(I2)
           >>> int(spec.extends(Interface))
           1
@@ -907,8 +916,9 @@
     from zope.interface.interfaces import IMethod
     classImplements(Method, IMethod)
 
-    from zope.interface.interfaces import IInterface
+    from zope.interface.interfaces import IInterface, ISpecification
     classImplements(InterfaceClass, IInterface)
+    classImplements(Specification, ISpecification)
 
 # We import this here to deal with module dependencies.
 from zope.interface.declarations import providedBy, implementedBy

Modified: Zope3/branches/jim-adapter/src/zope/interface/interfaces.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/interface/interfaces.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/interface/interfaces.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -483,6 +483,31 @@
         adds I2 to the interfaces directly provided by ob.
         """
 
+    def alsoProvides(object, *interfaces):
+        """Declare additional interfaces directly for an object::
+
+          alsoProvides(ob, I1)
+
+        is equivalent to::
+
+          directivelyProvides(ob, directlyProvidedBy(ob), I1)
+        """
+
+    def noLongerProvides(object, interface):
+        """Remove an interface from the list of an object's directly
+        provided interfaces::
+
+          noLongerProvides(ob, I1)
+
+        is equivalent to::
+
+          directlyProvides(ob, directlyProvidedBy(ob)-I1)
+
+        with the exception that if ``I1`` is an interface that is
+        provided by ``ob`` through the class's implementation,
+        ValueError is raised.
+        """
+
     def implements(*interfaces):
         """Declare interfaces implemented by instances of a class
 
@@ -635,13 +660,32 @@
         provided interface, and a name.
         """
 
-    def lookup(required, provided, name, default=None):
+    def lookup(required, provided, name='', default=None):
         """Lookup a value
 
         A value is looked up based on a *sequence* of required
         specifications, a provided interface, and a name.
         """
 
+    def queryMultiAdapter(objects, provided, name=u'', default=None):
+        """Adapt a sequence of objects to a named, provided, interface
+        """
+
+    def lookup1(required, provided, name=u'', default=None):
+        """Lookup a value using a single required interface
+
+        A value is looked up based on a single required
+        specifications, a provided interface, and a name.
+        """
+
+    def queryAdapter(object, provided, name=u'', default=None):
+        """Adapt an object using a registered adapter factory.
+        """
+
+    def adapter_hook(provided, object, name=u'', default=None):
+        """Adapt an object using a registered adapter factory.
+        """
+
     def lookupAll(required, provided):
         """Find all adapters from the required to the provided interfaces
 
@@ -652,7 +696,7 @@
         """Return the names for which there are registered objects
         """
 
-    def subscribe(required, provided, subscriber):
+    def subscribe(required, provided, subscriber, name=u''):
         """Register a subscriber
 
         A subscriber is registered for a *sequence* of required
@@ -662,9 +706,13 @@
         equivalent) interfaces.
         """
 
-    def subscriptions(required, provided):
+    def subscriptions(required, provided, name=u''):
         """Get a sequence of subscribers
 
         Subscribers for a *sequence* of required interfaces, and a provided
         interface are returned.
         """
+
+    def subscribers(objects, provided, name=u''):
+        """Get a sequence of subscription adapters
+        """

Modified: Zope3/branches/jim-adapter/src/zope/interface/tests/test_declarations.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/interface/tests/test_declarations.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/interface/tests/test_declarations.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -389,7 +389,20 @@
 
 """
 
+def test_picklability_of_implements_specifications():
+    """
 
+    Sometimes, we need to pickle implements specs.  We should be able
+    to do so as long as the class is picklable.
+
+    >>> import pickle
+    >>> pickle.loads(pickle.dumps(implementedBy(C))) is implementedBy(C)
+    True
+    
+    
+    """
+
+
 def test_suite():
     suite = unittest.TestSuite()
     suite.addTest(unittest.makeSuite(Test))

Modified: Zope3/branches/jim-adapter/src/zope/proxy/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/proxy/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/proxy/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -29,3 +29,6 @@
     while isProxy(p):
         p = getProxiedObject(p)
         yield p
+
+def non_overridable(func):
+    return property(lambda self: func.__get__(self))

Modified: Zope3/branches/jim-adapter/src/zope/proxy/_zope_proxy_proxy.c
===================================================================
--- Zope3/branches/jim-adapter/src/zope/proxy/_zope_proxy_proxy.c	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/proxy/_zope_proxy_proxy.c	2006-04-04 15:56:58 UTC (rev 66397)
@@ -234,6 +234,18 @@
         if (descriptor != NULL) {
             if (PyType_HasFeature(descriptor->ob_type, Py_TPFLAGS_HAVE_CLASS)
                 && descriptor->ob_type->tp_descr_get != NULL) {
+
+              if (descriptor->ob_type->tp_descr_set == NULL)
+                {
+                  res = PyObject_GetAttr(wrapped, name);
+                  if (res != NULL)
+                    goto finally;
+                  if (PyErr_ExceptionMatches(PyExc_AttributeError))
+                    PyErr_Clear();
+                  else
+                    goto finally;
+                }
+
                 res = descriptor->ob_type->tp_descr_get(
                         descriptor,
                         self,
@@ -278,17 +290,13 @@
         Py_INCREF(name);
 
     descriptor = WrapperType_Lookup(self->ob_type, name);
-    if (descriptor != NULL) {
-        if (PyType_HasFeature(descriptor->ob_type, Py_TPFLAGS_HAVE_CLASS) &&
-            descriptor->ob_type->tp_descr_set != NULL) {
-            res = descriptor->ob_type->tp_descr_set(descriptor, self, value);
-        } else {
-            PyErr_Format(PyExc_TypeError,
-                "Tried to set attribute '%s' on wrapper, but it is not"
-                " a data descriptor", PyString_AS_STRING(name));
-        }
+    if (descriptor != NULL
+        && PyType_HasFeature(descriptor->ob_type, Py_TPFLAGS_HAVE_CLASS) 
+        && descriptor->ob_type->tp_descr_set != NULL) 
+      {
+        res = descriptor->ob_type->tp_descr_set(descriptor, self, value);
         goto finally;
-    }
+      }
 
     wrapped = Proxy_GET_OBJECT(self);
     if (wrapped == NULL) {

Modified: Zope3/branches/jim-adapter/src/zope/proxy/tests/test_proxy.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/proxy/tests/test_proxy.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/proxy/tests/test_proxy.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -21,6 +21,7 @@
 
 from zope.testing.doctestunit import DocTestSuite
 from zope.proxy import ProxyBase
+import zope.proxy
 
 class Thing:
     """This class is expected to be a classic class."""
@@ -552,7 +553,67 @@
     
     """
 
+def test_get_descriptors_in_proxy_class():
+    """
+    A non-data descriptor in a proxy class doesn't hide an attribute on
+    a proxied object or prevent writing the attribute.
 
+    >>> class ReadDescr(object):
+    ...     def __get__(self, i, c):
+    ...         return 'read'
+
+    >>> class MyProxy(ProxyBase):
+    ...    __slots__ = ()
+    ...
+    ...    z = ReadDescr()
+    ...    q = ReadDescr()
+
+    >>> class MyOb:
+    ...    q = 1
+
+    >>> o = MyOb()
+    >>> p = MyProxy(o)
+    >>> p.q
+    1
+
+    >>> p.z
+    'read'
+
+    >>> p.z = 1
+    >>> o.z, p.z
+    (1, 1)
+    
+    """
+
+def test_non_overridable():
+    """
+    Normally, methods defined in proxies are overridden by
+    methods of proxied objects.  This applies to all non-data
+    descriptors.  The non_overridable function can be used to
+    convert a non-data descriptor to a data descriptor that disallows
+    writes.  This function can be used as a decorator to make functions
+    defined in proxy classes take precedence over functions defined
+    in proxied objects.
+
+    
+    >>> class MyProxy(ProxyBase):
+    ...    __slots__ = ()
+    ...
+    ...    @zope.proxy.non_overridable
+    ...    def foo(self):
+    ...        return 'MyProxy foo'
+
+    >>> class MyOb:
+    ...    def foo(self):
+    ...        return 'MyOb foo'
+
+    >>> o = MyOb()
+    >>> p = MyProxy(o)
+    >>> p.foo()
+    'MyProxy foo'
+    
+    """
+
 def test_suite():
     suite = unittest.makeSuite(ProxyTestCase)
     suite.addTest(DocTestSuite())

Modified: Zope3/branches/jim-adapter/src/zope/publisher/browser.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/publisher/browser.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/publisher/browser.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -24,11 +24,13 @@
 from types import ListType, TupleType, StringType
 from cgi import FieldStorage
 
-from zope.interface import implements, directlyProvides
+import zope.component
+from zope.interface import implements, directlyProvides, providedBy
 from zope.i18n.interfaces import IUserPreferredLanguages
 from zope.i18n.interfaces import IUserPreferredCharsets
 from zope.publisher.interfaces.browser import IBrowserRequest
 from zope.publisher.interfaces.browser import IDefaultBrowserLayer
+from zope.publisher.interfaces.browser import IDefaultSkin
 from zope.publisher.interfaces.browser import IBrowserApplicationRequest
 
 from zope.publisher.http import HTTPRequest, HTTPResponse
@@ -821,3 +823,70 @@
         accepts.reverse()
 
         return [lang for quality, lang in accepts]
+
+def setDefaultSkin(request):
+    """Sets the default skin for the request.
+
+    The default skin is a marker interface that can be registered as an
+    adapter that provides IDefaultSkin for the request type.
+
+    If a default skin is not available, the default layer
+    (IDefaultBrowserLayer) is used.
+
+    To illustrate, we'll first use setDefaultSkin without a registered
+    IDefaultSkin adapter:
+
+      >>> class Request(object):
+      ...     implements(IBrowserRequest)
+
+      >>> request = Request()
+      >>> IDefaultBrowserLayer.providedBy(request)
+      False
+
+      >>> setDefaultSkin(request)
+      >>> IDefaultBrowserLayer.providedBy(request)
+      True
+
+    When we register a default layer, however:
+
+      >>> from zope.interface import Interface
+      >>> class IMySkin(Interface):
+      ...     pass
+      >>> zope.component.provideAdapter(IMySkin, (IBrowserRequest,),
+      ...                               IDefaultSkin)
+
+    setDefaultSkin uses the layer instead of IDefaultBrowserLayer.providedBy:
+
+      >>> request = Request()
+      >>> IMySkin.providedBy(request)
+      False
+      >>> IDefaultSkin.providedBy(request)
+      False
+
+      >>> setDefaultSkin(request)
+
+      >>> IMySkin.providedBy(request)
+      True
+      >>> IDefaultBrowserLayer.providedBy(request)
+      False
+
+    Any interfaces that are directly provided by the request coming into this
+    method are replaced by the applied layer/skin interface:
+
+      >>> request = Request()
+      >>> class IFoo(Interface):
+      ...     pass
+      >>> directlyProvides(request, IFoo)
+      >>> IFoo.providedBy(request)
+      True
+      >>> setDefaultSkin(request)
+      >>> IFoo.providedBy(request)
+      False
+
+    """
+    adapters = zope.component.getSiteManager().adapters
+    skin = adapters.lookup((providedBy(request),), IDefaultSkin, '')
+    if skin is not None:
+        directlyProvides(request, skin)
+    else:
+        directlyProvides(request, IDefaultBrowserLayer)

Modified: Zope3/branches/jim-adapter/src/zope/publisher/interfaces/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/publisher/interfaces/__init__.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/publisher/interfaces/__init__.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -15,27 +15,15 @@
 
 $Id$
 """
-
 __docformat__ = "reStructuredText"
 
-import zope.deprecation
-
-from zope.interface import Interface
-from zope.interface import Attribute
-from zope.security.interfaces import Unauthorized
 from zope.component.interfaces import IPresentationRequest
-from zope.interface import implements
+from zope.interface import Interface, Attribute, implements
 from zope.interface.interfaces import IInterface
 from zope.interface.common.mapping import IEnumerableMapping
-from zope.interface.common.interfaces import IException
-from zope.security.interfaces import IParticipation
+from zope.interface.common.interfaces import IException, ILookupError
+from zope.security.interfaces import Unauthorized, IParticipation
 
-# BBB : can be remove in 3.3
-zope.deprecation.__show__.off()
-from zope.exceptions import NotFoundError, INotFoundError
-zope.deprecation.__show__.on()
-
-
 class IPublishingException(IException):
     pass
 
@@ -48,14 +36,14 @@
 class TraversalException(PublishingException):
     implements(ITraversalException)
 
-class INotFound(INotFoundError, ITraversalException):
+class INotFound(ILookupError, ITraversalException):
     def getObject():
         'Returns the object that was being traversed.'
 
     def getName():
         'Returns the name that was being traversed.'
 
-class NotFound(NotFoundError, TraversalException):
+class NotFound(LookupError, TraversalException):
     implements(INotFound)
 
     def __init__(self, ob, name, request=None):

Copied: Zope3/branches/jim-adapter/src/zope/publisher/tests/test_browser.py (from rev 66386, Zope3/branches/jim-adapter/src/zope/publisher/tests/test_browser.py)

Modified: Zope3/branches/jim-adapter/src/zope/security/checker.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/security/checker.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/security/checker.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -645,7 +645,9 @@
 _Declaration_checker = InterfaceChecker(
     IDeclaration,
     _implied=CheckerPublic,
-    subscribe=CheckerPublic)
+    subscribe=CheckerPublic,
+    unsubscribe=CheckerPublic,
+    )
 
 def f():
     yield f

Copied: Zope3/branches/jim-adapter/src/zope/size (from rev 66386, Zope3/branches/jim-adapter/src/zope/size)

Modified: Zope3/branches/jim-adapter/src/zope/tal/dummyengine.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/tal/dummyengine.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/tal/dummyengine.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -20,14 +20,9 @@
 from zope.interface import implements
 from zope.tal.taldefs import NAME_RE, TALExpressionError, ErrorInfo
 from zope.tal.interfaces import ITALExpressionCompiler, ITALExpressionEngine
+from zope.i18nmessageid import Message
 from zope.i18n.interfaces import ITranslationDomain
 
-# BBB 2005/10/10 -- MessageIDs are to be removed for Zope 3.3
-import zope.deprecation
-zope.deprecation.__show__.off()
-from zope.i18nmessageid import MessageID, Message
-zope.deprecation.__show__.on()
-
 Default = object()
 
 name_match = re.compile(r"(?s)(%s):(.*)\Z" % NAME_RE).match
@@ -142,7 +137,7 @@
 
     def evaluateText(self, expr):
         text = self.evaluate(expr)
-        if isinstance(text, (str, unicode, MessageID, Message)):
+        if isinstance(text, (str, unicode, Message)):
             return text
         if text is not None and text is not Default:
             text = str(text)
@@ -298,7 +293,7 @@
         # by calling that method.
 
         # MessageID attributes override arguments
-        if isinstance(msgid, (MessageID, Message)):
+        if isinstance(msgid, Message):
             domain = msgid.domain
             mapping = msgid.mapping
             default = msgid.default
@@ -325,7 +320,7 @@
     
     def translate(self, msgid, domain=None, mapping=None, default=None):
         
-        if isinstance(msgid, (MessageID, Message)):
+        if isinstance(msgid, Message):
             domain = msgid.domain
         
         if domain == 'a_very_explicit_domain_setup_by_template_developer_that_wont_be_taken_into_account_by_the_ZPT_engine':

Modified: Zope3/branches/jim-adapter/src/zope/tal/talinterpreter.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/tal/talinterpreter.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/tal/talinterpreter.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -23,12 +23,7 @@
 # Do not use cStringIO here!  It's not unicode aware. :(
 from StringIO import StringIO
 
-# BBB 2005/10/10 -- MessageIDs are to be removed for Zope 3.3
-import zope.deprecation
-zope.deprecation.__show__.off()
-from zope.i18nmessageid import MessageID, Message
-zope.deprecation.__show__.on()
-
+from zope.i18nmessageid import Message
 from zope.tal.taldefs import quote, TAL_VERSION, METALError
 from zope.tal.taldefs import isCurrentVersion
 from zope.tal.taldefs import getProgramVersion, getProgramMode
@@ -37,7 +32,7 @@
 
 
 # Avoid constructing this tuple over and over
-I18nMessageTypes = (MessageID, Message)
+I18nMessageTypes = (Message,)
 
 TypesToTranslate = I18nMessageTypes + (str, unicode)
 

Modified: Zope3/branches/jim-adapter/src/zope/tal/tests/test_talinterpreter.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/tal/tests/test_talinterpreter.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/tal/tests/test_talinterpreter.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -30,13 +30,8 @@
 from zope.tal.dummyengine import MultipleDomainsDummyEngine
 from zope.tal.dummyengine import DummyTranslationDomain
 from zope.tal.tests import utils
+from zope.i18nmessageid import Message
 
-# BBB 2005/10/10 -- MessageIDs are to be removed for Zope 3.3
-import zope.deprecation
-zope.deprecation.__show__.off()
-from zope.i18nmessageid import MessageID, Message
-zope.deprecation.__show__.on()
-
 class TestCaseBase(unittest.TestCase):
 
     def _compile(self, source):
@@ -455,22 +450,13 @@
             "Foo <span tal:replace='bar' i18n:name='bar' /></div>")
         self._check(program, u"<div>FOO \u00C0</div>\n")
 
-    
-class I18NCornerTestCaseMessageID(I18NCornerTestCaseBase):
+class I18NCornerTestCaseMessage(I18NCornerTestCaseBase):
 
     def factory(self, msgid, default=None, mapping={}, domain=None):
-        m = MessageID(msgid, default=default)
-        m.mapping = mapping
-        return m
+        return Message(msgid, domain=domain, default=default, mapping=mapping)
 
-class UnusedExplicitDomainTestCase(I18NCornerTestCaseMessageID):
+class UnusedExplicitDomainTestCase(I18NCornerTestCaseMessage):
     
-    def factory(self, msgid, default=None, mapping={}, domain=None):
-        m = MessageID(msgid, default=default, domain=domain)
-        m.mapping = mapping
-        return m
-
-    
     def setUp(self):
         # MultipleDomainsDummyEngine is a Engine
         # where default domain transforms to uppercase
@@ -538,11 +524,6 @@
             '     tal:content="baz" />')
         self._check(program, '<div>BAZVALUE</div>\n')
 
-class I18NCornerTestCaseMessage(I18NCornerTestCaseBase):
-
-    def factory(self, msgid, default=None, mapping={}):
-        return Message(msgid, default=default, mapping=mapping)
-
 class ScriptTestCase(TestCaseBase):
 
     def setUp(self):
@@ -762,7 +743,6 @@
     suite.addTest(unittest.makeSuite(MacroExtendTestCase))
     suite.addTest(unittest.makeSuite(OutputPresentationTestCase))
     suite.addTest(unittest.makeSuite(ScriptTestCase))
-    suite.addTest(unittest.makeSuite(I18NCornerTestCaseMessageID))
     suite.addTest(unittest.makeSuite(I18NCornerTestCaseMessage))
     suite.addTest(unittest.makeSuite(UnusedExplicitDomainTestCase))
     suite.addTest(unittest.makeSuite(TestSourceAnnotations))

Modified: Zope3/branches/jim-adapter/src/zope/tales/expressions.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/tales/expressions.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/tales/expressions.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -21,7 +21,7 @@
 from zope.tales.tales import _valid_name, _parse_expr, NAME_RE, Undefined
 from zope.tales.interfaces import ITALESExpression, ITALESFunctionNamespace
 
-Undefs = (Undefined, AttributeError, KeyError, TypeError, IndexError)
+Undefs = (Undefined, AttributeError, LookupError, TypeError)
 
 _marker = object()
 namespace_re = re.compile(r'(\w+):(.+)')

Modified: Zope3/branches/jim-adapter/src/zope/tales/tests/test_expressions.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/tales/tests/test_expressions.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/tales/tests/test_expressions.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -19,6 +19,7 @@
 
 from zope.tales.engine import Engine
 from zope.tales.interfaces import ITALESFunctionNamespace
+from zope.tales.tales import Undefined
 from zope.interface import implements
 
 class Data(object):
@@ -30,11 +31,18 @@
 
     __str__ = __repr__
 
+class ErrorGenerator:
 
-def dict(**kw):
-    return kw
+    def __getitem__(self, name):
+        import __builtin__
+        if name == 'Undefined':
+            e = Undefined
+        else:
+            e = getattr(__builtin__, name, None)
+        if e is None:
+            e = SystemError
+        raise e('mess')
 
-
 class ExpressionTestBase(unittest.TestCase):
 
     def setUp(self):
@@ -58,6 +66,7 @@
               B = 2,
               adapterTest = at,
               dynamic = 'z',
+              ErrorGenerator = ErrorGenerator(),
               )
             )
 
@@ -86,6 +95,11 @@
         context=self.context
         self.assertEqual(expr(context), 'boot')
 
+        for e in 'Undefined', 'AttributeError', 'LookupError', 'TypeError':
+            expr = self.engine.compile('path:ErrorGenerator/%s|b|c/d/e' % e)
+            context=self.context
+            self.assertEqual(expr(context), 'boot')
+
     def testDynamic(self):
         expr = self.engine.compile('x/y/?dynamic')
         context=self.context

Modified: Zope3/branches/jim-adapter/src/zope/viewlet/README.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/viewlet/README.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/viewlet/README.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -170,7 +170,7 @@
   >>> leftColumn['stock']
   Traceback (most recent call last):
   ...
-  ComponentLookupError: 'No provider with name `stock` found.'
+  ComponentLookupError: No provider with name `stock` found.
 
   >>> leftColumn.get('stock') is None
   True
@@ -417,7 +417,7 @@
 Since we want to also provide the size of a file, here a simple implementation
 of the ``ISized`` interface:
 
-  >>> from zope.app import size
+  >>> from zope import size
   >>> class FileSized(object):
   ...     zope.interface.implements(size.interfaces.ISized)
   ...     zope.component.adapts(IFile)

Modified: Zope3/branches/jim-adapter/src/zope/wfmc/README.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/wfmc/README.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/wfmc/README.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -102,6 +102,11 @@
 
     >>> pd = process.ProcessDefinition('sample')
     >>> zope.component.provideUtility(pd, name=pd.id)
+    ... # doctest: +NORMALIZE_WHITESPACE
+    Registered event:
+    UtilityRegistration(<BaseGlobalComponents base>,
+               IProcessDefinition, 'sample', ProcessDefinition('sample'), u'')
+
     >>> pd.defineActivities(
     ...     author = process.ActivityDefinition(),
     ...     review = process.ActivityDefinition(),
@@ -336,6 +341,11 @@
 
     >>> pd = process.ProcessDefinition('sample', integration)
     >>> zope.component.provideUtility(pd, name=pd.id)
+    ... # doctest: +NORMALIZE_WHITESPACE
+    Registered event:
+    UtilityRegistration(<BaseGlobalComponents base>,
+               IProcessDefinition, 'sample', ProcessDefinition('sample'), u'')
+
     >>> pd.defineActivities(
     ...     author = process.ActivityDefinition(),
     ...     review = process.ActivityDefinition(),
@@ -408,6 +418,12 @@
 
     >>> pd = process.ProcessDefinition('sample', integration)
     >>> zope.component.provideUtility(pd, name=pd.id)
+    ... # doctest: +NORMALIZE_WHITESPACE
+    Registered event:
+    UtilityRegistration(<BaseGlobalComponents base>,
+             IProcessDefinition, 'sample', ProcessDefinition('sample'), u'')
+
+
     >>> pd.defineActivities(
     ...     author = process.ActivityDefinition(),
     ...     review = process.ActivityDefinition(),
@@ -566,6 +582,10 @@
     >>> Publication = process.ProcessDefinition('Publication')
     >>> Publication.integration = integration
     >>> zope.component.provideUtility(Publication, name=Publication.id)
+    ... # doctest: +NORMALIZE_WHITESPACE
+    Registered event:
+    UtilityRegistration(<BaseGlobalComponents base>,
+      IProcessDefinition, 'Publication', ProcessDefinition('Publication'), u'')
 
     >>> Publication.defineActivities(
     ...     start   = process.ActivityDefinition("Start"),

Modified: Zope3/branches/jim-adapter/src/zope/wfmc/xpdl.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/wfmc/xpdl.txt	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zope/wfmc/xpdl.txt	2006-04-04 15:56:58 UTC (rev 66397)
@@ -39,6 +39,10 @@
 
     >>> import zope.component
     >>> zope.component.provideUtility(pd, name=pd.id)
+    ... # doctest: +NORMALIZE_WHITESPACE
+    Registered event:
+    UtilityRegistration(<BaseGlobalComponents base>,
+                        IProcessDefinition, u'Publication', Publication, u'')
 
 and we'll define and register participant and application adapters:
 

Modified: Zope3/branches/jim-adapter/src/zwiki/tests/test_traverser.py
===================================================================
--- Zope3/branches/jim-adapter/src/zwiki/tests/test_traverser.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zwiki/tests/test_traverser.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -17,8 +17,7 @@
 """
 import unittest, sys
 
-from zope.component.tests.request import Request
-from zope.interface import Interface, classImplements
+from zope.interface import Interface, classImplements, directlyProvides
 from zope.publisher.interfaces import NotFound
 from zope.proxy import removeAllProxies
 
@@ -39,7 +38,11 @@
 class I(Interface):
     pass
 
-class Request(Request):
+class Request(object):
+
+    def __init__(self, type):
+        directlyProvides(self, type)
+
     def getEffectiveURL(self):
         return ''
 

Modified: Zope3/branches/jim-adapter/src/zwiki/wikipage.py
===================================================================
--- Zope3/branches/jim-adapter/src/zwiki/wikipage.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/src/zwiki/wikipage.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -34,7 +34,7 @@
 from zope.app.filerepresentation.interfaces import IReadDirectory
 from zope.app.filerepresentation.interfaces import IWriteDirectory
 from zope.app.annotation.interfaces import IAnnotations
-from zope.app.event.objectevent import ObjectEvent
+from zope.component.interfaces import ObjectEvent
 from zope.app.container.interfaces import \
      IObjectAddedEvent, IObjectRemovedEvent
 from zope.app.mail.interfaces import IMailDelivery

Copied: Zope3/branches/jim-adapter/to-do.txt (from rev 66386, Zope3/branches/jim-adapter/to-do.txt)

Modified: Zope3/branches/jim-adapter/utilities/runurl.py
===================================================================
--- Zope3/branches/jim-adapter/utilities/runurl.py	2006-04-04 15:55:00 UTC (rev 66396)
+++ Zope3/branches/jim-adapter/utilities/runurl.py	2006-04-04 15:56:58 UTC (rev 66397)
@@ -47,11 +47,6 @@
 
          Run the profiler saving the profile data to the given file name
 
-      --hotshot file
-
-         Run the hotshot profiler saving the profile data to the given
-         file name
-
       -w
       --warmup
 
@@ -62,9 +57,9 @@
 
          Output this usage information.
 
-      --build
+      --bias float
 
-        Run from a build directory
+        The profiler bias.  The default is 0.0.          
 
 $Id$
 """
@@ -86,15 +81,17 @@
             args,
             'b:r:p:d:c:hi:w',
             ['basic=', 'run=', 'profile=', 'database=', 'config=', 'help',
-             'input=', 'warmup', 'build', 'hotshot='])
+             'input=', 'warmup', 'bias='])
     except getopt.GetoptError:
         print __doc__ % {'script': script}
         raise
 
 
-    basic = run = warm = profilef = database = config = hotshotf = None
+    basic = run = warm = profilef = database = config = None
     stdin = ''
     src = 'src'
+    bias = 0.0
+    warm = 0
     for name, value in options:
         if name in ('-b', '--basic'):
             basic = value
@@ -102,13 +99,6 @@
             run = int(value)
         elif name in ('-p', '--profile'):
             profilef = value
-        elif name in ('--hotshot', ):
-            hotshotf = value
-        elif name in ('--build', ):
-            from distutils.util import get_platform
-            PLAT_SPEC = "%s-%s" % (get_platform(), sys.version[0:3])
-            src = os.path.join("build", "lib.%s" % PLAT_SPEC)
-
         elif name in ('-d', '--database'):
              database = value
         elif name in ('-c', '--config'):
@@ -116,7 +106,9 @@
         elif name in ('-i', '--input'):
              input = value
         elif name in ('-w', '--warmup'):
-             warm= True
+             warm += 1
+        elif name in ('--bias', ):
+            bias = float(value)
         elif name in ('-h', '--help'):
             print __doc__ % {'script': script}
             sys.exit(0)
@@ -139,27 +131,21 @@
     debugger = Debugger(database, config)
 
     if warm:
-        _mainrun(debugger, path, basic, 1, stdin, env)
+        _mainrun(debugger, path, basic, warm, stdin, env)
 
-    if profilef or hotshotf:
+    if profilef:
         cmd = "_mainrun(debugger, path, basic, run, stdin, env, True)"
-        if profilef:
-            import profile
-            profile.run(cmd, profilef)
-        if hotshotf:
-            import hotshot
-            p = hotshot.Profile(hotshotf)
-            p.runctx(cmd, globals(), locals())
-            p.close()
-            del p
-
-            print 'Writing', hotshotf
-            from hotshot.stats import StatsLoader
-            p = StatsLoader(hotshotf).load()
-            import marshal
-            marshal.dump(p.stats, open(hotshotf, 'w'))
-            print 'Wrote', hotshotf
-
+        import time
+        import profile
+        profiler = profile.Profile(time.time, bias)
+        try:
+            profiler.run(cmd)
+        except SystemExit:
+            pass
+        if profilef == '-':
+            profiler.print_stats()
+        else:
+            profiler.dump_stats(profilef)
     else:
         _mainrun(debugger, path, basic, run, stdin, env)
 



More information about the Checkins mailing list