Table of Contents

Module: environ ./src/peak/web/environ.py

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
parseName
relativeURL
simpleRedirect
traverseAttr
traverseDefault
traverseItem
traverseLocationId
traverseResource
traverseSkin
traverseView
  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,
        )

Exceptions   
errors.NotFound( ctx, qname, ob )
  traverseDefault 
traverseDefault (
        ctx,
        ob,
        ns,
        name,
        qname,
        default=NOT_GIVEN,
        )

  traverseItem 
traverseItem (
        ctx,
        ob,
        ns,
        name,
        qname,
        default=NOT_GIVEN,
        )

Exceptions   
errors.NotFound( ctx, qname, ob )
  traverseLocationId 
traverseLocationId (
        ctx,
        ob,
        ns,
        name,
        qname,
        default=NOT_GIVEN,
        )

Exceptions   
errors.NotFound( orig_ctx, qname, ob )
  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,
        )

Exceptions   
errors.NotFound( ctx, qname, ob )
Classes   

Context

Keep track of current traversal state

StartContext

TraversableAsHandler


Table of Contents

This document was automatically generated on Mon Nov 11 01:11:04 2024 by HappyDoc version 2.1