
    ,h}                         d dl Z d dlmZ d dlmZ d dlmZ  e j                  e      Z	e	j                   e j                                 G d de      Zy)    N)	constants)
Properties)	properHexc                   f    e Zd ZdZd Zed        Zed        Zed        Zed        Z	ed        Z
y)	
AttachmentzM
    Developer version of the `extract_msg.attachment.Attachment` class.
    c                 t   t         j                  |        || _        || _        t	        |j                  | j                  dg      t        j                        | _        |j                  |dg      r d| _
        |j                  |dg      | _        y|j                  |dg      r| j                  d   j                  dz  dk7  rt        j                  dd       t        j                  dd	j                  |             t        j                  dd
       t        j                  ddt!        | j                  j"                        z   dz          t        j                  dd       t        j                  dddj%                  |j'                  dd      D cg c]  }t)        |       c}      z          t        j                  dd       t        j                  dd       y|j*                  |dgz   | _        d| _
        |j/                  |j0                  | j,                        | _        yt3        d      c c}w )z
        :param msg: the Message instance that the attachment belongs to.
        :param dir_: the directory inside the msg file where the attachment is located.
        z__properties_version1.0z__substg1.0_37010102dataz__substg1.0_3701000D37050003      z*Printing details of NotImplementedError...z	dir_ = {}z$Writing properties stream to output:z(--------Start-Properties-Stream--------
z(
---------End-Properties-Stream---------z%Writing directory contents to output:z(--------Start-Directory-Content--------

Tz'---------End-Directory-Content---------z"End of NotImplementedError detailsmsgzUnknown attachment type.N)object__init___Attachment__msg_Attachment__dirr   
_getStreamr   TYPE_ATTACHMENT_Attachment__propsExists_Attachment__type_Attachment__datavalueloggerlogformatr   streamjoinlistDirrepr
prefixList_Attachment__prefix	__class__path	TypeError)selfr   dir_xs       d/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/extract_msg/dev_classes/attachment.pyr   zAttachment.__init__   s   
 	

!NNDJJ(ABC%%'
 ::t345 DK..$0F)GHDKZZ567Z(..4<

1JK

1k0067

1DE

1I'(;(;<=IJ K 

1EF

1I"ii#++dD:Q(RQa(RST U

1GH

1BC #$8N1O O#!mmCHHdmmD677 )Ss   H5c                     | j                   S )z.
        Returns the attachment data.
        )r   r&   s    r)   r	   zAttachment.data3       
 {{    c                     | j                   S )z\
        Returns the directory inside the msg file where the attachment is located.
        )r   r+   s    r)   dirzAttachment.dir:       
 zzr-   c                     | j                   S )zI
        Returns the Message instance the attachment belongs to.
        )r   r+   s    r)   r   zAttachment.msgA   r0   r-   c                     | j                   S )zD
        Returns the Properties instance of the attachment.
        )r   r+   s    r)   propszAttachment.propsH   s    
 ||r-   c                     | j                   S )z/
        Returns the type of the data.
        )r   r+   s    r)   typezAttachment.typeO   r,   r-   N)__name__
__module____qualname____doc__r   propertyr	   r/   r   r3   r5    r-   r)   r   r      sq    "8H          r-   r   )loggingextract_msgr   extract_msg.propertiesr   extract_msg.utilsr   	getLoggerr6   r   
addHandlerNullHandlerr   r   r;   r-   r)   <module>rC      sK     ! - '			8	$   %'%%' (I Ir-   