Changeset ad5203c for python/generator.py
- Timestamp:
- Mar 5, 2013, 5:46:48 PM (11 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 63f6c13
- Parents:
- 208336b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/generator.py
r208336b rad5203c 28 28 return cpp_output, cpp_objects 29 29 30 def generate_object_files( ):31 if os.path.isdir( 'generated'): shutil.rmtree('generated')32 os.mkdir( 'generated')30 def generate_object_files(output_path): 31 if os.path.isdir(output_path): shutil.rmtree(output_path) 32 os.mkdir(output_path) 33 33 34 34 generated_objects = [] … … 49 49 for this_object in cpp_objects: 50 50 lint = 0 51 51 52 52 if this_object[-2:] == '_t': 53 53 object_name = this_object[:-2] … … 127 127 if 1: #try: 128 128 s = gen_new_init(new_methods[0], short_name) 129 s += gen_do(do_methods[0], short_name) 129 s += gen_do(do_methods[0], short_name) 130 130 s += gen_members(new_methods[0], short_name) 131 131 s += gen_methods(get_methods, set_methods, short_name) 132 132 s += gen_finish(short_name) 133 generated_filepath = 'generated/gen-'+short_name+'.c'133 generated_filepath = os.path.join(output_path,'gen-'+short_name+'.c') 134 134 fd = open(generated_filepath, 'w') 135 135 fd.write(s) … … 175 175 }""" 176 176 177 fd = open( 'generated/aubio-generated.h', 'w')177 fd = open(os.path.join(output_path,'aubio-generated.h'), 'w') 178 178 fd.write(s) 179 179 180 180 from os import listdir 181 generated_files = listdir( 'generated')181 generated_files = listdir(output_path) 182 182 generated_files = filter(lambda x: x.endswith('.c'), generated_files) 183 generated_files = [ 'generated/'+f for f in generated_files]183 generated_files = [output_path+'/'+f for f in generated_files] 184 184 return generated_files 185 185 186 186 if __name__ == '__main__': 187 generate_object_files( )187 generate_object_files('gen')
Note: See TracChangeset
for help on using the changeset viewer.