Interfaces: zope.browserresource.interfaces¶
Resource interfaces
-
interface
zope.browserresource.interfaces.IResource[source]¶ A resource.
Resources are static files and directories that are served to the browser directly from the filesystem. The most common example are images, CSS style sheets, or JavaScript files.
Resources are be registered under a symbolic name and can later be referred to by that name, so their usage is independent from their physical location.
-
request¶ Request object that is requesting the resource
-
__call__()¶ Return the absolute URL of this resource.
-
-
interface
zope.browserresource.interfaces.IFileResource[source]¶ Extends:
zope.browserresource.interfaces.IResourceA resource representing a single file.
-
interface
zope.browserresource.interfaces.IResourceFactory[source]¶ A callable object to produce
IResourceobjects.
-
interface
zope.browserresource.interfaces.IResourceFactoryFactory[source]¶ A factory for
IResourceFactoryobjectsThese factories are registered as named utilities that can be selected for creating resource factories in a pluggable way.
Resource directoriesand the<browser:resource>directiveuse these utilities to choose what resource to create, depending on the file extension, so third-party packages could easily plug-in additional resource types.-
__call__(path, checker, name)¶ Return an IResourceFactory
-
-
interface
zope.browserresource.interfaces.IETag[source]¶ An adapter for computing resource ETags.
These should be registered as multi-adapters on the resource and the request.
See also
-
__call__(mtime, content)¶ Compute an ETag for a resource.
Parameters: - mtime (float) – The filesystem modification time
of the resource (
os.path.getmtime) - content (bytes) – The contents of the resource.
Returns: A string representing the ETag, or
Noneto disable the ETag header.- mtime (float) – The filesystem modification time
of the resource (
-