| Home | Trees | Index | Help |
|---|
| Package qm :: Package external :: Package DocumentTemplate :: Module DT_String :: Class String |
|
File,
HTMLDocument 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)]
| Method Summary | |
|---|---|
Create a document template from a string. | |
Generate a document from a document template. | |
__getstate__(self,
_special)
| |
__str__(self)
| |
cook(self,
cooklock)
| |
Change or query default values in a document template. | |
errQuote(self,
s)
| |
id(self)
| |
initvars(self,
globals,
vars)
| |
manage_edit(self,
data,
REQUEST)
| |
Change the text or default values for a document template. | |
name(self)
| |
parse(self,
text,
start,
result,
tagre)
| |
parse_block(self,
text,
start,
result,
tagre,
stag,
sloc,
sargs,
scommand)
| |
parse_close(self,
text,
start,
tagre,
stag,
sloc,
scommand,
sa)
| |
parse_error(self,
mess,
tag,
text,
start)
| |
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. | |
read(self,
raw)
| |
read_raw(self,
raw)
| |
setName(self,
v)
| |
skip_eol(self,
text,
start,
eol)
| |
SubTemplate(self,
name)
| |
tagre(self)
| |
Change or query a variable in a document template. | |
varExtra(self,
match_ob)
| |
ZDocumentTemplate_afterRender(self,
md,
result)
| |
ZDocumentTemplate_beforeRender(self,
md,
default)
| |
| Method Details |
|---|
__init__(self,
source_string='',
mapping=None,
__name__='<string>',
**vars)
|
__call__(self,
client=None,
mapping={},
**kw)
|
default(self, name=None, **kw)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. |
munge(self, source_string=None, mapping=None, **vars)Change the text or default values for a document template. |
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. else)
or None otherwise
|
var(self, name=None, **kw)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. |
| Class Variable Details |
|---|
_parseTag__roles__
|
commands__roles__
|
cook__roles__
|
default__roles__
|
errQuote__roles__
|
func_code
|
func_defaults
|
func_defaults__roles__
|
initvars__roles__
|
isDocTemp
|
manage_edit__roles__
|
munge__roles__
|
parse__roles__
|
parse_block__roles__
|
parse_close__roles__
|
parse_error__roles__
|
parseTag__roles__
|
read__roles__
|
read_raw__roles__
|
setName__roles__
|
shared_globals
|
shared_globals__roles__
|
skip_eol__roles__
|
SubTemplate__roles__
|
tagre__roles__
|
validate
|
validate__roles__
|
var__roles__
|
varExtra__roles__
|
ZDocumentTemplate_afterRender__roles__
|
ZDocumentTemplate_beforeRender__roles__
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Thu Sep 27 15:49:07 2007 | http://epydoc.sf.net |