Changeset cc1ead1 in sasview


Ignore:
Timestamp:
May 17, 2010 9:48:29 AM (15 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:
4708f3a
Parents:
c1d2af4
Message:

remove thread when loading

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guiframe/data_loader.py

    rd792e813 rcc1ead1  
    139139    wx.PostEvent(parent, StatusEvent(status="Load cancel..", info="warning", 
    140140                                                type="stop")) 
     141     
    141142def plot_data(parent, path): 
    142143    """ 
     
    144145        @param path: the path of the data to load 
    145146    """ 
    146     #Load data 
    147     from load_thread import DataReader 
    148     if parent is not None: 
    149         wx.PostEvent(parent, StatusEvent(status="Loading...", info="info", 
    150                                             type="progress")) 
    151         reader = DataReader(path=path, 
    152                              parent=parent, 
    153                              err_fct=load_error, 
    154                              msg_fct=on_load_error, 
    155                             completefn=complete_loading) 
    156         reader.queue() 
     147    from sans.guicomm.events import NewPlotEvent, StatusEvent 
     148    from DataLoader.loader import  Loader 
    157149    
    158 def complete_loading(output, path, parent): 
     150    # Instantiate a loader  
     151    L = Loader() 
     152     
     153    # Load data  
     154    try: 
     155        output = L.load(path) 
     156    except: 
     157        load_error(sys.exc_value) 
     158        return 
     159     
    159160    # Notify user if the loader completed the load but no data came out 
    160161    if output == None: 
    161         msg = "The data file appears to be empty." 
    162         load_error(msg) 
    163         wx.PostEvent(parent, StatusEvent(status=msg, info="warning", 
    164                                             type="stop")) 
     162        load_error("The data file appears to be empty.") 
    165163        return 
    166      
     164   
     165      
    167166    filename = os.path.basename(path) 
    168167     
     
    277276            wx.PostEvent(parent, NewPlotEvent(plot=new_plot, title=str(title))) 
    278277            i+=1 
    279             
    280              
     278          
Note: See TracChangeset for help on using the changeset viewer.