Daniel's pylint.bat works fine for me, WindowsXP, Python 2.6.4.

Jonathan Hartley      Made of meat.      http://tartley.com
tart...@tartley.com   +44 7737 062 225   twitter/skype: tartley



On 29/12/2009 22:00, Daniel Harding wrote:
Pierre Rouleau wrote:

Unfortunately, the pylint.bat file as submitted by Daniel does not completely work (at least on XP SP3, and probably other versions as well). The problem lies in the fact that SHIFT does not remove the --exitcode from %* expansion but removes it from "%~f0", the reverse from what is wanted in the original intent of the code.

Thanks for catching that - I wasn't aware of that.

Another problem with the submitted batch is the fact that endlocal is
never called (but selocal is called twice).

The second setlocal was accidentally left from an earlier version of the file. However, endlocal is not needed, because an implicit endlocal is performed by Windows when the batch file finishes for every setlocal that is called during the batch file.

I created a new version of pylint.bat that solves the mentioned problems. It has a limitation of being able to support only 8 parameters when the --exitcode parameter is specified. I wish Ièd found a better way to handle the arguments but, as I said, SHIFT does not impact %* expansion. If anyone has a better idea, let me know.

I was able to find a technique on Stack Overflow to get an arbitrary number of arguments:

http://stackoverflow.com/questions/761615/is-there-a-way-to-indicate-the-last-n-parameters-in-a-batch-file

I adapted the code shown there to implement removing the --exitcode parameter and passing all remaining arguments to python. Currently the code I have written only detects the --exitcode parameter if it is the first argument, but it would be easy to modify the code to detect and remove the --exitcode parameter from any position in the argument list.

I have attached my latest revision of pylint.bat.  Feedback is welcome.

Cheers,

Daniel


_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects
_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to