Changeset 3a5f7c8 in sasview for src


Ignore:
Timestamp:
Jul 1, 2015 4:44:53 PM (9 years ago)
Author:
Doucet, Mathieu <doucetm@…>
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:
f21d496, 686fd10
Parents:
0e33a8d
Message:

Fix errors from loading data file with "process" information

Location:
src/sas
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/dataloader/data_info.py

    r6987c8a r3a5f7c8  
    439439        self.notes = [] 
    440440 
     441    def is_empty(self): 
     442        """ 
     443            Return True if the object is empty 
     444        """ 
     445        return len(self.name) == 0 and len(self.date) == 0 and len(self.description) == 0 \ 
     446            and len(self.term) == 0 and len(self.notes) == 0 
     447             
     448    def single_line_desc(self): 
     449        """ 
     450            Return a single line string representing the process 
     451        """ 
     452        return "%s %s %s" % (self.name, self.date, self.description) 
     453      
    441454    def __str__(self): 
    442455        _str = "Process:\n" 
  • src/sas/guiframe/data_panel.py

    rf22d219 r3a5f7c8  
    686686                        self.tree_ctrl.DeleteChildren(d_p_c)  
    687687                        for process in process_list: 
    688                             _ = self.tree_ctrl.AppendItem(d_p_c, 
    689                                                               process.__str__()) 
     688                            if not process.is_empty(): 
     689                                _ = self.tree_ctrl.AppendItem(d_p_c, 
     690                                                              process.single_line_desc()) 
    690691                wx.CallAfter(self.append_theory, state_id, theory_list) 
    691692            # Sort by data name 
Note: See TracChangeset for help on using the changeset viewer.