Package qm :: Package external :: Package DocumentTemplate :: Module DT_Util
[show private | hide private]
[frames | no frames]

Module qm.external.DocumentTemplate.DT_Util

DTML Utilities

$Id: DT_Util.py 1007 2007-02-10 01:07:28Z stefan $
Classes
Eval  

Function Summary
  careful_getattr(md, inst, name, default)
  careful_getitem(md, mapping, key)
  careful_getslice(md, seq, *indexes)
  careful_hasattr(md, inst, name)
  careful_pow(self, x, y, z)
  careful_range(md, iFirst, *args)
  html_quote(v, name, md, character_entities)
  int_param(params, md, name, default, st)
  name_param(params, tag, expr, attr, default_unnamed)
  namespace(self, **kw)
Create a tuple consisting of a single instance whose attributes are provided as keyword arguments.
  obsolete_attr(self, inst, name, md)
  parse_params(text, result, tag, unparmre, qunparmre, parmre, qparmre, **parms)
Parse tag parameters
  render(self, v)
Render an object in the way done by the 'name' attribute
  reorder(self, s, with, without)
  test(self, *args)

Variable Summary
dict d = {'__module__': 'qm.external.DocumentTemplate.pDocume...
str Expr_doc = '\n\n\nPython expression support\n\n  Several...
dict expr_globals = {'__builtins__': {}, '__guarded_getslice_...
str ParseError = 'Document Template Parse Error'
str ValidationError = 'Unauthorized'

Function Details

namespace(self, **kw)

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

parse_params(text, result=None, tag='', unparmre=<_sre.SRE_Pattern object at 0xb7da6bf0>, qunparmre=<_sre.SRE_Pattern object at 0xb7d4a860>, parmre=<_sre.SRE_Pattern object at 0x81d8f08>, qparmre=<_sre.SRE_Pattern object at 0x81dbe50>, **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.

render(self, v)

Render an object in the way done by the 'name' attribute

Variable Details

d

Type:
dict
Value:
{'None': None,
 '__call__': <function __call__ at 0xb7c8b8b4>,
 '__doc__': None,
 '__getitem__': <function __getitem__ at 0xb7c8b844>,
 '__init__': <function __init__ at 0xb7c8b80c>,
 '__module__': 'qm.external.DocumentTemplate.pDocumentTemplate',
 '_pop': <function _pop at 0xb7c8b79c>,
 '_push': <function _push at 0xb7c8b7d4>,
...                                                                    

Expr_doc

Type:
str
Value:
'''


Python expression support

  Several document template tags, including \'var\', \'in\', \'if\', \\
'else\',
  and \'elif\' provide support for using Python expressions via an
...                                                                    

expr_globals

Type:
dict
Value:
{'__builtins__': {},
 '__guarded_getattr__': <function careful_getattr at 0xb7c8b224>,
 '__guarded_getitem__': <function careful_getitem at 0xb7c8b294>,
 '__guarded_getslice__': <function careful_getslice at 0xb7c8b2cc>,
 '__guarded_mul__': <function careful_mul at 0xb7c8b064>}              

ParseError

Type:
str
Value:
'Document Template Parse Error'                                        

ValidationError

Type:
str
Value:
'Unauthorized'                                                         

Generated by Epydoc 2.1 on Thu Sep 27 15:48:59 2007 http://epydoc.sf.net