Changeset 178bfea in sasview for invariantview
- Timestamp:
- Jul 30, 2010 11:09:58 AM (14 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 0399c78
- Parents:
- f310316
- Location:
- invariantview/perspectives/invariant
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
invariantview/perspectives/invariant/invariant_panel.py
rd318616 r178bfea 666 666 if float(next_state_num)+2 > len(self.state.state_list): 667 667 self._redo_disable() 668 el if not self.button_redo.Enabled:668 else: 669 669 self._redo_enable() 670 670 -
invariantview/perspectives/invariant/invariant_state.py
rf310316 r178bfea 549 549 """ 550 550 # some imports 551 import cStringIO551 #import cStringIO 552 552 import matplotlib,wx 553 553 import matplotlib.pyplot as plt -
invariantview/perspectives/invariant/report_dialog.py
rf310316 r178bfea 122 122 123 123 fName = dlg.GetPath() 124 ext_num = dlg.GetFilterIndex() 125 126 #set file extensions 127 if ext_num == 0: 128 ext = '.html' 129 img_ext= '_img4html.png' 130 report_frame = self.report_list[0] 131 elif ext_num == 1: 132 ext = '.txt' 133 # changing the image extension actually changes the image format on saving 134 img_ext= '_img4txt.pdf' 135 report = self.report_list[1] 136 else: 137 return 124 138 125 if dlg.GetFilterIndex()== 0: 126 fName = os.path.splitext(fName)[0] + '.html' 127 dlg.Destroy() 139 #file name 140 fName = os.path.splitext(fName)[0] + ext 141 dlg.Destroy() 142 #pic (png) file path/name 143 pic_fname = os.path.splitext(fName)[0] + img_ext 144 #put the image path in html string 145 if ext_num == 0: report = report_frame % pic_fname 146 f = open(fName, 'w') 147 f.write(report) 148 f.close() 149 #save png file using pic_fname 150 self.report_list[2].savefig(pic_fname) 151 128 152 129 #pic (png) file path/name130 pic_fname = os.path.splitext(fName)[0] + '_img.png'131 #put the path in html string132 html = self.report_list[0] % pic_fname133 f = open(fName, 'w')134 f.write(html)135 f.close()136 #save png file using pic_fname137 self.report_list[2].savefig(pic_fname)138 139 elif dlg.GetFilterIndex()== 1:140 fName = os.path.splitext(fName)[0] + '.txt'141 dlg.Destroy()142 143 text = self.report_list[1]144 f = open(fName, 'w')145 f.write(text)146 f.close()147 148 153 def onPreview(self,event=None): 149 154 """
Note: See TracChangeset
for help on using the changeset viewer.