Home | Trees | Index | Help |
---|
|
Document templates defined from strings.
Document template strings use an extended form of python string formatting. To insert a named value, simply include text of the form: '%(name)x', where 'name' is the name of the value and 'x' is a format specification, such as '12.2d'.
To intrduce a block such as an 'if' or an 'in' or a block continuation, such as an 'else', use '[' as the format specification. To terminate a block, ise ']' as the format specification, as in:%(in results)[ %(name)s %(in results)]
|
|||
errQuote(self, s) | |||
parse_error(self, mess, tag, text, start) | |||
SubTemplate(self, name) | |||
tagre(self) | |||
_parseTag(self, match_ob, command=None, sargs='', tt=<type 'tuple'>) | |||
parseTag(self,
match_ob,
command=None,
sargs='')
Parse a tag using an already matched re Return: tag, args, command, coname where: tag is the tag, args is the tag's argument string, command is a corresponding command info structure if the tag is a start tag, or None otherwise, and coname is the name of a continue tag (e.g. |
|||
varExtra(self, match_ob) | |||
parse(self, text, start=0, result=None, tagre=None) | |||
skip_eol(self, text, start, eol=re.compile('[ \t]*\n')) | |||
parse_block(self, text, start, result, tagre, stag, sloc, sargs, scommand) | |||
parse_close(self, text, start, tagre, stag, sloc, scommand, sa) | |||
__init__(self,
source_string='',
mapping=None,
__name__='<string>',
**vars)
Create a document template from a string. |
|||
name(self) | |||
id(self) | |||
setName(self, v) | |||
default(self,
name=None,
**kw)
Change or query default values in a document template. |
|||
var(self,
name=None,
**kw)
Change or query a variable in a document template. |
|||
munge(self,
source_string=None,
mapping=None,
**vars)
Change the text or default values for a document template. |
|||
manage_edit(self, data, REQUEST=None) | |||
read_raw(self, raw=None) | |||
read(self, raw=None) | |||
cook(self, cooklock=thread.allocate_lock()) | |||
initvars(self, globals, vars) | |||
ZDocumentTemplate_beforeRender(self, md, default) | |||
ZDocumentTemplate_afterRender(self, md, result) | |||
__call__(self,
client=None,
mapping={},
**kw)
Generate a document from a document template. |
|||
__str__(self) | |||
__getstate__(self, _special=('_v_','_p_')) |
|
|
|
|
|
|
Parse a tag using an already matched re Return: tag, args, command, coname where: tag is the tag, args is the tag's argument string, command is a corresponding command info structure if the tag is a start tag, or None otherwise, and coname is the name of a continue tag (e.g. else) or None otherwise |
|
|
|
|
|
Create a document template from a string. The optional parameter, 'mapping', may be used to provide a mapping object containing defaults for values to be inserted. |
|
|
|
Change or query default values in a document template. If a name is specified, the value of the named default value before the operation is returned. Keyword arguments are used to provide default values. |
Change or query a variable in a document template. If a name is specified, the value of the named variable before the operation is returned. Keyword arguments are used to provide variable values. |
|
|
|
|
|
|
|
|
Generate a document from a document template. The document will be generated by inserting values into the format string specified when the document template was created. Values are inserted using standard python named string formats. The optional argument 'client' is used to specify a object containing values to be looked up. Values will be looked up using getattr, so inheritence of values is supported. Note that names beginning with '_' will not be looked up from the client. The optional argument, 'mapping' is used to specify a mapping object containing values to be inserted. Values to be inserted may also be specified using keyword arguments. Values will be inserted from one of several sources. The sources, in the order in which they are consulted, are: o Keyword arguments, o The 'client' argument, o The 'mapping' argument, o The keyword arguments provided when the object was created, and o The 'mapping' argument provided when the template was created. |
|
|
|
isDocTemp
|
func_code
|
func_defaults__roles__
|
func_defaults
|
errQuote__roles__
|
parse_error__roles__
|
commands__roles__
|
commands
|
SubTemplate__roles__
|
tagre__roles__
|
_parseTag__roles__
|
parseTag__roles__
|
varExtra__roles__
|
parse__roles__
|
skip_eol__roles__
|
parse_block__roles__
|
parse_close__roles__
|
shared_globals__roles__
|
shared_globals
|
setName__roles__
|
default__roles__
|
var__roles__
|
munge__roles__
|
manage_edit__roles__
|
read_raw__roles__
|
read__roles__
|
cook__roles__
|
initvars__roles__
|
ZDocumentTemplate_beforeRender__roles__
|
ZDocumentTemplate_afterRender__roles__
|
validate__roles__
|
validate
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 3.0alpha2 on Fri Sep 28 00:57:31 2007 | http://epydoc.sf.net |