Changeset 3ece5dd in sasview for src/sas/sascalc/data_util
- Timestamp:
- Jul 26, 2017 6:31:27 AM (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:
- bc570f4
- Parents:
- 371b9e2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/data_util/registry.py
r5d8f9b3 r3ece5dd 26 26 registry['.tar.gz'] = untar 27 27 28 # Generic extensions to use after trying more specific extensions; 28 # Generic extensions to use after trying more specific extensions; 29 29 # these will be checked after the more specific extensions fail. 30 30 registry['.gz'] = gunzip … … 92 92 """ 93 93 Return the loader associated with the file type of path. 94 94 95 95 :param path: Data file path 96 96 :raises ValueError: When no loaders are found for the file. 97 97 :return: List of available readers for the file extension 98 """ 98 """ 99 99 # Find matching extensions 100 100 extlist = [ext for ext in self.extensions() if path.endswith(ext)] … … 135 135 except KeyError as e: 136 136 pass 137 last_exc = None 137 138 for fn in loaders: 138 139 try: 139 140 return fn(path) 140 141 except Exception as e: 142 last_exc = e 141 143 pass # give other loaders a chance to succeed 142 144 # If we get here it is because all loaders failed 145 if last_exc is not None and len(loaders) != 0: 146 # If file has associated loader(s) and they;ve failed 147 raise last_exc 143 148 raise NoKnownLoaderException(e.message) # raise generic exception
Note: See TracChangeset
for help on using the changeset viewer.