Changeset 4a8d55c in sasview for src


Ignore:
Timestamp:
Mar 27, 2018 10:05:36 AM (6 years ago)
Author:
krzywon
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, unittest-saveload
Children:
63ddc03
Parents:
2924532
Message:

Propagate through loader when errors are thrown regardless of the error. Add tests using the same file with different extensions (including deprecated extensions).

Location:
src/sas/sascalc/dataloader
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/file_reader_base_class.py

    r2924532 r4a8d55c  
    3434                       "t not be fully reduced. Support for the reader associat" 
    3535                       "ed with this file type has been removed. An attempt to " 
    36                        "load the file was made, however, even if a data set was" 
    37                        " generated, SasView cannot guarantee the accuracy of th" 
    38                        "e data.") 
     36                       "load the file was made, but, should it be successful, " 
     37                       "SasView cannot guarantee the accuracy of the data.") 
    3938 
    4039class FileReader(object): 
  • src/sas/sascalc/dataloader/loader.py

    rdc8d1c2 r4a8d55c  
    9090            ascii_loader = ascii_reader.Reader() 
    9191            return ascii_loader.read(path) 
     92        except NoKnownLoaderException: 
     93            pass  # Try the Cansas XML reader 
    9294        except DefaultReaderException: 
    9395            pass  # Loader specific error to try the cansas XML reader 
     
    100102            cansas_loader = cansas_reader.Reader() 
    101103            return cansas_loader.read(path) 
     104        except NoKnownLoaderException: 
     105            pass  # Try the NXcanSAS reader 
    102106        except DefaultReaderException: 
    103107            pass  # Loader specific error to try the NXcanSAS reader 
Note: See TracChangeset for help on using the changeset viewer.