Changeset 83eb1b52 in sasview for sansguiframe/src/sans/guiframe/gui_manager.py
- Timestamp:
- Sep 12, 2011 10:18:19 AM (13 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:
- dc79cfc
- Parents:
- caf3a08f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansguiframe/src/sans/guiframe/gui_manager.py
rcaf3a08f r83eb1b52 38 38 from sans.guiframe.gui_toolbar import GUIToolBar 39 39 from sans.guiframe.data_processor import GridFrame 40 from sans.guiframe.data_processor import BatchOutput Dialog40 from sans.guiframe.data_processor import BatchOutputFrame 41 41 from sans.guiframe.events import EVT_NEW_BATCH 42 42 from sans.dataloader.loader import Loader … … 299 299 ext = ".csv" 300 300 file_name = "Batch_" + str(plugin_name)+ "_" + time_str + ext 301 file_name = self._default_save_location + str(file_name) 301 302 #Need to save configuration for later 302 dlg = BatchOutputDialog(parent=self, data=data,303 frame = BatchOutputFrame(parent=self, data=data, 303 304 file_name=file_name, 304 305 details=details) 305 flag = None 306 if dlg.ShowModal() == wx.ID_CANCEL: 307 flag = dlg.flag 308 dlg.Show(True) 309 else: 310 dlg.Destroy() 311 if flag == 1: 312 self.batch_frame.set_data(data) 313 self.batch_frame.Show(True) 314 elif flag == 2: 315 file_name = self._default_save_location + str(file_name) 316 if not os.path.exists(file_name): 317 self.write_batch_output(data=data, file_name=file_name, 318 details=details) 319 self.deplay_in_external_app(data=data, file_name=file_name, 320 plugin_name=plugin_name) 321 322 def write_batch_output(self, data, file_name, details=""): 306 frame.Show(True) 307 308 def open_with_localapp(self, data): 309 """ 310 Display value of data into the application grid 311 :param data: dictionary of string and list of items 312 """ 313 self.batch_frame.set_data(data) 314 self.batch_frame.Show(True) 315 316 def write_batch_tofile(self, data, file_name, details=""): 323 317 """ 324 318 Helper to write result from batch into cvs file 325 319 """ 326 320 self._default_save_location = os.path.dirname(file_name) 321 file_name = os.path.basename(file_name) 327 322 if data is None or file_name is None or file_name.strip() == "": 328 323 return … … 357 352 fd.close() 358 353 359 def deplay_in_external_app(self, data, file_name, plugin_name):354 def open_with_externalapp(self, data, file_name, details=""): 360 355 """ 361 356 Display data in the another application , by default Excel 362 357 """ 358 if not os.path.exists(file_name): 359 self.write_batch_tofile(data=data, file_name=file_name, 360 details=details) 363 361 try: 364 362 from win32com.client import Dispatch
Note: See TracChangeset
for help on using the changeset viewer.