summaryrefslogtreecommitdiff
path: root/repoze/bfg/interfaces.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2008-07-07 04:44:57 +0000
committerChris McDonough <chrism@agendaless.com>2008-07-07 04:44:57 +0000
commit7de404bb4af2744a64c13e31a780fc0229b8f9e5 (patch)
tree49f0b91b005777071050bf72732300f3bcd8d3ad /repoze/bfg/interfaces.py
parent93a4f5df2f74e4cbefc70733f2c0258859207106 (diff)
downloadpyramid-7de404bb4af2744a64c13e31a780fc0229b8f9e5.tar.gz
pyramid-7de404bb4af2744a64c13e31a780fc0229b8f9e5.tar.bz2
pyramid-7de404bb4af2744a64c13e31a780fc0229b8f9e5.zip
Look up a view after traversal; adapt it to IWSGIApplication.
Diffstat (limited to 'repoze/bfg/interfaces.py')
-rw-r--r--repoze/bfg/interfaces.py54
1 files changed, 35 insertions, 19 deletions
diff --git a/repoze/bfg/interfaces.py b/repoze/bfg/interfaces.py
index b0b769b02..af68410dd 100644
--- a/repoze/bfg/interfaces.py
+++ b/repoze/bfg/interfaces.py
@@ -1,29 +1,45 @@
from zope.interface import Interface
+from zope.interface import Attribute
-class IWSGIApplicationFactory(Interface):
- def __call__(context):
- """ Return a WSGI (PEP333) application """
+class IResponse(Interface):
+ status = Attribute('WSGI status code of response')
+ headerlist = Attribute('List of response headers')
+ app_iter = Attribute('Iterable representing the response body')
+
+class IView(Interface):
+ def __call__(*arg, **kw):
+ """ Must return an object that implements IResponse; args are
+ mapped into an IView's __call__ by mapply-like code """
+
+class IViewFactory(Interface):
+ def __call__(context, request):
+ """ Return an object that implements IView """
class IRootPolicy(Interface):
def __call__(environ):
""" Return a root object """
-class ITraversalPolicy(Interface):
- def __call__(environ, root):
- """ Return a tuple in the form (context, name, subpath) """
+class IPublishTraverser(Interface):
+ def __call__(path):
+ """ Return a tuple in the form (context, name, subpath), typically
+ the result of an object graph traversal """
-class ISecurityPolicy(Interface):
- def __call__(environ, context, name):
- """ Return a WSGI app on unauthorized or None to signify that
- the request is allowed to continue """
-
-class ITraverser(Interface):
- def __init__(context):
- """ Accept a context """
+class IPublishTraverserFactory(Interface):
+ def __call__(context, request):
+ """ Return an object that implements IPublishTraverser """
- def __call__(environ, name):
- """ Return a subcontext or based on name """
-
-class IWebObRequest(Interface):
- """ Marker interface for a webob.Request object """
+class IWSGIApplication(Interface):
+ def __call__(environ, start_response):
+ """ A PEP 333 application """
+
+class IWSGIApplicationFactory(Interface):
+ def __call__(view, request):
+ """ Return an object that implements IWSGIApplication """
+
+class IRequest(Interface):
+ """ Marker interface for a request object """
+class ILocation(Interface):
+ """Objects that have a structural location"""
+ __parent__ = Attribute("The parent in the location hierarchy")
+ __name__ = Attribute("The name of the object")