Changeset 70308f6c in sasview


Ignore:
Timestamp:
Aug 15, 2016 10:01:36 AM (8 years ago)
Author:
lewis
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:
fa1cbee
Parents:
cba0c77
Message:

Fix error message shown when loading folder fails (fixes #614)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/local_perspectives/data_loader/data_loader.py

    rcba0c77 r70308f6c  
    173173        log_msg = '' 
    174174        output = {} 
    175         any_error = False 
    176175        data_error = False 
    177176        error_message = "" 
    178177 
    179178        for p_file in path: 
     179            file_error = False 
    180180            info = "info" 
    181181            basename = os.path.basename(p_file) 
    182182            _, extension = os.path.splitext(basename) 
    183183            if extension.lower() in EXTENSIONS: 
    184                 any_error = True 
    185184                info = "error" 
    186185                log_msg = "Data Loader cannot " 
     
    211210            except: 
    212211                logging.error(sys.exc_value) 
    213                 any_error = True 
    214             if any_error: 
     212                file_error = True 
     213            if file_error: 
    215214                error = "Error: " + str(sys.exc_info()[1]) 
    216215                error += " while loading file: %s" % str(basename) 
     
    228227                info = "error" 
    229228 
    230         if any_error or error_message: 
     229        if error_message != "": 
    231230            self.load_update(output=output, message=error_message, info=info) 
    232231        else: 
Note: See TracChangeset for help on using the changeset viewer.