Table of Contents

Module: DT_Util qm/external/DocumentTemplate/DT_Util.py

$Id: DT_Util.py,v 1.1 2003/04/16 02:53:49 sc Exp $

Functions   
careful_getattr
careful_getitem
careful_getslice
careful_hasattr
careful_pow
careful_range
html_quote
int_param
name_param
namespace
obsolete_attr
parse_params
render
reorder
test
  careful_getattr 
careful_getattr (
        md,
        inst,
        name,
        default=_marker,
        )

Exceptions   
ValidationError, name
  careful_getitem 
careful_getitem (
        md,
        mapping,
        key,
        )

Exceptions   
ValidationError, key
  careful_getslice 
careful_getslice (
        md,
        seq,
        *indexes,
        )

Exceptions   
ValidationError, 'unauthorized access to slice member'
  careful_hasattr 
careful_hasattr (
        md,
        inst,
        name,
        )

  careful_pow 
careful_pow (
        self,
        x,
        y,
        z,
        )

Exceptions   
ValueError, 'pow(x, y, z) with z==0'
  careful_range 
careful_range (
        md,
        iFirst,
        *args,
        )

Exceptions   
AttributeError, 'range() requires 1-3 int arguments'
ValueError, 'range() too large'
ValueError, 'zero step for range()'
  html_quote 
html_quote (
        v,
        name='(Unknown name)',
        md={},
        character_entities=((( '&' ), '&amp;' ), (( '<' ), '&lt;' ), (( '>' ), '&gt;' ), (( '"' ), '&quot;' ) ),
        )

  int_param 
int_param (
        params,
        md,
        name,
        default=0,
        st=type( '' ),
        )

  name_param 
name_param (
        params,
        tag='',
        expr=0,
        attr='name',
        default_unnamed=1,
        )

Exceptions   
ParseError, ( '%s and expr given' % attr, tag )
ParseError, ( 'Expression (Python) Syntax error:' '\n
\n%s\n
\n' % v [ 0 ], tag )
ParseError, ( 'No %s given' % attr, tag )
ParseError, ( 'The "..." shorthand for expr was used in a tag ' 'that doesn\'t support expr attributes.', tag )
ParseError, ( 'Two %s values were given' % attr, tag )
ParseError, ( 'two exprs given', tag )
  namespace 
namespace ( self,  **kw )

Create a tuple consisting of a single instance whose attributes are provided as keyword arguments.

Exceptions   
TypeError, '''A call was made to DT_Util.namespace() with an incorrect "self" argument. It could be caused by a product which is not yet compatible with this version of Zope. The traceback information may contain more details.)'''
  obsolete_attr 
obsolete_attr (
        self,
        inst,
        name,
        md,
        )

  parse_params 
parse_params (
        text,
        result=None,
        tag='',
        unparmre=regex.compile( '\([\0- ]*\([^\0- =\"]+\)\)' ),
        qunparmre=regex.compile( '\([\0- ]*\("[^"]*"\)\)' ),
        parmre=regex.compile( '\([\0- ]*\([^\0- =\"]+\)=\([^\0- =\"]+\)\)' ),
        qparmre=regex.compile( '\([\0- ]*\([^\0- =\"]+\)="\([^"]*\)\"\)' ),
        **parms,
        )

Parse tag parameters

The format of tag parameters consists of 1 or more parameter specifications separated by whitespace. Each specification consists of an unnamed and unquoted value, a valueless name, or a name-value pair. A name-value pair consists of a name and a quoted or unquoted value separated by an =.

The input parameter, text, gives the text to be parsed. The keyword parameters give valid parameter names and default values.

If a specification is not a name-value pair and it is not the first specification and it is a valid parameter name, then it is treated as a name-value pair with a value as given in the keyword argument. Otherwise, if it is not a name-value pair, it is treated as an unnamed value.

The data are parsed into a dictionary mapping names to values. Unnamed values are mapped from the name "". Only one value may be given for a name and there may be only one unnamed value.

Exceptions   
ParseError, ( 'Attribute %s requires a value' % name, tag )
ParseError, ( 'Duplicate values for attribute "%s"' % name, tag )
ParseError, ( 'Invalid attribute name, "%s"' % name, tag )
ParseError, ( 'invalid parameter: "%s"' % text, tag )
  render 
render ( self,  v )

Render an object in the way done by the name attribute

  reorder 
reorder (
        self,
        s,
        with=None,
        without=(),
        )

  test 
test ( self,  *args )

Classes   

Eval


Table of Contents

This document was automatically generated on Mon Jan 3 09:42:36 2005 by HappyDoc version 2.1