Current File : //usr/lib/python3/dist-packages/apport/crashdb_impl/__pycache__/memory.cpython-312.pyc |
�
�!f{- � �^ � d Z ddlZddlZddlZ G d� dej
j � Zy)zISimple in-memory CrashDatabase implementation, mainly useful for testing.� Nc � � e Zd ZdZd� Zdd�Zd� Zd� Zd� Zd� Z d � Z
d
� Z dd�Zd� Z
d
� Zd� Zd� Zd� Zd� Zd� Zd� Zdd�Zd� Zd� Zd� Zd� Zy)�
CrashDatabasez�Simple implementation of crash database interface which keeps everything
in memory.
This is mainly useful for testing and debugging.
c �� � t j j j | ||� g | _ t � | _ t � | _ d| _ d| _ d|v r| j � yy)ztInitialize crash database connection.
This class does not support bug patterns and authentication.
r N�sample_data)�apport�crashdbr �__init__�reports�set�
unretraced�
dup_unchecked�upload_delay�
upload_msg�add_sample_data)�self� auth_file�optionss �</usr/lib/python3/dist-packages/apport/crashdb_impl/memory.pyr zCrashDatabase.__init__ sd � �
���$�$�-�-�d�I�w�G� ����%��� �U����������G�#�� � �"� $� Nc � � | j |� sJ �|r/| j r# || j d | j d � | j j |dddd�� t | j � dz
}d|v r| j
j
|� n| j j
|� | j r5|r |dd� t j | j � |r |dd� |S )z�Store the report and return a handle number (starting from 0).
This does not support (nor need) progress callbacks.
r � N� )�report�
fixed_version�dup_of�comment� Traceback�d )�acceptsr r
�append�lenr
�addr r �time�sleep)r r �progress_callback�user_message_callback�crash_ids r �uploadzCrashDatabase.upload/ s� � �
�|�|�F�#�#�#� �T�_�_�!�$�/�/�!�"4�d�o�o�a�6H�I���������QS�T�
� �t�|�|�$�q�(���&� ����"�"�8�,��O�O����)� ��� �!�!�S�)��J�J�t�(�(�)� �!�#�s�+��r c �* � d|v rd|d � d|� �S d|� �S )z�Return http://<sourcepackage>.bugs.example.com/<handle> for package
bugs or http://bugs.example.com/<handle> for reports without a
SourcePackage.
�
SourcePackagezhttp://z.bugs.example.com/zhttp://bugs.example.com/� )r r �handles r �get_comment_urlzCrashDatabase.get_comment_urlL s3 � �
�f�$��V�O�4�5�5G��x�P�P�)�&��2�2r c �&