| | 408 | |
| | 409 | |
| | 410 | |
| | 411 | def 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\ |
| | 428 | from distutils.core import setup\n\ |
| | 429 | import sys\n\ |
| | 430 | \n\ |
| | 431 | install_location = '/sdr/'\n\ |
| | 432 | \n\ |
| | 433 | if len(sys.argv) != 2:\n\ |
| | 434 | sys.exit(1)\n\ |
| | 435 | \n\ |
| | 436 | sys.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 | |