[Distutils] Stylistic comments

Greg Ward gward@python.net
Thu, 10 Feb 2000 21:56:13 -0500


On 10 February 2000, Thomas Heller said:
> As Robin already said, this had been fixed some time ago, but it
> somehow made it back in my version.
> I have to admit that the patch I sent last night was not the latest
> one Robin and I had agreed on. It was the newest one I had on
> my harddrive though...

Oops!  Oh well, it happens to the best of us.

> Attached is another msvccompiler.py (zipped),
> and hopefully Robin can agree on this one.
> I've already included the doc-strings Robin has
> supplied.

Merging in the changes now.  (And let me just say that ediff -- a
super-duper-ultra-mega-diff with file-merge capabilities for [X]Emacs --
is *way* cool.)  One question: you took away the bare 'except' in
'_find_exe()', but now don't catch KeyError from the 'os.environ' lookup
at all.  Bad thing?

OK, I've merged in the changes.  Actually, it turns out that I accepted
all the diffs, so I am just using the version of msvccompiler.py that
you sent me -- good.

I made one additional change: added a docstring for 'find_exe()'
(renamed from '_find_exe()' because I don't buy the need for underscores 
-- nobody is doing "from msvccompiler import *"):

  def find_exe (exe, version_number):
      """Try to find an MSVC executable program 'exe' (from version
         'version_number' of MSVC) in several places: first, one of the MSVC
         program search paths from the registry; next, the directories in the
         PATH environment variable.  If any of those work, return an absolute
         path that is known to exist.  If none of them work, just return the
         original program name, 'exe'."""

Correct?

There, I've checked in those changes -- rev. 1.13 of msvccompiler.py.

And finally, I can see no reason for the '_find_SET()' function to exist
at all -- both calls to it can be changed to 'get_msvc_paths()'.  Anyone
have anything to see in defence of '_find_SET()'?  ...OK, I've removed
'_find_SET()' and made some other stylistic surgery, now checked in as
rev. 1.14.  This is *completely* untested, as usual -- please try it out
and make sure I didn't screw anything up.  ;-)

> BTW: What is the preferred format posting sourcecode to the list?
> AFAIK, zipped attachments are not so nice in the archive,
> unpacked source-code has the white-space problem in
> Outlook Express, which I'm using here...

For cases like this -- well-understood, thoroughly-discussed changes --
go ahead and mail me the code directly (gward@python.net).  The easiest
way for me to deal with it is if the code is directly attached, not in a 
zip file or what-have-you.  If you're using a mail client that is
incapable of dealing with "text/plain" (and this wouldn't surprise me
coming from Redmond), I don't know what to tell you.  Attaching a zip
file works, but it's a bit cumbersome on both ends.

> As soon as you extend the distutils framework to use
> temp-directories for building, I will submit a patch for msvc
> again.

That'll be a little while -- it's lower priority than fixing the "dist"
and "install" commands, and definitely lower priority than writing the
"bdist" command.  As long as building on Windows is *working*, I'm not
going to get *too* uptight about compiler turds being left in the wrong
place (although it is something I want to fix).

Happy hacking all -- pray for snow (at least in West Virginia!) --

        Greg
-- 
Greg Ward - just another /P(erl|ython)/ hacker          gward@python.net
http://starship.python.net/~gward/
Eschew obfuscation!