Re: [A-A-P-develop] Adding a bdir() function
Brought to you by:
vimboss
From: Bram M. <Br...@mo...> - 2003-10-23 12:56:53
|
Adriaan de Groot wrote: > The attached patch adds a bdir() function to RecPython.py. The purpose > of this function is to prepend $BDIR to a (list of) filename. The > primary use is in actions, where using a construction like > > $BDIR/$-target may not be the right thing to do if $target already has > $BDIR prefixed to it. It certainly helps in the Qt module (patch also > attached). So instead, you can use `bdir(target)` which DTRT (IMO). I see a few problems/doubts here: - You explicitly use "/" instead of using os.path.join(). Python purists don't like this. - What if the current value of $BDIR is different from the build directory in the file name? An alternative would be to always remove the build dir from the file name and then prepend $BDIR. - Instead of checking for "build-" the locate_bdir() function can be used. This also takes care of ignoring case on MS-Windows. > The check to see if $BDIR is already in the filename is a little > primitive, though it might be broken by some creative soul with a > build-me/ subdirectory in a project. Perhaps I should also check for > the os name? And what if the OS name is "me"? :-) I think the user should be aware that Aap recognizes "build-me" as a build directory. That doesn't appear to be a bad restriction. Unless some wide-spread project does use this directory perhaps. -- Why doesn't Tarzan have a beard? /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html /// |