Changeset 88e289c in sasview


Ignore:
Timestamp:
Apr 9, 2009 7:45:30 PM (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:
d508be9
Parents:
9181512
Message:

Modified the file extension associations for release 1.0. Modified the loader to default to the n-col ascii reader when no reader is found.

Location:
DataLoader
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • DataLoader/loader.py

    r07f8d9a r88e289c  
    3333# Default readers are defined in the readers sub-module 
    3434import readers 
     35from readers import ascii_reader 
    3536 
    3637class Registry(ExtensionRegistry): 
     
    6162        self.find_plugins('plugins') 
    6263 
     64         
     65    def load(self, path, format=None): 
     66        """ 
     67            Call the loader for the file type of path. 
     68     
     69            @param path: file path 
     70            @param format: explicit extension, to force the use of a particular reader 
     71     
     72            Defaults to the ascii (multi-column) reader 
     73            if no reader was registered for the file's 
     74            extension.    
     75        """ 
     76        try: 
     77            return super(Registry, self).load(path, format=format) 
     78        except: 
     79            # No reader was found. Default to the ascii reader. 
     80            ascii_loader = ascii_reader.Reader() 
     81            return ascii_loader.read(path) 
    6382         
    6483    def find_plugins(self, dir): 
  • DataLoader/readers/defaults.xml

    r28caa03 r88e289c  
    44    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    55    > 
    6         <FileType extension='.abs' reader='abs_reader'/> 
    7         <FileType extension='.abs' reader='ascii_reader'/> 
    86         
    9         <FileType extension='.txt' reader='ascii_reader'/> 
    10         <FileType extension='.dat' reader='ascii_reader'/> 
    11  
    127        <FileType extension='.xml' reader='cansas_reader'/> 
    13          
    14         <FileType extension='.sans' reader='danse_reader'/> 
    15          
    16         <FileType extension='.d1d' reader='hfir1d_reader'/> 
    17          
    18         <FileType extension='.asc' reader='IgorReader'/> 
    19          
    20         <FileType extension='.tif' reader='tiff_reader'/> 
    21         <FileType extension='.tiff' reader='tiff_reader'/> 
    228     
    239</SansLoader> 
Note: See TracChangeset for help on using the changeset viewer.