Changeset 8cb8c89 in sasview


Ignore:
Timestamp:
May 11, 2011 1:56:49 PM (14 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:
732b03c
Parents:
99f9ecf
Message:

pop error message when error occur on read file

Location:
guiframe
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • guiframe/data_panel.py

    r99f9ecf r8cb8c89  
    570570        :param error: details error message to be displayed 
    571571        """ 
    572         message = "The data file you selected could not be loaded.\n" 
    573         message += "Make sure the content of your file" 
    574         message += " is properly formatted.\n\n" 
    575          
    576         if error is not None: 
    577             message += "When contacting the DANSE team, mention the" 
    578             message += " following:\n%s" % str(error) 
    579         dial = wx.MessageDialog(self.parent, message, 'Error Loading File', 
     572        if error is not None or str(error).strip() != "": 
     573            dial = wx.MessageDialog(self.parent, str(error), 'Error Loading File', 
    580574                                wx.OK | wx.ICON_EXCLAMATION) 
    581         dial.ShowModal()   
     575            dial.ShowModal()   
    582576         
    583577    def _load_data(self, event): 
     
    643637                self.load_update(output=output, message=message) 
    644638            except: 
    645                 error_message = "Error while loading Data: %s\n" % str(p_file) 
    646                 error_message += str(sys.exc_value) + "\n" 
     639                error = "Error while loading Data: %s\n" % str(p_file) 
     640                error += str(sys.exc_value) + "\n" 
     641                error_message = "The data file you selected could not be loaded.\n" 
     642                error_message += "Make sure the content of your file" 
     643                error_message += " is properly formatted.\n\n" 
     644                error_message += "When contacting the DANSE team, mention the" 
     645                error_message += " following:\n%s" % str(error) 
    647646                self.load_update(output=output, message=error_message) 
    648647                 
  • guiframe/gui_manager.py

    r87f4dcc r8cb8c89  
    17261726                        new_plot.group_id = self.panel_on_focus.group_id 
    17271727                    else: 
    1728                         message = "Only 1D Data can be append to plot panel\n" 
    1729                         message += "%s will be plot separetly\n" %str(new_plot.name) 
     1728                        message = "Only 1D Data can be append to" 
     1729                        message += " plot panel containing 1D data.\n" 
     1730                        message += "%s not be appended.\n" %str(new_plot.name) 
     1731                        message += "try new plot option.\n" 
    17301732                        wx.PostEvent(self, StatusEvent(status=message,  
    17311733                                                   info='warning')) 
     
    17331735                #if not append then new plot 
    17341736                from sans.guiframe.dataFitting import Data2D 
    1735                 if (Data2D, new_plot.__class__): 
     1737                if issubclass(Data2D, new_plot.__class__): 
    17361738                    #for 2 D always plot in a separated new plot 
    17371739                    new_plot.group_id = wx.NewId() 
  • guiframe/local_perspectives/data_loader/data_loader.py

    r99f9ecf r8cb8c89  
    158158        :param error: details error message to be displayed 
    159159        """ 
    160         message = "The data file you selected could not be loaded.\n" 
    161         message += "Make sure the content of your file" 
    162         message += " is properly formatted.\n\n" 
    163          
    164         if error is not None: 
    165             message += "When contacting the DANSE team, mention the" 
    166             message += " following:\n%s" % str(error) 
    167         dial = wx.MessageDialog(self.parent, message, 'Error Loading File', 
     160        if error is not None or str(error).strip() != "": 
     161            dial = wx.MessageDialog(self.parent, str(error), 'Error Loading File', 
    168162                                wx.OK | wx.ICON_EXCLAMATION) 
    169         dial.ShowModal()   
     163            dial.ShowModal()   
    170164         
    171165    def get_file_path(self, path): 
     
    208202                self.load_update(output=output, message=message) 
    209203            except: 
    210                 error_message = "Error while loading Data: %s\n" % str(p_file) 
    211                 error_message += str(sys.exc_value) + "\n" 
    212                 self.load_update(output=output, message=error_message) 
     204                 error = "Error while loading Data: %s\n" % str(p_file) 
     205                 error += str(sys.exc_value) + "\n" 
     206                 error_message = "The data file you selected could not be loaded.\n" 
     207                 error_message += "Make sure the content of your file" 
     208                 error_message += " is properly formatted.\n\n" 
     209                 error_message += "When contacting the DANSE team, mention the" 
     210                 error_message += " following:\n%s" % str(error) 
     211                 self.load_update(output=output, message=error_message) 
    213212                 
    214213        message = "Loading Data Complete! " 
Note: See TracChangeset for help on using the changeset viewer.