+ ####################
+ # store and restitute html fragments
+ @staticmethod
+ def html_href (url,text): return '<a href="%s">%s</a>'%(url,text)
+ @staticmethod
+ def html_anchor (url,text): return '<a name="%s">%s</a>'%(url,text)
+
+ # only the fake error module has multiple titles
+ def html_store_title (self, title):
+ if not hasattr(self,'titles'): self.titles=[]
+ self.titles.append(title)
+ def html_store_raw (self, html):
+ if not hasattr(self,'body'): self.body=''
+ self.body += html
+ def html_store_pre (self, text):
+ if not hasattr(self,'body'): self.body=''
+ self.body += '<pre>' + text + '</pre>'
+
+ def html_dump_header(self):
+ now=time.strftime("%Y-%m-%d %H:%M")
+ print """
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title> Pending changes in %s </title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<style type="text/css">
+body { font-family:georgia, serif; }
+h1 {font-size: large; }
+p.title {font-size: x-large; }
+span.error {text-weight:bold; color: red; }
+</style>
+</head>
+<body>
+<p class='title'> Pending changes in %s - status at %s</p>
+<ul>
+"""%(self.options.www,self.options.www,now)
+
+ @staticmethod
+ def html_dump_middle():
+ print "</ul>"
+
+ @staticmethod
+ def html_dump_footer():
+ print "</body></html"
+
+ def html_dump_toc(self):
+ if hasattr(self,'titles'):
+ for title in self.titles:
+ print '<li>',self.html_href ('#'+self.friendly_name(),title),'</li>'
+
+ def html_dump_body(self):
+ if hasattr(self,'titles'):
+ for title in self.titles:
+ print ('<hr />')
+ print '<h1>',self.html_anchor(self.friendly_name(),title),'</h1>'
+ if hasattr(self,'body'):
+ print self.body
+
+ ####################