
    r@;j                        d dl Z d dlZd dlZd dlmZmZ d dlmZ 	 d dlZnD# e	$ r< ej
                            ej
                            edz                        d dlZY nw xY wg dZdeeef         dee         defd	Zd
 ZdefdZedk    rC eej                  dk    r ed            ej        d            eej        dd           dS dS )    N)IterableMapping)Valuesz/../../../Lib)z*.dllz*.pydz*.exez*.ocxvarsnamesreturnc                    d}|D ]V}t           D ]J}t          j        ||          r1t          j                            ||          }t          j                            |          \  }	}
|	                    d          |
z   }|
                                dk    }t          j                            |          |v r|t          j                            |                   }	 t          i | ||d          }t          j        ||           |dz  }# t          $ r)}t          d|d|j        d|j                   Y d	}~2d	}~ww xY wt          d
|           LX|S )z$Returns the number of stamped files.r   _dz.exe)descriptiondll   zCould not stampError-Nz&WARNING: description not provided for:)
g_patternsfnmatchospathjoinsplitextremovesuffixlowernormcaser   win32verstampstampOSErrorprintwinerrorstrerror)r   debugdescriptionsdirnamer   
numStampednamepatpathnamebaseextis_dllr   optionsexcs                  rC:\Users\Administrator\AppData\Local\Temp\2\pip-target-b0z114gj\lib\python\win32/scripts/VersionStamp/bulkstamp.pywalkr,   6   s    J J J 	J 	JCtS)) J7<<66G,,T22	c((..4.7##D))\99".rw/?/?/E/E"FK"(OtOKOOO# # &+Hg>>>"a

"   -$#LL        BDIII3	J6 s   !0D
EEEc                    i }i }t          | d                                          }t          t          |                    D ]}||                                         }|dk    r|d         dk    r|                    d          }|                    d          }|dk    s||k     r|}|dk    r)t          d|d	z   z             t          j        d	           |d |         }	||d                                          }
|	|v r|
||	<   |
||	<   d
|vr#t          d           t          j        d	           d|vr#t          d           t          j        d	           d|vr#t          d           t          j        d	           ||fS )Nr r   # 	z1ERROR: bad syntax in description file at line %d.r   productz4ERROR: description file is missing the product name.majorz<ERROR: description file is missing the major version number.minorz<ERROR: description file is missing the minor version number.)	open	readlinesrangelenstripfindr   sysexit)fnamer   retvarsr    linesilineidx1idx2keyvals              r+   load_descriptionsrH   ]   s    GL&&((E3u:: ( (Qx~~2::$q'S..99S>>D99T??DrzzTD[[rzzIQQRUSTTTuu+Ctuu+##%%Cd{{"$'S!DEEEgLMMMgLMMML      rootc           	         	 t          |           } n6# t          $ r) t          d| z             t          j        d           Y nw xY wd}g d}t          ||          \  }}| |d<   |                    |           d}t          j        |          D ]\  }	}
}|t          ||||	|          z  }t          d| d           d S )Nz'ERROR: build number is not a number: %sr   r   )r5   r6   subcompany	copyright
trademarksr4   buildzStamped z files.)	int
ValueErrorr   r=   r>   rH   updater   r,   )rP   rJ   desccustom_varsr   varListr   r    r"   	directorydirnames	filenamess               r+   scanrZ      s    E

   7%?@@@ EXXXG*499D,DMKKJ*,'$-- L L&	8Yd4iKKK

	
(Z
(
(
()))))s    0AA__main__   z:ERROR: incorrect invocation. See script's header comments.r   )r   r   r=   collections.abcr   r   optparser   r   ModuleNotFoundErrorr   appendabspath__file__r   strrQ   r,   rH   rZ   __name__r:   argvr   r>    rI   r+   <module>rg      s  B  				 



 - - - - - - - -         HOOBGOOH$>??@@@
  
!
#s(
!BJ3-!! ! ! !N"! "! "!J*c * * * *, z
s38}}JKKKD#(122, s   ! >A"!A"