
    yIfh                    T    d Z ddlmZ ddlmZmZ erddlmZ  G d d          ZdZ	dS )	z*Record information about tox environments.    )annotations)TYPE_CHECKINGAny)Outcomec                  J    e Zd ZdZddZddZddZddZedd            Z	dS )
EnvJournalz'Report the status of a tox environment.enabledboolnamestrreturnNonec                >    || _         || _        i | _        g | _        d S )N)_enabledr   _content	_executes)selfr	   r   s      C/var/www/piapp/venv/lib/python3.11/site-packages/tox/journal/env.py__init__zEnvJournal.__init__   s"    	(*46    keyvaluer   c                    || j         |<   dS )z
        Add a new entry under key into the event journal.

        :param key: the key under what to add the data
        :param value: the data to add
        N)r   )r   r   r   s      r   __setitem__zEnvJournal.__setitem__   s     #cr   c                    | j         S )z<:return: a flag indicating if the event journal is on or not)r   )r   s    r   __bool__zEnvJournal.__bool__   s
    }r   outcomer   run_idc                >    | j                             ||f           dS )z
        Add a command execution to the journal.

        :param outcome: the execution outcome
        :param run_id: the execution id
        N)r   append)r   r   r   s      r   add_executezEnvJournal.add_execute!   s%     	vw/00000r   dict[str, Any]c                6   g }g }| j         D ]y\  }}|j        |j        |j        |j        |j        |j        ||j        |j        d	}|	                    d          r|
                    |           d|
                    |           z|r|| d<   |r|| d<   | j        S )zN:return: the env journal content (merges explicit keys and execution commands))	commandoutputerrretcodeelapsedshow_on_standardr   startend)commandsbuildtestsetup)r   cmdoutr&   	exit_coder(   r)   r*   r+   
startswithr    r   )r   testsr/   r   r   ones         r   contentzEnvJournal.content*   s     ')&(#~ 	" 	"OFG";!+{","?$+$<  {
 
C   !677 "S!!!!S!!!! 	! DL 	"!DM}r   N)r	   r
   r   r   r   r   )r   r   r   r   r   r   )r   r
   )r   r   r   r   r   r   )r   r"   )
__name__
__module____qualname____doc__r   r   r   r!   propertyr6    r   r   r   r      s        117 7 7 7# # # #   1 1 1 1    X  r   r   )r   N)
r:   
__future__r   typingr   r   tox.executer   r   __all__r<   r   r   <module>rA      s    0 0 " " " " " " % % % % % % % % $######8 8 8 8 8 8 8 8v r   