On 8/31/06, Allen Bierbaum <al...@vr...> wrote:
> I have run into a build problem that led me to a feature idea.
>
> I would like to see a way to have the module_builder_t.split_module()
> method return a list of all the files it created.
>
> I have been running into a problem lately where a later run of my
> generation script may generate a different set of source files then a
> previous run. (for example removing a class) Py++ correctly generates
> the new code, but the old .cpp files are still in the source tree and
> get picked up by my build. If module builder returned a list of files,
> then I could check this against the files on disk and automatically
> remove old files that I don't need anymore.
>
> Thoughts? Anyone else think this would be useful or do you use another
> way to achieve the same results?
I think this could be useful. Do you always want to remove/delete not in use cpp
files? I am not sure.
I propose next changes:
def split_module( ..., on_unused_file_found=os.remove ):
...
find out unused files
for f in unused_files:
try:
on_unused_file_found( f )
catch exception, report to user and continue
return list of generated files
I also want to propose how to implement this feature:
multiple_files_t should define write_my_file ( better name is needed ) function:
def write_my_file( self, fpath, content ):
self.generated_files.append( fpath )
call to writer_t.write_file method
Of course multiple_files_t and class_multiple_files_t should be updated to
use new function.
Allen, I think it will take only few hours to implement this feature.
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|