
    H`j                     
   d dl Z d dlZd dlZd dlZd dlmZ  ee                                          j        d         Z	e	dz  Z
e	dz  Ze	dz  Ze	dz  Ze	dz  Ze	d	z  Zd
 Zd Zedk    r ej         e                       dS dS )    N)Path   zscript/validate-production.pyz log/production-verification.jsonzoutput/final.mp4zoutput/final-upload.mp4zlog/upload-transcode.jsonzoutput/info.txtc                    t          j                    }|                     d          5 t          fdd          D ]}|                    |           	 d d d            n# 1 swxY w Y   |                                S )Nrbc                  .                          d          S )Ni   )read)handles   script/assert-publish-ready.py<lambda>zsha.<locals>.<lambda>   s    &++o">">     r   )hashlibsha256openiterupdate	hexdigest)pathdigestblockr	   s      @r
   shar      s    ^F	4 !F>>>>DD 	! 	!EMM%    	!! ! ! ! ! ! ! ! ! ! ! ! ! ! ! s   ,A##A'*A'c                     t          j        t          j        t	          t
          dz            dgt
                    } | j        rt          d          t          j        t          j        t	          t                    gt
                    }|j        r|j        S t          d t          t          t          t          t          fD                       st          d          t!          j        t                                                    }t!          j        t                                                    }|                    di           }|                    d          d	u oF|                    d          d	u o.|                    d
          dk    o|                    d          |                    d          k    o|                    d          t)          t                    k    o|                    d          d	u o|                    d          d	u o|                    di                               d          du odt+          |                    dd                    t                                          j        k    o!t                                          j        dk     }|st          d          t1          t!          j        d	|d         t	          t                    t	          t                    t                                          j        |d         t	          t                    dd                     dS )Nz script/validate-workflow-copy.pyfull)cwdz#workflow-copy authority gate failedc              3   >   K   | ]}|                                 V  d S )N)exists).0r   s     r
   	<genexpr>zmain.<locals>.<genexpr>    s*      NNt{{}}NNNNNNr   z"Publish blocked: artifacts missingserver_verificationverifiedTstatus	completedsource_canon_sha256output_sha256under_one_gb	visual_qarequiredFoutput_bytesr   i ʚ;z9Publish blocked: upload copy hash/size/visual QA mismatchjob_id)publish_readyr"   master_videovideovideo_bytestranscode_job_idmetadata)ensure_ascii)
subprocessrunsys
executablestrPROJECT
returncodeRuntimeError	VALIDATORallREPORTFINALUPLOADTRANSMETA
SystemExitjsonloads	read_textgetr   intstatst_sizeprintdumps)	copy_gateresultreporttransservervalids         r
   mainrO      s*   G>`4`0a0acijpwxxxI B@AAA^S^S^^<'JJJF !  NN&%)MNNNNN ?=>>>Z((**++FJu(())EYY,b11F

:$& 		2IIj!!T)		2IIh;.		2 II+,,

;P0Q0QQ		2 IIo&&#f++5			2
 JJz""d*		2 JJ~&&$.		2 IIk2&&**:66%?		2 

>1--..&++--2GG		2 KKMM!M1 
  VTUUU	$*tFK`Dasvw|s}s}  IL  MS  IT  IT  ek  ep  ep  er  er  ez  PU  V^  P_  mp  qu  mv  mv  w  w  FK  L  L  L  M  M  M1r   __main__)r   r@   r0   r2   pathlibr   __file__resolveparentsr5   r8   r:   r;   r<   r=   r>   r   rO   __name__exit r   r
   <module>rX      s          



      
$x..
 
 
"
"
*1
-55		5	5$$	,	,--""    < zCHTTVV r   