Changeset ef63dd9 in sasview


Ignore:
Timestamp:
Feb 1, 2018 4:30:37 PM (7 years ago)
Author:
krzywon
Children:
9592c6f
Parents:
b6f9c9f
Message:

Throw error without attempting to load in deprecated files.

File:
1 edited

Legend:

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

    rdc8d1c2 ref63dd9  
    5454        self.wildcards = ['All (*.*)|*.*'] 
    5555 
     56        # Deprecated extensions 
     57        self.deprecated_extensions = ['.asc', '.ASC', '.nxs', '.NXS'] 
     58 
    5659        # Creation time, for testing 
    5760        self._created = time.time() 
     
    7376        # Gets set to a string if the file has an associated reader that fails 
    7477        msg_from_reader = None 
     78        extlist = [ext for ext in self.deprecated_extensions if path.endswith(ext)] 
     79        if extlist: 
     80            msg = ("\rThe file you are attempting to load, {}, is no " 
     81                   "longer loadable into SasView. Please use data in Q space." 
     82                   .format(path)) 
     83            raise RuntimeError(msg) 
    7584        try: 
    7685            return super(Registry, self).load(path, format=format) 
Note: See TracChangeset for help on using the changeset viewer.