Changeset da8bb53 in sasview for src/sas/sascalc/dataloader/loader.py
- Timestamp:
- Apr 17, 2017 2:30:10 PM (7 years ago)
- 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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- ad92c5a
- Parents:
- 8ffafd1
- git-author:
- Jeff Krzywon <krzywon@…> (04/17/17 14:30:10)
- git-committer:
- krzywon <krzywon@…> (04/17/17 14:30:10)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/loader.py
r278ddee rda8bb53 25 25 import logging 26 26 import time 27 import mimetypes 27 28 from zipfile import ZipFile 28 29 from sas.sascalc.data_util.registry import ExtensionRegistry 29 30 # Default readers are defined in the readers sub-module 30 31 import readers 31 from loader_exceptions import NoKnownLoaderException, FileContentsException 32 from loader_exceptions import NoKnownLoaderException, FileContentsException,\ 33 DefaultReaderException 32 34 from readers import ascii_reader 33 35 from readers import cansas_reader … … 75 77 ascii_loader = ascii_reader.Reader() 76 78 return ascii_loader.read(path) 77 except FileContentsException:78 pass # try the cansas XML reader79 except DefaultReaderException: 80 pass # Loader specific error to try the cansas XML reader 79 81 try: 80 82 cansas_loader = cansas_reader.Reader() 81 83 return cansas_loader.read(path) 84 except DefaultReaderException: 85 pass # Loader specific error to try the cansas NeXuS reader 82 86 except FileContentsException: 83 pass # try the cansas NeXuS reader 87 # TODO: Handle errors properly 88 pass 89 except Exception as csr: 90 # TODO: Modify cansas reader to throw DefaultReaderException 91 pass 84 92 try: 85 93 cansas_nexus_loader = cansas_reader_HDF5.Reader() 86 94 return cansas_nexus_loader.read(path) 87 except FileContentsException:95 except DefaultReaderException: 88 96 logging.errors("No default loader can load the data") 89 97 # No known reader available. Give up and throw an error … … 92 100 msg += "Traceback:\n%s" % e.message 93 101 raise NoKnownLoaderException, msg 102 except FileContentsException: 103 # TODO: Handle error(s) properly 104 pass 94 105 95 106 def find_plugins(self, dir):
Note: See TracChangeset
for help on using the changeset viewer.