ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Tool_Box/py2bkp/HTML_Printer.py.bak
Revision: 744
Committed: Tue Apr 13 21:40:41 2021 UTC (4 years, 11 months ago) by nino.borges
Content type: application/x-trash
File size: 839 byte(s)
Log Message:
Updated all tools libs to be python 3 compatible. 

File Contents

# Content
1 ## 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)