Functions to manipulate traversal context/environment
TODO:
a function to replace outgoing MIME headers (e.g. to set content type,
length)
functions to create outgoing cookies and parse incoming ones
Docstrings! and an intro to the environ concept
|
Imported modules
|
|
from cStringIO import StringIO
from dispatch import generic
from dispatch.strategy import default
import errors
from interfaces import *
import os
from peak.api import *
from peak.security.api import Anybody, allow
import posixpath
import protocols
import re
from wsgiref.util import shift_path_info, setup_testing_defaults, request_uri
|
|
Functions
|
|
|
|
|
|
clientHas
|
clientHas (
environ,
lastModified=None,
ETag=None,
)
|
|
|
parseName
|
parseName ( name )
Return ns,nm pair for name
If name begins with "@@", ns will equal view, and nm will be
the remainder of name. If name begins with a '"++"-bracketed
Python identifier, such as "++foo_27++"', the identifier will be returned
in ns, and the remainder of name in nm. Otherwise, ns will be
an empty string, and nm will be name.
|
|
|
relativeURL
|
relativeURL ( base, url )
Convert absolute url to be relative to base, if possible
|
|
|
simpleRedirect
|
simpleRedirect ( environ, location )
|
|
|
traverseAttr
|
traverseAttr (
ctx,
ob,
ns,
name,
qname,
default=NOT_GIVEN,
)
|
|
|
traverseDefault
|
traverseDefault (
ctx,
ob,
ns,
name,
qname,
default=NOT_GIVEN,
)
|
|
|
traverseItem
|
traverseItem (
ctx,
ob,
ns,
name,
qname,
default=NOT_GIVEN,
)
|
|
|
traverseLocationId
|
traverseLocationId (
ctx,
ob,
ns,
name,
qname,
default=NOT_GIVEN,
)
|
|
|
traverseResource
|
traverseResource (
ctx,
ob,
ns,
nm,
qname,
default=NOT_GIVEN,
)
|
Exceptions
|
|
errors.NotFound( ctx, qname, ctx.current )
|
|
|
|
traverseSkin
|
traverseSkin (
ctx,
ob,
ns,
nm,
qname,
default=NOT_GIVEN,
)
|
Exceptions
|
|
errors.NotFound( ctx, qname, ctx.current )
|
|
|
|
traverseView
|
traverseView (
ctx,
ob,
ns,
name,
qname,
default,
)
|
|
Classes
|
|
|
|
|