shithub: aubio

Download patch

ref: b0f2cc5173771b459d0786113445457d9a43fba3
parent: f41957d7e1df4d72a8acc14dd50969ac9e3c732f
author: Paul Brossier <piem@piem.org>
date: Mon Jul 16 10:01:04 EDT 2012

generator.py: remove before generating

--- a/interfaces/python/generator.py
+++ b/interfaces/python/generator.py
@@ -2,7 +2,7 @@
 
 """ This file generates a c file from a list of cpp prototypes. """
 
-import os, sys
+import os, sys, shutil
 from gen_pyobject import write_msg, gen_new_init, gen_do, gen_members, gen_methods, gen_finish
 
 def get_cpp_objects():
@@ -28,6 +28,8 @@
   return cpp_output, cpp_objects
 
 def generate_object_files():
+  if os.path.isdir('generated'): shutil.rmtree('generated')
+  os.mkdir('generated')
 
   generated_objects = []
   cpp_output, cpp_objects = get_cpp_objects()
@@ -109,7 +111,6 @@
 
 
       # generate this_object
-      if not os.path.isdir('generated'): os.mkdir('generated')
       short_name = object_name[len('aubio_'):]
       if short_name in skip_objects:
               write_msg("-- INFO: skipping object", short_name )