Changeset 850525c in sasview for sansguiframe/src/sans/guiframe/data_processor.py
- Timestamp:
- Sep 9, 2011 5:24:12 PM (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:
- 06772f6
- Parents:
- 6446f87
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansguiframe/src/sans/guiframe/data_processor.py
r73197d0 r850525c 6 6 import math 7 7 import re 8 import os 8 9 import sys 9 10 import copy … … 625 626 Allow to select where the result of batch will be displayed or stored 626 627 """ 627 def __init__(self, parent=None, data=None, *args, **kwds): 628 def __init__(self, parent=None, data=None, file_name="", 629 details="", *args, **kwds): 628 630 """ 629 631 :param parent: Window instantiating this dialog … … 631 633 application. 632 634 """ 633 kwds['style'] = wx.CAPTION|wx.SYSTEM_MENU635 #kwds['style'] = wx.CAPTION|wx.SYSTEM_MENU 634 636 wx.Dialog.__init__(self, parent, *args, **kwds) 635 637 self.parent = parent 638 self.file_name = file_name 639 self.details = details 636 640 self.data = data 637 641 self.flag = 1 … … 667 671 self.external_app_selected.SetValue(False) 668 672 self.save_to_file.SetValue(False) 669 670 673 button_OK = wx.Button(self, wx.ID_OK, "Ok") 671 674 button_OK.SetFocus() … … 700 703 """ 701 704 if self.save_to_file.GetValue(): 702 self.flag = 3 703 if self.parent is not None and self.data is not None: 704 self.parent.save_batch_into_file(self.data) 705 elif self.local_app_selected.GetValue(): 705 reader, ext = os.path.splitext(self.file_name) 706 path = None 707 location = os.getcwd() 708 if self.parent is not None: 709 location = self.parent._default_save_location 710 dlg = wx.FileDialog(self, "Save Project file", 711 location, self.file_name, ext, wx.SAVE) 712 path = None 713 if dlg.ShowModal() == wx.ID_OK: 714 path = dlg.GetPath() 715 if self.parent is not None: 716 self.parent._default_save_location = os.path.dirname(path) 717 dlg.Destroy() 718 if path != None: 719 if self.parent is not None and self.data is not None: 720 self.parent.write_batch_output(data=self.data, 721 file_name=path, 722 details=self.details) 723 724 if self.local_app_selected.GetValue(): 706 725 self.flag = 1 707 726 else: 708 727 self.flag = 2 709 728 return self.flag 729 730 def save_file(self): 731 """ 732 Save inot file 733 """ 734 710 735 711 736
Note: See TracChangeset
for help on using the changeset viewer.