Changeset 4468

Show
Ignore:
Timestamp:
07/19/07 14:24:36 (6 years ago)
Author:
DrewCormier
Message:

fixed indentation so that I will look for more than one sad file in each directory (e.g., the waveform directory before sud dirs). will now only look in /sdr/dom/waveforms for sadd files instead of all of /sdr

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • experimental/ALF/trunk/alf/ALF.py

    r4467 r4468  
    446446        self.availableWaveforms.clear() 
    447447        installRoot = self.installBox.AddRoot("install_root") 
    448          
    449         for dirpath, dirnames, filenames in os.walk(self.installpath): 
     448 
     449        for dirpath, dirnames, filenames in os.walk(self.installpath +  
     450                                                    "/dom/waveforms"): 
    450451            sad_file = None 
    451452            das_file = None 
    452453            for fname in filenames: 
    453454                if fname.find(".sad.xml") != -1: 
    454                     # make sure that the '.sad.xml' comes at the end of the file name 
     455                    # make sure that the '.sad.xml' comes at the end of the  
     456                    # file name 
    455457                    if fname[-8:] == ".sad.xml":     
    456458                        sad_file = fname 
     459  
    457460                        full_sad_file = dirpath + "/" + fname 
    458                         # for framework > r2983, assume DAS file has the same waveform 
    459                         # name as the sad file, and assume that both files are in the  
    460                         # same directory.  similar to c_wavLoader. 
     461                        # for framework > r2983, assume DAS file has the same  
     462                        # waveform name as the sad file, and assume that both 
     463                        # files are in the same directory.  similar to  
     464                        # c_wavLoader. 
    461465                        das_file = fname.replace(".sad.xml", "_DAS.xml") 
    462466                        full_das_file = dirpath + "/" + das_file 
    463  
    464                 # for framework <= r2983: 
    465                 # if fname.find("_DAS.xml") != -1: 
    466                 #     # make sure that the '_DAS.xml' comes at the end of the file name 
    467                 #     if fname[-8:] == "_DAS.xml":     
    468                 #         das_file = fname 
    469                 #         full_das_file = dirpath + "/" + fname 
    470             
    471             wavename = sad_file[:-8] 
    472             if self.availableWaveforms.has_key(wavename): 
    473                 errorMsg(self, "Conflicting waveform name: " + wavename) 
    474                 continue 
    475467                
    476             self.availableWaveforms[wavename] = (sad_file, full_sad_file, das_file, full_das_file) 
     468                        wavename = sad_file[:-8] 
     469 
     470                        if self.availableWaveforms.has_key(wavename): 
     471                            # if this condition occurs, will leave the current 
     472                            # directory and continue to the other directories  
     473                            # I'm walking aroud in 
     474                            errorMsg(self, "Conflicting waveform name: "  
     475                                     + wavename) 
     476                            continue 
     477                
     478                        self.availableWaveforms[wavename] = (sad_file,  
     479                                                             full_sad_file, 
     480                                                             das_file,  
     481                                                             full_das_file) 
    477482 
    478483        # Populate the display at the Domain level