Skip to main content

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

Download

Release files for zope.app.zapi 3.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zope.app.zapi 3.5.0
File Size Uploaded
zope.app.zapi-3.5.0.tar.gz 6.2 kB Details

Release files / zope.app.zapi-3.5.0.tar.gz

Download URL zope.app.zapi-3.5.0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1af828759934b3db7024d4b219d94e337a16fac92793202e4791e4278e52e67b
BLAKE2b-256 checksum
How to use checksums
6d40bc9f0b75bf859b6d6ae7273456b994b8eaca61bf7e6714e2f68535ae5ba4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

3.5.0 This release

1 release file

3.4.1

1 release file

3.4.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page