On 21 September 2000, Mike Olson said:
There were a couple of spots were if we could abstract core distutils code into a function call (that we could override) it would make our lives that much nicer. Ex, I needed on little hook into install_lib.run (after the build and before the copy), but I had to reproduce the entire function call...
OK, I've split install_lib.run() up. It's now a three-liner:
self.build() outfiles = self.install() self.bytecompile(outfiles)
and I have no problems with making people cut-n-paste three lines of code in order to insert one. ;-) I *think* this approach is preferable to sticking in "pre_build()" and "post_install()" hooks, which are empty methods by default.
Try this out with the CVS version, but don't count on the interface staying the same -- ie. that 'bytecompile()' method might disappear, if byte-compilation moves to the build phase. Whatever goes out in 0.9.3 should be final.
another really useful thing for us on copy_file would be if the function told you if the file was copied....
Hmm, every time this comes up I can never remember why I didn't change it the last time around. Or maybe I did change it last time, and now you want the old behaviour back. Argh! Good thing I have CVS here to cover my you-know-what... ah! here we go:
revision 1.4 date: 2000/06/23 01:42:40; author: gward; state: Exp; lines: +6 -7 Bastian Kleineidam: 'copy_file()' now returns the output filename, rather than a boolean indicating whether it did the copy.
This bloody return value has bounced back and forth between "was it copied?" and "output filename", and I'm *not* changing it again! It makes my head hurt, which is not worth it over such a silly, trivial little thing. There is code out there that relies on getting the output filename back, regardless of whether the file was copied or not.