Metadata-Version: 1.0
Name: zope.app.zapi
Version: 3.4.0
Summary: Zope application programming interface
Home-page: http://pypi.python.org/pypi/zope.app.zapi
Author: Zope Corporation and Contributors
Author-email: zope3-dev@zope.org
License: ZPL 2.1
Description: Zope application programming interface
        **************************************
        
        .. contents::
        
        Change History
        ==============
        
        
        3.4.0 (2007-10-03)
        ------------------
        
        Initial public release as an individual package.
        
        Zope Application Programming Interface
        ======================================
        
        This package provides a collection of commonly used APIs to make
        imports simpler.
        
        Mostly, the APIs provided here are imported from elsewhere. A few are
        provided here.
        
        principals()
        ------------
        
        The principals method returns the authentication service. If no
        service is defined, a ComponentLookupError is raised:
        
        >>> from zope.app import zapi
        >>> zapi.principals() #doctest: +NORMALIZE_WHITESPACE
        Traceback (most recent call last):
        ...
        ComponentLookupError:
        (<InterfaceClass zope.app.security.interfaces.IAuthentication>, '')
        
        
        But if we provide an authentication service:
        
        >>> import zope.interface
        >>> from zope.app.security.interfaces import IAuthentication
        >>> class FakeAuthenticationUtility:
        ...     zope.interface.implements(IAuthentication)
        >>> fake = FakeAuthenticationUtility()
        
        >>> from zope.app.testing import ztapi
        >>> ztapi.provideUtility(IAuthentication, fake)
        
        Then we should be able to get the service back when we ask for the
        principals:
        
        >>> zapi.principals() is fake
        True
        
        
        
        
        Download
        ========
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Zope Public License
Classifier: Programming Language :: Python
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development
Classifier: Framework :: Zope3
