a „oeå ã @s¢ddlZddlZddlZddlZddlZddlZddd„Zdd„Zedk�ržz&ddl Z e   ej dd…d¡\Z Z Wn.e jy ZzeeƒWYdZ[n dZ[00dZZgZdZe D]V\ZZed krÊdZed kròe ed d ¡\ZZe eef¡ed k�reZedkr¶dZq¶ee ƒdk�r$edƒde dZe dZe d Zze e¡Wn e�ynedeƒYn0ej  e¡�sŠedeƒeeeeeeeeƒdS)éNc CsZt |¡}t ||||¡}|dur.tdƒdSt |||¡|D]\} } t|| | ƒq@dS)NZ Cancelledé)Úwin32apiZGetFullPathNameÚvssutilZMakeNewBuildNoÚprintÚ bulkstampÚscanZSubstituteVSSInFile) ÚvssProjectNameÚdescFileZ stampPathZfilesToSubstituteZ buildDescÚautoÚbRebrandÚpathÚbuildÚinfileÚoutfile©rúHC:\Program Files\Certbot\pkgs\win32\scripts\VersionStamp\BrandProject.pyÚ BrandProjects  rcCsBt|ƒtdtj tjd¡tj tjd¡fƒt d¡dS)Na¢%s Usage: %s [options] vssProject descFile stampPath Automatically brand a VSS project with an automatically incremented build number, and stamp DLL/EXE files with the build number. Checks that no files are checked out in the project, and finds the last build number, and suggests the next number. Options: -a - Auto increment the build number, and brand (otherwise prompt for the build number after looking for the previous) -r - Restamp the files with the existing build number. -d - A description for the VSS Label. -f infile=outfile - Substitute special VSS labels in the specified text file with the text extracted from VSS. rr)rÚosr ÚbasenameÚsysÚargvÚexit)ÚmsgrrrÚusage(s"îÿrÚ__main__rzaf:d:rz-az-fú=éz-dz-réz'You must specify the required argumentsz$\z*The description file '%s' can not be foundz2The path to the files to stamp '%s' does not exist)Nrr)!rÚstringrrrrrrÚ__name__ÚgetoptrZoptsÚargsZgetoptsÚerrorrZbAutor Z stampFilesZdescÚoptÚvalÚsplitrrÚappendÚlenrr r ÚstatÚIOErrorÚisdirrrrrÚsRù