Changeset 9d6d5ba in sasview for src/sans/guiframe


Ignore:
Timestamp:
Apr 4, 2014 3:22:38 PM (11 years ago)
Author:
pkienzle
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:
49d019c
Parents:
da5d8e8
Message:

code cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sans/guiframe/data_manager.py

    r5777106 r9d6d5ba  
    6565            new_plot = Data1D(x=[], y=[], dx=None, dy=None) 
    6666            
    67         new_plot.copy_from_datainfo(data)  
    68         data.clone_without_data(clone=new_plot)   
     67        new_plot.copy_from_datainfo(data) 
     68        data.clone_without_data(clone=new_plot) 
    6969        #creating a name for data 
    70         name = "" 
    7170        title = "" 
    72         file_name = "" 
    73         if path is not None: 
    74             file_name = os.path.basename(path) 
    75         if file_name == "": 
    76             file_name = data.filename 
    77         if data.run: 
    78             run_num = data.run[0] 
    79         name = file_name 
    80         if name == "": 
    81             name = run_num 
     71        file_name = os.path.basename(path) if path is not None else data.filename 
     72        if file_name: 
     73            name = file_name 
     74        elif data.run: 
     75            name = data.run[0] 
     76        else: 
     77            name = "data" 
    8278        name = self.rename(name) 
    8379        #find title 
Note: See TracChangeset for help on using the changeset viewer.