Ignore:
Timestamp:
Oct 25, 2017 3:46:56 AM (7 years ago)
Author:
krzywon
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
fe15198
Parents:
5582b078
Message:

Reset file reader class data state each time a new data file is loaded.

File:
1 edited

Legend:

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

    r9e6aeaf r61f329f0  
    5454        :param filepath: The full or relative path to a file to be loaded 
    5555        """ 
     56        self.reset_state() 
    5657        if os.path.isfile(filepath): 
    5758            basename, extension = os.path.splitext(os.path.basename(filepath)) 
     
    8687        # Return a list of parsed entries that data_loader can manage 
    8788        return self.output 
     89 
     90    def reset_state(self): 
     91        """ 
     92        Resets the class state to a base case when loading a new data file so previous 
     93        data files do not appear a second time 
     94        """ 
     95        self.current_datainfo = None 
     96        self.current_dataset = None 
     97        self.output = [] 
    8898 
    8999    def nextline(self): 
Note: See TracChangeset for help on using the changeset viewer.