
    Zi5                    ~   S SK Jr  S/rS SKrS SKrS SKrS SKrS SKJrJ	r	J
r
JrJrJrJrJrJr  SSKJrJr  SSKJrJr  SSKJr  SS	KJr  SS
KJr  SSKJr  \(       a  SSKJ r   \RB                  " \"5      r#\#RI                  \RJ                  " 5       5        \" S5      r&\" S\RN                  S9r( " S S\	\(   5      r)g)    )annotations	RecipientN)	AnyGenericListOptionalTupleTYPE_CHECKINGTypeTypeVarUnion   )MSG_PATHOVERRIDE_CLASS)ErrorBehaviorPropertiesType)StandardViolationError)PropertiesStore)PermanentEntryID)msgPathToString)MSGFile_T_RT)boundc                  X   \ rS rSrSrS"S jrS#S jrS#S jrS$S%S jjrS&S jr	S'S	 jr
S(S
 jrS$S)S jjrS*S jrS+S jrS,S jrS-S jrS.S jrS-S jrS/S0S jjrS/S1S jjr\R,                  S2S j5       r\S2S j5       r\R,                  S3S j5       r\S4S j5       r\R,                  S5S j5       r\S2S j5       r\S6S j5       r\R,                  S5S j5       r\R,                  S5S j5       r \R,                  S2S j5       r!\R,                  S2S j5       r"\S7S j5       r#\S8S  j5       r$S!r%g)9r   $   z<
Contains the data of one of the recipients in an MSG file.
c                   [         R                  " U5      U l        Xl        U R	                  S5      (       d@  [
        R                  UR                  ;   a  [        R                  S5        O[        S5      S e[        U R                  S5      [        R                  5      U l        U R!                  S5      U l        U R"                  (       d  U R!                  S5      U l        U R!                  S5      U l        U R                  R'                  SS5      U l        U" SU R(                  -  5      U l        U R$                   S	U R"                   S
3U l        g )Nz__properties_version1.0z'Recipients MUST have a property stream.__substg1.0_39FEz__substg1.0_3003z__substg1.0_30010C150003r      z <>)weakrefref_Recipient__msg_Recipient__direxistsr   STANDARDS_VIOLATIONerrorBehaviorloggererrorr   r   	getStreamr   	RECIPIENT_Recipient__propsgetStringStream_Recipient__email_Recipient__namegetValue_Recipient__typeFlags_Recipient__type_Recipient__formatted)self_dirmsgrecipientTypeClasss       o/var/www/eduai.edurigo.com/question_generate/ques_gen_env/lib/python3.13/site-packages/extract_msg/recipient.py__init__Recipient.__init__)   s   [[%

{{45500C4E4EEFG,-VW]aa&t~~6O'PR`RjRjk++,>?||//0BCDL**+=><<00Q?(t/?/?)?@"kk]"T\\N!<    c                    U R                  5       =nc  [        S5      eUR                  U R                  [	        U5      /5      $ )z
Checks if stream exists inside the recipient folder.

:raises ReferenceError: The associated ``MSGFile`` instance has been
    garbage collected.
CThe MSGFile for this Recipient instance has been garbage collected.)r$   ReferenceErrorr&   r%   r   r5   filenamer7   s      r9   r&   Recipient.exists:   s>     ::<C( !fggzz4::x'@ABBr<   c                    U R                  5       =nc  [        S5      eUR                  U R                  [	        U5      /5      $ )z
Checks if the string stream exists inside the recipient folder.

:raises ReferenceError: The associated ``MSGFile`` instance has been
    garbage collected.
r>   )r$   r?   sExistsr%   r   r@   s      r9   rD   Recipient.sExistsE   s>     ::<C( !fgg{{DJJ(ABCCr<   Nc                    U R                  5       =nc  [        S5      eUR                  XR                  USU R                  5      $ )a  
Determines if the stream with the provided id exists.

The return of this function is 2 values, the first being a boolean for if anything was found, and the second being how many were found.

:raises ReferenceError: The associated ``MSGFile`` instance has been
    garbage collected.
r>   T)r$   r?   existsTypedPropertyr%   r-   )r5   id_typer7   s       r9   rG   Recipient.existsTypedPropertyP   s@     ::<C( !fgg&&r::udDLLQQr<   c                    U R                  5       =nc  [        S5      eUR                  U R                  [	        U5      /5      $ )aO  
Gets a multiple binary property as a list of bytes objects.

Like :meth:`getStringStream`, the 4 character type suffix should be
omitted. So if you want the stream "__substg1.0_00011102" then the
filename would simply be "__substg1.0_0001".

:raises ReferenceError: The associated ``MSGFile`` instance has been
    garbage collected.
r>   )r$   r?   getMultipleBinaryr%   r   r@   s      r9   rL   Recipient.getMultipleBinary]   @     ::<C( !fgg$$djj/(2K%LMMr<   c                    U R                  5       =nc  [        S5      eUR                  U R                  [	        U5      /5      $ )aM  
Gets a multiple string property as a list of str objects.

Like :meth:`getStringStream`, the 4 character type suffix should be
omitted. So if you want the stream "__substg1.0_00011102" then the
filename would simply be "__substg1.0_0001".

:raises ReferenceError: The associated ``MSGFile`` instance has been
    garbage collected.
r>   )r$   r?   getMultipleStringr%   r   r@   s      r9   rP   Recipient.getMultipleStringl   rN   r<   c                >    U R                  U5      nUb  U" U5      nU$ )a  
Returns the property, setting the class if found.

:param overrideClass: Class/function to use to morph the data that was
    read. The data will be the first argument to the class's
    ``__init__`` method or the function itself, if that is what is
    provided. If the value is ``None``, this function is not called. If
    you want it to be called regardless, you should handle the data
    directly.
)getPropertyVal)r5   propertyNameoverrideClassvalues       r9   getPropertyAsRecipient.getPropertyAs{   s)     ##L1!%(Er<   c                8    U R                   R                  X5      $ )zW
``instance.props.getValue(name, default)``

Can be overridden to create new behavior.
)propsr1   )r5   namedefaults      r9   rS   Recipient.getPropertyVal   s     zz""411r<   c                    U R                  5       =nc  [        S5      eUR                  U R                  [	        U5      /5      $ )a  
A combination of :meth:`getStringStream` and :meth:`getMultipleString`.

Checks to see if a single binary stream exists to return, otherwise
tries to return the multiple binary stream of the same ID.

Like :meth:`getStringStream`, the 4 character type suffix should be
omitted. So if you want the stream "__substg1.0_00010102" then the
filename would simply be "__substg1.0_0001".

:raises ReferenceError: The associated ``MSGFile`` instance has been
    garbage collected.
r>   )r$   r?   getSingleOrMultipleBinaryr%   r   r@   s      r9   r_   #Recipient.getSingleOrMultipleBinary   @     ::<C( !fgg,,djj/(:S-TUUr<   c                    U R                  5       =nc  [        S5      eUR                  U R                  [	        U5      /5      $ )a  
A combination of :meth:`getStringStream` and :meth:`getMultipleString`.

Checks to see if a single string stream exists to return, otherwise
tries to return the multiple string stream of the same ID.

Like :meth:`getStringStream`, the 4 character type suffix should be
omitted. So if you want the stream "__substg1.0_0001001F" then the
filename would simply be "__substg1.0_0001".

:raises ReferenceError: The associated ``MSGFile`` instance has been
    garbage collected.
r>   )r$   r?   getSingleOrMultipleStringr%   r   r@   s      r9   rc   #Recipient.getSingleOrMultipleString   ra   r<   c                    U R                  5       =nc  [        S5      eUR                  U R                  [	        U5      /5      $ )z
Gets a binary representation of the requested stream.

This should ALWAYS return a ``bytes`` object if it was found, otherwise
returns ``None``.

:raises ReferenceError: The associated ``MSGFile`` instance has been
    garbage collected.
r>   )r$   r?   r+   r%   r   r@   s      r9   r+   Recipient.getStream   s>     ::<C( !fgg}}djj/(*CDEEr<   c                >    U R                  U5      nUb  U" U5      nU$ )a  
Returns the specified stream, modifying it to the specified class if it
is found.

:param overrideClass: Class/function to use to morph the data that was
    read. The data will be the first argument to the class's
    ``__init__`` method or the function itself, if that is what is
    provided. If the value is ``None``, this function is not called. If
    you want it to be called regardless, you should handle the data
    directly.
r+   r5   streamIDrU   rV   s       r9   getStreamAsRecipient.getStreamAs   '     x(!%(Er<   c                    U R                  5       =nc  [        S5      eUR                  U R                  [	        U5      /5      $ )a  
Gets a string representation of the requested stream.

Rather than the full filename, you should only feed this function the
filename sans the type. So if the full name is "__substg1.0_001A001F",
the filename this function should receive should be "__substg1.0_001A".

This should ALWAYS return a string if it was found, otherwise returns
None.

:raises ReferenceError: The associated ``MSGFile`` instance has been
    garbage collected.
r>   )r$   r?   r.   r%   r   r@   s      r9   r.   Recipient.getStringStream   s@     ::<C( !fgg""DJJ0I#JKKr<   c                >    U R                  U5      nUb  U" U5      nU$ )a  
Returns the specified string stream, modifying it to the specified
class if it is found.

:param overrideClass: Class/function to use to morph the data that was
    read. The data will be the first argument to the class's
    ``__init__`` method or the function itself, if that is what is
    provided. If the value is ``None``, this function is not called. If
    you want it to be called regardless, you should handle the data
    directly.
rh   ri   s       r9   getStringStreamAsRecipient.getStringStreamAs   rm   r<   c                    U R                  5       =nc  [        S5      eUR                  XS5       Vs/ s H.  n[        U5      S:  d  M  US   U R                  :X  d  M)  USS PM0     sn$ s  snf )z
Lists the streams and or storages that exist in the recipient directory.

:returns: The paths *excluding* the recipient directory, allowing the
    paths to be directly used for accessing a file.
Nr>   Fr   r   )r$   r?   listDirlenr%   )r5   streamsstoragesr7   paths        r9   rt   Recipient.listDir   sy     ::<C( !fgg%([[E%J <%JTt9q= %)!W

%: QR%J < 	< <s   A+
A+	A+c                n    U R                  X5       Vs/ s H  nSR                  U5      PM     sn$ s  snf )z?
Like :meth:`listDir`, except it returns the paths as strings.
/)rt   join)r5   rv   rw   rx   s       r9   slistDirRecipient.slistDir  s/     ,0<<+JK+J4+JKKKs   2c                $    U R                  S5      $ )z 
The account of this recipient.
z__substg1.0_3A00r.   r5   s    r9   accountRecipient.account      
 ##$677r<   c                    U R                   $ )z
The recipient's email.
)r/   r   s    r9   emailRecipient.email      
 ||r<   c                .    U R                  S[        5      $ )z
The recipient's Entry ID.
z__substg1.0_0FFF0102)rk   r   r   s    r9   entryIDRecipient.entryID  s    
  68HIIr<   c                    U R                   $ )z!
The formatted recipient string.
)r4   r   s    r9   	formattedRecipient.formatted&      
 r<   c                $    U R                  S5      $ )z%
The instance key of this recipient.
z__substg1.0_0FF60102rh   r   s    r9   instanceKeyRecipient.instanceKey-      
 ~~455r<   c                    U R                   $ )z
The recipient's name.
)r0   r   s    r9   r[   Recipient.name4      
 {{r<   c                    U R                   $ )z+
The Properties instance of the recipient.
)r-   r   s    r9   rZ   Recipient.props;  r   r<   c                $    U R                  S5      $ )z#
The record key of this recipient.
z__substg1.0_0FF90102rh   r   s    r9   	recordKeyRecipient.recordKeyB  r   r<   c                $    U R                  S5      $ )z#
The search key of this recipient.
z__substg1.0_300B0102rh   r   s    r9   	searchKeyRecipient.searchKeyI  r   r<   c                $    U R                  S5      $ )z%
The SMTP address of this recipient.
r   r   r   s    r9   smtpAddressRecipient.smtpAddressP  r   r<   c                $    U R                  S5      $ )z3
The transmittable display name of this recipient.
z__substg1.0_3A20r   r   s    r9   transmittableDisplayName"Recipient.transmittableDisplayNameW  r   r<   c                    U R                   $ )z
The recipient type.
)r3   r   s    r9   typeRecipient.type^  r   r<   c                    U R                   $ )z=
The raw recipient type value and all the flags it includes.
)r2   r   s    r9   	typeFlagsRecipient.typeFlagse  r   r<   )__dir__email__formatted__msg__name__props__type__typeFlags)r6   strr7   r   r8   z	Type[_RT])rA   r   returnbool)N)r   zTuple[bool, int])rA   r   r   zOptional[List[bytes]])rA   r   r   zOptional[List[str]])rT   Union[int, str]rU   OVERRIDE_CLASS[_T]r   Optional[_T])r[   r   r\   r   r   zUnion[Any, _T])rA   r   r   z#Optional[Union[List[bytes], bytes]])rA   r   r   zOptional[Union[List[str], str]])rA   r   r   Optional[bytes])rj   r   rU   r   r   r   )rA   r   r   Optional[str])TF)rv   r   rw   r   r   zList[List[str]])rv   r   rw   r   r   z	List[str])r   r   )r   zOptional[PermanentEntryID])r   r   )r   r   )r   r   )r   r   )r   int)&__name__
__module____qualname____firstlineno____doc__r:   r&   rD   rG   rL   rP   rW   rS   r_   rc   r+   rk   r.   rq   rt   r}   	functoolscached_propertyr   propertyr   r   r   r   r[   rZ   r   r   r   r   r   r   __static_attributes__ r<   r9   r   r   $   s   ="	C	DRNN$2V$V$F&L$&
<L 8 8   J J     6 6     6 6 6 6 8 8 8 8      r<   )*
__future__r   __all__enumr   loggingr"   typingr   r   r   r   r	   r
   r   r   r   	constantsr   r   enumsr   r   
exceptionsr   properties.properties_storer   structures.entry_idr   utilsr   msg_classes.msgr   	getLoggerr   r)   
addHandlerNullHandlerr   IntEnumr   r   r   r<   r9   <module>r      s    " 
       0 0 . 8 1 " (			8	$   '%%' (T]eT\\*F  F r<   