
    5j                     x    d Z ddlmZ ddlmZ ddlmZ dZdZdZ	dZ
 eeee	e
h      Zd	eeeef      d
edefdZy)zFraming scale enum SOT for shot_staging.framing_scale.

No regex fallback. Missing or invalid framing_scale fails fast with AppError.
    )Mapping)Optional)AppErrorclosemediumwideinsertstagingwherereturnc                8   t        | t              s(t        dd| dt        |       j                   dd      | j                  d      }|t        dd| dd      t        |t              r|t        vr$t        d	d
| d|dt        t               d      |S )z>Read the required framing_scale enum from shot_staging output.z"shot_staging.framing_scale_missingzframing_scale read failed at z : staging is not a mapping (got )i  )codemessagestatus_codeframing_scalezL: key absent. Legacy shot_staging cp likely; force re-run shot_staging step.z"shot_staging.framing_scale_invalidzframing_scale invalid at z: got z, expected one of )	
isinstancer   r   type__name__getstrVALID_FRAMING_SCALESsorted)r
   r   values      L/Users/manta/Documents/Projects/TheRoad-I1/backend/app/core/framing_scale.pyget_framing_scale_or_raiser      s     gw'5/w 7W../q2 
 	
 KK(E}5/w 7J J 
 	
 eS!U2F%F5+E7&	 B##)*>#?"@B 
 	
 L    N)__doc__collections.abcr   typingr   app.core.errorsr   FRAMING_CLOSEFRAMING_MEDIUMFRAMING_WIDEFRAMING_INSERT	frozensetr   r   objectr    r   r   <module>r)      st   
 $  $ 	 %gc6k*+% % 		%r   