Changeset 1ed9c57 in sasview


Ignore:
Timestamp:
Sep 14, 2008 9:13:26 AM (16 years ago)
Author:
Mathieu Doucet <doucetm@…>
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.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
c7bc3e7
Parents:
fa5908de
Message:

Added wildcards list to data loader

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DataLoader/loader.py

    r84545dd r1ed9c57  
    3232        ## Writers 
    3333        self.writers = {} 
     34         
     35        ## List of wildcards 
     36        self.wildcards = ['All (*.*)|*.*'] 
    3437         
    3538        ## Creation time, for testing 
     
    6871                            readers_found += 1 
    6972                    except : 
    70                         logging.error("Loader: Error importing %s\n  %s" % (name, sys.exc_value)) 
     73                        logging.error("Loader: Error importing %s\n  %s" % (item, sys.exc_value)) 
    7174                             
    7275                # Process zip files 
     
    112115                    self.loaders[ext].insert(0,loader.read) 
    113116                    reader_found = True 
    114                       
     117                         
     118                    # Keep track of wildcards 
     119                    for wcard in loader.type: 
     120                        if wcard not in self.wildcards: 
     121                            self.wildcards.append(wcard) 
     122                             
    115123                # Check whether writing is supported 
    116124                if hasattr(loader, 'write'): 
     
    210218        return self.__registry.find_plugins(dir) 
    211219     
     220    def get_wildcards(self): 
     221        return self.__registry.wildcards 
    212222         
    213223if __name__ == "__main__":  
     
    218228    l = Loader() 
    219229    data = l.load('test/cansas1d.xml') 
    220     l.save('test_file.xml', data) 
    221          
    222          
    223      
     230    l.save('test_file.xml', data, '.xml') 
     231     
     232    print l.get_wildcards() 
     233         
     234         
     235     
Note: See TracChangeset for help on using the changeset viewer.