Changeset 7b48b08 in sasview


Ignore:
Timestamp:
Oct 13, 2011 4:38:17 PM (13 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
9bfa73f
Parents:
2ada16c
Message:

make sure error is handle when no data is available on the grid to view in excel or save

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansguiframe/src/sans/guiframe/data_processor.py

    r9400de6 r7b48b08  
    10741074            pos = self.panel.notebook.GetSelection() 
    10751075            grid = self.panel.notebook.GetPage(pos) 
     1076            if grid.file_name is None or grid.file_name.strip() == "" or \ 
     1077                grid.data is None or len(grid.data) == 0: 
     1078                name = self.panel.notebook.GetPageText(pos) 
     1079                msg = " %s has not data to save" % str(name) 
     1080                wx.PostEvent(self.parent,  
     1081                             StatusEvent(status=msg, info="error"))  
     1082            
     1083                return 
    10761084            reader, ext = os.path.splitext(grid.file_name) 
    10771085            path = None 
     
    11061114            grid = self.panel.notebook.GetPage(pos) 
    11071115            data = grid.get_grid_view() 
     1116            if grid.file_name is None or grid.file_name.strip() == "" or \ 
     1117                grid.data is None or len(grid.data) == 0: 
     1118                name = self.panel.notebook.GetPageText(pos) 
     1119                msg = " %s has not data to open on excel" % str(name) 
     1120                wx.PostEvent(self.parent,  
     1121                             StatusEvent(status=msg, info="error"))  
     1122            
     1123                return 
    11081124            self.parent.open_with_externalapp(data=data, 
    11091125                                               file_name=grid.file_name,  
Note: See TracChangeset for help on using the changeset viewer.