Email Re: [Python-projects] Amélioration du script pylint.bat (et des autres)

from
subject
Re: [Python-projects] Amélioration du script pylint.bat (et des autres)
date
2005/01/03 18:10
On Mon, Jan 03, 2005 at 05:47:57PM +0100, Sylvain Thénault wrote:
> Bonjour

> On Thursday 25 November à 14:22, Jean Leporcq wrote:
> > Dans le script, il est utile de remplacer la ligne:
> > 
> > python %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
> > 
> > par la ligne:
> > 
> > python %~f0 %1 %2 %3 %4 %5 %6 %7 %8 %9
> > 
> > Ceci permet de récupérer le "full pathname" de la commande exécutée 
> > ("%~f " au lieu de "%0").

> intéressant. Un probleme, c'est que je comptais justement remplacer "%0
> %1 %2 %3 %4 %5 %6 %7 %8 %9" par "%*", ce qui est incompatible avec ce
> qui est proposé ici (au fait, quel est l'intérêt d'avoir ce "full
> pathname" ?). Si je m'inspire de bash, je me dis qu'on doit pouvoir
> faire quelque chose du genre "%~f0 %@". J'ai bon ?

One of the problem of the current pylint.bat script is that it does not
work correctly, unless the full name is used. In other words, if you put
the scripts directory in your PATH environment variable, you can call
"pylint"  from the command line, which will fail because %0 is then set
to "pylint", and the python interpreter cannot find the file. You can
also call it "pylint.bat" from the command line, but then againe, %0 is
"pylint.bat" and unless your current working directory is the one in
which that file is found, it won't work.

So the bat wrappers we are using need fixing. What remains to know is
which versions of windows support %~f0. If the answer is win9x and up,
then that's fine. Otherwise, if it is just winXP, the benefit is
doubious. Tests I made recently seem to indicate that on winXP, running
pylint.py works quite well.

-- 
Alexandre Fayolle                              LOGILAB, Paris (France).
http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org