ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Tool_Box/HTML_Printer.py
Revision: 8
Committed: Sat May 5 04:21:19 2012 UTC (13 years, 10 months ago) by ninoborges
Content type: text/x-python
File size: 839 byte(s)
Log Message:
Initial Import

File Contents

# User Rev Content
1 ninoborges 8 ## HTML_Printer.py
2     ## Printing framework for wx in HTML
3     ## EBorges
4     ## 09.16.03
5    
6    
7     from wx.html import HtmlEasyPrinting
8    
9     class Printer(HtmlEasyPrinting):
10     def __init__(self):
11     HtmlEasyPrinting.__init__(self)
12    
13     def GetHtmlText(self,text):
14     "Simple conversion of text. Use a more powerful version"
15     print text
16     html_text = text.replace('\n\n','<P>')
17     html_text = text.replace('\n', '<BR>')
18     return html_text
19    
20     def Print(self, text, doc_name):
21     self.SetHeader(doc_name)
22     #self.PrintText(self.GetHtmlText(text),doc_name)
23     self.PrintText(text,doc_name)
24    
25     def PreviewText(self, text, doc_name):
26     self.SetHeader(doc_name)
27     #HtmlEasyPrinting.PreviewText(self, self.GetHtmlText(text))
28     HtmlEasyPrinting.PreviewText(self, text)