Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install zope.app.zapi

How to install zope.app.zapi

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install zope.app.zapi
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
3.5.0 Available View build log
3.4.1 Available View build log
Windows (64-bit)
3.5.0 Available View build log
3.4.1 Available View build log
Mac OS X (10.5+)
3.5.0 Available View build log
3.4.1 Available View build log
Linux (32-bit)
3.5.0 Available View build log
3.4.1 Available View build log
Linux (64-bit)
3.5.0 Available View build log
3.4.1 Available View build log
 
License
ZPL 2.1
Imports
Lastest release
version 3.5.0 on Mar 2nd, 2011

CHANGES

3.5.0 (2011-03-01)
  • Removed BBB imports of deprecated parts (services, multiviews etc.) which were removed in zope.component 3.6, thus requiring at least this version.
  • Using Python's doctest module instead of depreacted zope.testing.doctest.
3.4.1 (2009-07-23)
  • Explicitely list all dependencies. Fixes test failures.
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.authentication.interfaces.IAuthentication>, '')

But if we provide an authentication service:

>>> import zope.interface
>>> from zope.authentication.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

Subscribe to package updates

Last updated Mar 2nd, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.