automatically generating file dependency information from python tools

Jack Diederich jack at performancedrivers.com
Fri Apr 9 18:50:20 EDT 2004


On Fri, Apr 09, 2004 at 10:16:39PM +0000, Moosebumps wrote:
> Say you have a group of 20 programmers, and they're all writing python
> scripts that are simple data crunchers -- i.e. command line tools that read
> from one or more files and output one or more files.
> 
> I want to set up some sort of system that would automatically generate
> makefile type information from the source code of these tools.  Can anyone
> think of a good way of doing it?  You could make everyone call a special
> function that wraps the file() and detects whether they are opening the file
> for read or write.  If read, it's an input, if write, it's an output file
> (assume there is no r/w access).  Then I guess your special function would
> output the info in some sort of repository, which collects such info from
> all the individual data crunchers.
> 
> The other thing I could think of is statically analyzing the source code -- 
> but what if the filenames are generated dynamically?  I'd be interested in
> any ideas or links on this, I just started thinking about it today.  For
> some reason it seems to be a sort of problem to solve with metaclasses -- 
> but I haven't thought of exactly how.
> 

In answer to the question you /almost/ asked:

http://www.google.com/search?q=python+make+replacement




More information about the Python-list mailing list