Changes in / [c721b1a:26c9b85] in sasview
- Location:
- src/sas/sascalc/dataloader
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/loader.py
rb9b612a rb699768 31 31 from readers import ascii_reader 32 32 from readers import cansas_reader 33 from readers import cansas_reader_HDF534 33 35 34 class Registry(ExtensionRegistry): … … 62 61 of a particular reader 63 62 64 Defaults to the ascii (multi-column), cansas XML, and cansas NeXuS 65 readers if no reader was registered for the file's extension. 63 Defaults to the ascii (multi-column) reader 64 if no reader was registered for the file's 65 extension. 66 66 """ 67 67 try: 68 68 return super(Registry, self).load(path, format=format) 69 except Exception: 70 pass # try the ASCII reader 71 try: 72 ascii_loader = ascii_reader.Reader() 73 return ascii_loader.read(path) 74 except Exception: 75 pass # try the cansas XML reader 76 try: 77 cansas_loader = cansas_reader.Reader() 78 return cansas_loader.read(path) 79 except Exception: 80 pass # try the cansas NeXuS reader 81 try: 82 cansas_nexus_loader = cansas_reader_HDF5.Reader() 83 return cansas_nexus_loader.read(path) 84 except Exception: 85 # No known reader available. Give up and throw an error 86 msg = "\n\tUnknown data format: %s.\n\tThe file is not a " % path 87 msg += "known format for SasView. The most common formats are " 88 msg += "multi-column ASCII, CanSAS XML, and CanSAS NeXuS." 89 raise Exception(msg) 69 except: 70 try: 71 # No reader was found. Default to the ascii reader. 72 ascii_loader = ascii_reader.Reader() 73 return ascii_loader.read(path) 74 except: 75 cansas_loader = cansas_reader.Reader() 76 return cansas_loader.read(path) 90 77 91 78 def find_plugins(self, dir): -
src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py
rd0764bf rbbd0f37 53 53 ext = ['.h5', '.H5'] 54 54 ## Flag to bypass extension check 55 allow_all = True55 allow_all = False 56 56 ## List of files to return 57 57 output = None
Note: See TracChangeset
for help on using the changeset viewer.