diff options
-rwxr-xr-x | faust2axo.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/faust2axo.py b/faust2axo.py index b9cbc55..5bf09a1 100755 --- a/faust2axo.py +++ b/faust2axo.py @@ -3,6 +3,7 @@ import sys import argparse import subprocess +import tempfile import uuid import xml.etree.ElementTree as ET @@ -136,15 +137,15 @@ def massage_output(oldfile, newfile, xml): def main(faust_input_file, axo_output_file): - axo_temp_output_file = axo_output_file + ".temp" - run_faust(faust_input_file, axo_temp_output_file) + with tempfile.NamedTemporaryFile() as temp: + run_faust(faust_input_file, temp.name) - # Parse generated XML description - dsp_xml = faust_input_file + ".xml" - xml = ET.parse(dsp_xml).getroot() + # Parse generated XML description + dsp_xml = faust_input_file + ".xml" + xml = ET.parse(dsp_xml).getroot() - # Modify Axoloti object file - massage_output(axo_temp_output_file, axo_output_file, xml) + # Modify Axoloti object file + massage_output(temp.name, axo_output_file, xml) def arguments(): |