HEX
Server: LiteSpeed
System: Linux linux31.centraldnserver.com 4.18.0-553.83.1.lve.el8.x86_64 #1 SMP Wed Nov 12 10:04:12 UTC 2025 x86_64
User: salamatk (1501)
PHP: 8.1.33
Disabled: show_source, system, shell_exec, passthru, exec, popen, proc_open
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/sentry_sdk/__pycache__/attachments.cpython-37.pyc
B

Ta�@sXddlZddlZddlmZddlmZmZerDddlmZm	Z	m
Z
Gdd�de�ZdS)�N)�MYPY)�Item�
PayloadRef)�Optional�Union�Callablec@s&eZdZd	dd�Zdd�Zdd�ZdS)
�
AttachmentNFcCs||dkr|dkrtd��|dkr4|dk	r4tj�|�}|dkrDtd��|dkrZt�|�d}||_||_||_||_||_	dS)Nz)path or raw bytes required for attachmentz#filename is required for attachmentr)
�	TypeError�os�path�basename�	mimetypesZ
guess_type�bytes�filename�content_type�add_to_transactions)�selfrrrrr�r�G/opt/alt/python37/lib/python3.7/site-packages/sentry_sdk/attachments.py�__init__s	zAttachment.__init__cCsJd}|jdk	r*t|j�r"|��}q6|j}nt|jd�}t|d|j|jd�S)z-Returns an envelope item for this attachment.N)r�
attachment)�payload�typerr)r�callablerrrrr)rrrrr�to_envelope_item#s


zAttachment.to_envelope_itemcCsd|jfS)Nz<Attachment %r>)r)rrrr�__repr__5szAttachment.__repr__)NNNNF)�__name__�
__module__�__qualname__rrrrrrrrs
r)
r
r
Zsentry_sdk._typesrZsentry_sdk.enveloperr�typingrrr�objectrrrrr�<module>s