Changeset f118fe2f in sasview for DataLoader


Ignore:
Timestamp:
Oct 20, 2010 6:04:42 PM (14 years ago)
Author:
Jae Cho <jhjcho@…>
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:
fb59ed9
Parents:
85bb870
Message:

added cansa reader in addition to ascii reader when an error araised

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DataLoader/loader.py

    r733e90b rf118fe2f  
    3232# Default readers are defined in the readers sub-module 
    3333import readers 
    34 from readers import ascii_reader 
     34from readers import ascii_reader,cansas_reader 
    3535 
    3636class Registry(ExtensionRegistry): 
     
    7676            return super(Registry, self).load(path, format=format) 
    7777        except: 
    78             # No reader was found. Default to the ascii reader. 
    79             ascii_loader = ascii_reader.Reader() 
    80             return ascii_loader.read(path) 
    81          
     78            try: 
     79                # No reader was found. Default to the ascii reader. 
     80                ascii_loader = ascii_reader.Reader() 
     81                return ascii_loader.read(path) 
     82            except: 
     83                cansas_loader = cansas_reader.Reader() 
     84                return cansas_loader.read(path) 
    8285    def find_plugins(self, dir): 
    8386        """ 
Note: See TracChangeset for help on using the changeset viewer.