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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.