Changes in / [3ef5b2f:25f223b] in sasview
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
check_packages.py
r61c93b3 rb52f47f 24 24 'wx':{'version':'2.8.12.1','import_name':'wx','test':'__version__'}, 25 25 'matplotlib':{'version':'1.1.0','import_name':'matplotlib','test':'__version__'}, 26 ' xhtml2pdf':{'version':'3.0.33','import_name':'xhtml2pdf','test':'__version__'},26 'pisa':{'version':'3.0.28','import_name':'ho.pisa','test':'__version__'}, 27 27 'sphinx':{'version':'1.2.1','import_name':'sphinx','test':'__version__'}, 28 28 'unittest-xml-reporting':{'version':'1.10.0','import_name':'xmlrunner','test':'__version__'}, -
sasview/setup_exe.py
r61c93b3 r4172557 308 308 packages = [ 309 309 'matplotlib', 'scipy', 'encodings', 'comtypes', 310 'win32com', ' xhtml2pdf', 'bumps',310 'win32com', 'ho.pisa', 'bumps', 311 311 ] 312 312 packages.extend([ -
src/sas/guiframe/gui_manager.py
r4d5c42f ra4340d1 2129 2129 logging.error("Error in _onTutorial: %s" % sys.exc_value) 2130 2130 try: 2131 # Try an alternate method 2132 logging.error("Could not open the tutorial pdf, trying xhtml2pdf") 2133 from xhtml2pdf import pisa 2131 #in case when the pdf default set other than acrobat 2132 import ho.pisa as pisa 2134 2133 pisa.startViewer(path) 2135 2134 except: 2136 logging.error("Could not open the tutorial pdf with xhtml2pdf")2137 2135 msg = "This feature requires 'PDF Viewer'\n" 2136 msg += "Please install it first (Free)..." 2138 2137 wx.MessageBox(msg, 'Error') 2139 2138 else: … … 2143 2142 except: 2144 2143 try: 2145 # Try an alternate method 2146 logging.error("Could not open the tutorial pdf, trying xhtml2pdf") 2147 from xhtml2pdf import pisa 2144 #in case when the pdf default set other than preview 2145 import ho.pisa as pisa 2148 2146 pisa.startViewer(path) 2149 2147 except: 2150 logging.error("Could not open the tutorial pdf with xhtml2pdf")2151 msg = "This feature requires the 'Preview' application\n"2148 msg = "This feature requires 'Preview' Application\n" 2149 msg += "Please install it first..." 2152 2150 wx.MessageBox(msg, 'Error') 2153 2151 -
src/sas/perspectives/fitting/report_dialog.py
r4ec242e rd06ae30 17 17 import os 18 18 import wx.html as html 19 import logging20 19 21 20 _STATICBOX_WIDTH = 480 … … 298 297 """ 299 298 Create a PDF file from html source string. 300 Returns True is the file creation was successful.301 299 302 300 : data: html string 303 301 : filename: name of file to be saved 304 302 """ 305 try: 306 from xhtml2pdf import pisa 307 # open output file for writing (truncated binary) 308 resultFile = open(filename, "w+b") 309 # convert HTML to PDF 310 pisaStatus = pisa.CreatePDF(data, dest=resultFile) 311 # close output file 312 resultFile.close() 313 self.Update() 314 return pisaStatus.err 315 except: 316 logging.error("Error creating pdf: %s" % sys.exc_value) 317 return False 303 import ho.pisa as pisa 304 f = file(filename, "wb") 305 # pisa requires some extra packages, see their web-site 306 pdf = pisa.CreatePDF(data, f) 307 308 # close the file here otherwise it will be open until quitting 309 #the application. 310 f.close() 311 self.Update() 312 return not pdf.err -
src/sas/perspectives/invariant/report_dialog.py
r4ec242e r79492222 18 18 import os 19 19 import wx.html as html 20 import logging21 20 ISPDF = False 22 21 if sys.platform == "win32": … … 247 246 def HTML2PDF(self, data, filename): 248 247 """ 249 Create a PDF file from html source string. 250 Returns True is the file creation was successful. 248 Create a PDF file from html source string. 251 249 252 250 : data: html string 253 251 : filename: name of file to be saved 254 252 """ 255 try: 256 from xhtml2pdf import pisa 257 # open output file for writing (truncated binary) 258 resultFile = open(filename, "w+b") 259 # convert HTML to PDF 260 pisaStatus = pisa.CreatePDF(data, dest=resultFile) 261 # close output file 262 resultFile.close() 263 self.Update() 264 return pisaStatus.err 265 except: 266 logging.error("Error creating pdf: %s" % sys.exc_value) 267 return False 253 import ho.pisa as pisa 254 f = file(filename, "wb") 255 # pisa requires some extra packages, see their web-site 256 pdf = pisa.CreatePDF(data, f) 257 # close the file here otherwise it will be open until quitting 258 #the application. 259 f.close() 260 261 return not pdf.err 262 263 264
Note: See TracChangeset
for help on using the changeset viewer.