[Zope-Checkins] CVS: Zope/lib/python/StructuredText - HTMLClass.py:1.21 HTMLWithImages.py:1.8
Andreas Jung
andreas@digicool.com
Wed, 22 May 2002 13:40:48 -0400
Update of /cvs-repository/Zope/lib/python/StructuredText
In directory cvs.zope.org:/tmp/cvs-serv4653
Modified Files:
HTMLClass.py HTMLWithImages.py
Log Message:
document() function of HTMLWithImages now behaves like in HTMLClass
and recognizes the header attribute
=== Zope/lib/python/StructuredText/HTMLClass.py 1.20 => 1.21 ===
children=doc.getChildNodes()
- if self.header==1:
+ if self.header:
output('<html>\n')
if (children and
children[0].getNodeName() == 'StructuredTextSection'):
@@ -67,7 +67,7 @@
for c in children:
getattr(self, self.element_types[c.getNodeName()])(c, level, output)
- if self.header==1:
+ if self.header:
output('</body>\n')
output('</html>\n')
=== Zope/lib/python/StructuredText/HTMLWithImages.py 1.7 => 1.8 ===
def document(self, doc, level, output):
- output('<html>\n')
- children=doc.getChildNodes()
- if (children and
- children[0].getNodeName() == 'StructuredTextSection'):
- output('<head>\n<title>%s</title>\n</head>\n' %
- children[0].getChildNodes()[0].getNodeValue())
- output('<body>\n')
+
+ if self.header:
+ output('<html>\n')
+ children=doc.getChildNodes()
+ if (children and
+ children[0].getNodeName() == 'StructuredTextSection'):
+ output('<head>\n<title>%s</title>\n</head>\n' %
+ children[0].getChildNodes()[0].getNodeValue())
+ output('<body>\n')
+
for c in children:
getattr(self, self.element_types[c.getNodeName()])(c, level, output)
- output('</body>\n')
- output('</html>\n')
+
+ if self.header:
+ output('</body>\n')
+ output('</html>\n')
def image(self, doc, level, output):
if hasattr(doc, 'key'):