This file is indexed.

/usr/share/doc/python-htmlgen/html/HTMLgen-AutoTemplateDocument.html is in python-htmlgen 2.2.2-12ubuntu3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<!-- This file generated using Python HTMLgen module. -->
<HEAD>
  <META NAME="GENERATOR" CONTENT="HTMLgen 2.2.2">
        <TITLE>Class AutoTemplateDocument - Generate documents based on a template and a substitution mapping.</TITLE>

 <LINK rel=stylesheet href="HTMLgen.css" type=text/css title="HTMLgen.css">
</HEAD>
<BODY BGCOLOR="#FFFFFF" BACKGROUND="../image/bg-dots.gif" TEXT="#000000" LINK="#EE0000" VLINK="#990000">
<A HREF="HTMLgen-AutoStringTemplate.html"><IMG src="../image/back.gif" height="22" width="66" alt="Previous" border="0"></A> 
<A HREF="HTMLgen-BR.html"><IMG src="../image/next.gif" height="22" width="66" alt="Next" border="0"></A> 
<IMG src="../image/blank.gif" height="22" width="66" alt="blank.gif"> 
<IMG src="../image/blank.gif" height="22" width="66" alt="blank.gif"> 
<H3>Class AutoTemplateDocument - Generate documents based on a template and a substitution mapping.</H3>
<HR>

<H2>SYNOPSIS</H2>

<PRE>import HTMLgen</PRE>

<PRE>class AutoTemplateDocument(AutoStringTemplate)
  string __module__ = 'HTMLgen'
  def set_template(self, template)

  # Methods inherited by AutoTemplateDocument from AutoStringTemplate
  <A HREF="#def extract_template(self, source=None)">def extract_template(self, source=None)</A>

  # Methods inherited by AutoTemplateDocument from StringTemplate
  def __getitem__(self, name)
  def __init__(self, template, substitutions=None, **kw)
  def __setitem__(self, name, value)
  def __str__(self)
  def keys(self)
  <A HREF="#def write(self, filename = None)">def write(self, filename = None)</A>
</PRE>

<H2>DESCRIPTION</H2>


<P>The primary difference between AutoTemplateDocument and TemplateDocument
is that the Auto version can read through an HTML file previously
generated with this class and identify the regions of text that were
substituted. It then extracts that text into the substitution dictionary
and can then be updated. The intent is to eliminate the need to 
maintain separate content files for insertion into templates. The HTML
output file can double as a template for future use.
Output from this class have their filled regions marked by comments:
    ...gets &lt;!--{wz}Begin--&gt;glued,&lt;!--{wz}End--&gt; in place...
Which came from ...gets {wz} in place... in old style template syntax.</P>


<P>AutoTemplateDocument is a functional superset of TemplateDocument and should
be compatible.</P>


<P>Usage:
   T = AutoTemplateDocument('Maine.html')
   T.substitutions = {'month': ObjectY, <CODE>town</CODE>
: 'Scarborough'}
   or
   T['month'] = ObjectY ; T['town'] = <CODE>Scarborough</CODE>

   T.write('Maine.html')</P>


<P>A dictionary, or object that behaves like a dictionary, is assigned to the
<EM>substitutions</EM> attribute which has symbols as keys to objects. Upon every
occurance of these symbols surrounded by braces {} in the source template,
the corresponding value is converted to a string and substituted in the output.</P>


<P>For example, source text which looks like:
 I lost my heart at {town} Fair.
becomes:
 I lost my heart at Scarborough Fair.</P>


<P>Symbols in braces which do not correspond to a key in the dictionary remain
unchanged.</P>


<P>An optional third argument to the class is a list or two strings to be
used as the delimiters instead of { } braces. They must be of the same
length; for example "<CODE>##+</CODE>
, '##'" is invalid.
</P>

<H3><A NAME="def extract_template(self, source=None)">def extract_template(self, source=None)</A></H3>


<P>Convert comment-marked regions to a regular {tokens}.</P>


<P>Updates the substitution dictionary with the text from the region.
</P>

<H3><A NAME="def write(self, filename = None)">def write(self, filename = None)</A></H3>


<P>Emit the Document HTML to a file or standard output.</P>


<P>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.
</P>

<H2>SEE ALSO</H2>


<P><A HREF="HTMLgen_overview.html">HTMLgen</A></P>


<P><A HREF="HTMLgen-AutoStringTemplate.html">AutoStringTemplate</A></P>


<P><HR>
<A HREF="HTMLgen-AutoStringTemplate.html"><IMG src="../image/back.gif" height="22" width="66" alt="Previous" border="0"></A> 
<A HREF="HTMLgen-BR.html"><IMG src="../image/next.gif" height="22" width="66" alt="Next" border="0"></A> 
<IMG src="../image/blank.gif" height="22" width="66" alt="blank.gif"> 
<IMG src="../image/blank.gif" height="22" width="66" alt="blank.gif"> 
<BR><IMG src="../image/Buzz.gif" height="51" width="56" alt="Buzz.gif" align="bottom">
<FONT SIZE="-1"><P>Copyright &#169 Robin Friedrich<BR>All Rights Reserved<BR>

Comments to author: <A HREF="mailto:&#102;ri&#101;dr&#105;ch&#64;py&#116;ho&#110;pr&#111;s.&#99;om">friedrich@pythonpros.com</A><br>
Generated: Tue Apr 20, 1999 <BR><hr>
</FONT>
</BODY> </HTML>