Ignore:
Timestamp:
Jul 14, 2016 7:01:17 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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
af84162
Parents:
8b633dd
Message:

Fix bug when convert button clicked for a 2nd time after changing metadata

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/file_converter/converter_panel.py

    r8b633dd r3331e11  
    111111            run = self.metadata['run'] 
    112112            run_name = self.metadata['run_name'] 
    113             self.metadata['run'] = [run] 
    114             if run_name is not None: 
    115                 self.metadata['run_name'] = { run: run_name } 
     113 
     114            if not isinstance(run, list) and run is not None: 
     115                self.metadata['run'] = [run] 
    116116            else: 
    117                 self.metadata['run_name'] = {} 
     117                run = run[0] 
     118 
     119            if not isinstance(run_name, dict): 
     120                if run_name is not None: 
     121                    self.metadata['run_name'] = { run: run_name } 
     122                else: 
     123                    self.metadata['run_name'] = {} 
     124            else: 
     125                self.metadata['run_name'][run] = run_name.values()[0] 
    118126        else: 
    119127            self.metadata['run'] = [] 
    120128            self.metadata['run_name'] = {} 
    121         detector = self.metadata['detector'][0] 
    122         if detector.name is None: 
     129        if self.metadata['detector'][0].name is None: 
    123130            self.metadata['detector'][0].name = '' 
    124131 
Note: See TracChangeset for help on using the changeset viewer.