Changes in / [c721b1a:26c9b85] in sasview


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

Legend:

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

    rb9b612a rb699768  
    3131from readers import ascii_reader 
    3232from readers import cansas_reader 
    33 from readers import cansas_reader_HDF5 
    3433 
    3534class Registry(ExtensionRegistry): 
     
    6261            of a particular reader 
    6362 
    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. 
    6666        """ 
    6767        try: 
    6868            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) 
    9077 
    9178    def find_plugins(self, dir): 
  • src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py

    rd0764bf rbbd0f37  
    5353    ext = ['.h5', '.H5'] 
    5454    ## Flag to bypass extension check 
    55     allow_all = True 
     55    allow_all = False 
    5656    ## List of files to return 
    5757    output = None 
Note: See TracChangeset for help on using the changeset viewer.