Changeset 4238

Show
Ignore:
Timestamp:
07/02/07 13:59:39 (6 years ago)
Author:
DrewCormier
Message:

wd now generates a setup.py file with waveforms for easier waveform installation

Location:
WaveDev/trunk/WaveDev/wavedev
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • WaveDev/trunk/WaveDev/wavedev/MainFrame.py

    r4225 r4238  
    13861386        xml_gen.genxml(copy.deepcopy(self.active_wave.components),self.path,self.active_wave.name) 
    13871387        xml_gen.genDAS(copy.deepcopy(self.active_wave.components),self.path,self.active_wave.name) 
    1388  
     1388        xml_gen.writeWaveSetuppy(self.path, self.active_wave.name)      
     1389   
    13891390        #save the .owd file  
    13901391        f = open(self.path + "/" + self.waveName +  "/" + self.waveName + ".owd",'w') 
  • WaveDev/trunk/WaveDev/wavedev/XML_gen/application_gen.py

    r4221 r4238  
    406406    # Remove temporary files 
    407407    os.remove(path + '.' + outputFilename_dcd + '.tmp') 
     408 
     409 
     410 
     411def writeWaveSetuppy(wavePath,waveName): 
     412    ''' 
     413    ##############################################################################  
     414    ## writeWaveSetuppy - generates the setup.py file for a waveform 
     415    ############################################################################## 
     416    ''' 
     417 
     418    if wavePath[len(wavePath)-1] != '/': 
     419        wavePath = wavePath + '/' + waveName 
     420 
     421    #copy over the readme file 
     422    shutil.copy('XML_gen/README', wavePath) 
     423  
     424    output = open(wavePath + '/setup.py','w') 
     425    ts = "\ 
     426#! /usr/bin/env python\n\ 
     427\n\ 
     428from distutils.core import setup\n\ 
     429import sys\n\ 
     430\n\ 
     431install_location = '/sdr/'\n\ 
     432\n\ 
     433if len(sys.argv) != 2:\n\ 
     434        sys.exit(1)\n\ 
     435\n\ 
     436sys.argv.append('--install-lib='+install_location)\n\n" 
     437    output.writelines(ts) 
     438 
     439    ts = "setup(name='" + waveName + "', description='" + waveName + "',data_files=[(install_location+'waveforms/" + waveName + "',['" + waveName + ".sad.xml', '" + waveName + "_DAS.xml'])])" 
     440    output.writelines(ts)    
     441 
     442    output.close()   #done creating the file 
     443