a oe @sddlZddlZddlZddlZddlZddlZdddZddZedkrz&ddl Z e ej ddd\Z Z Wn.e jyZzeeWYdZ[n dZ[00dZZgZdZe D]V\ZZed krdZed kreed d \ZZeeefed kreZedkrdZqee dkr$edde dZe dZe d ZzeeWn eynedeYn0ej esedeeeeeeeeedS)Nc CsZt|}t||||}|dur.tddSt||||D]\} } t|| | q@dS)NZ Cancelled)win32apiZGetFullPathNamevssutilZMakeNewBuildNoprint bulkstampscanZSubstituteVSSInFile) vssProjectNamedescFileZ stampPathZfilesToSubstituteZ buildDescautobRebrandpathbuildinfileoutfilerHC:\Program Files\Certbot\pkgs\win32\scripts\VersionStamp\BrandProject.py BrandProjects  rcCsBt|tdtjtjdtjtjdftddS)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)rosr basenamesysargvexit)msgrrrusage(s"r__main__rzaf:d:rz-az-f=z-dz-rz'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)!rstringrrrrrr__name__getoptrZoptsargsZgetoptserrorrZbAutor Z stampFilesZdescoptvalsplitrrappendlenrr r statIOErrorisdirrrrrsR