### Class AutoStringTemplate

## SYNOPSIS

    import HTMLgen

    class AutoStringTemplate(StringTemplate)
      RegexObject R = <re.RegexObject instance a ...
      string __module__ = 'HTMLgen'
      def extract_template(self, source=None)
      string marker_begin = '<!--{%s}Begin-->'
      string marker_end = '<!--{%s}End-->'
      def set_template(self, template)

      # Methods inherited by AutoStringTemplate from StringTemplate
      def __getitem__(self, name)
      def __init__(self, template, substitutions=None, **kw)
      def __setitem__(self, name, value)
      def __str__(self)
      def keys(self)
      def write(self, filename = None)

## DESCRIPTION

### def extract_template(self, source=None)

Convert comment-marked regions to a regular {tokens}.

Updates the substitution dictionary with the text from the region.

### def set_template(self, template)

Set template string and normalize by extracting comment tokens.

### def write(self, filename = None)

Emit the Document HTML to a file or standard output.

Will not overwrite file is it exists and is textually the same. In Unix you can use environment variables in filenames. Will print to stdout if no argument given.

## SEE ALSO

HTMLgen

StringTemplate

Copyright © Robin Friedrich
All Rights Reserved
Comments to author: friedrich@pythonpros.com
Generated: Tue Apr 20, 1999